SparkSQL Catalog

http://spark.apache.org/docs/latest/sql-programming-guide.html#
Catalog interface for Spark. To access this, use `SparkSession.catalog`.
Spark的目录界面。 要访问这个,使用`SparkSession.catalog`。
val catalog = spark.catalog

//hive-site指定的databases
catalog.listDatabases().show(false)



catalog.listDatabases().show(false)
catalog.listDatabases().map(x => x.description).show(false)
catalog.listTables().show(false)
catalog.listTables("dbname").filter(x => x.name.contains("page_view")).show(false)
catalog.listColumns("page_view").show(false)
catalog.isCached("page_view")
catalog.cacheTable("page_view")
catalog.uncacheTable("page_view")
catalog.listFunctions().show(false)

猜你喜欢

转载自blog.csdn.net/qq_15300683/article/details/80638193