You can either use a fully qualified name to register temporary view:
spark_session(sc) %>%
invoke("table", "my_database.my_table") %>%
invoke("createOrReplaceTempView", "my_view")
tbl(sc, "my_view")
or use sql
method to switch databases
spark_session(sc) %>% invoke("sql", "USE my_database")
and access table directly with dplyr:tbl
:
tbl(sc, "my_table")
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…