Spark reads the hive table and gets the partition fields

spark.table(hiveTable).sparkSession.catalog.listColumns(hiveTable)
.filter(x => x.isPartition).map(_.name)

Guess you like

Origin blog.csdn.net/weixin_43015677/article/details/130940673