【发布时间】:2023-04-07 18:50:01
【问题描述】:
我是 Spark 的新手。我想将数据帧数据写入 hive 表。 Hive 表在多列上分区。通过 Hivemetastore 客户端,我获取了分区列,并将其作为数据帧写入方法的 partitionby 子句中的变量传递。
var1="country","state" (Getting the partiton column names of hive table)
dataframe1.write.partitionBy(s"$var1").mode("overwrite").save(s"$hive_warehouse/$dbname.db/$temp_table/")
当我执行上面的代码时,它给了我错误partiton "country","state" does not exist。 我认为它将“国家”、“州”作为字符串。
你能帮帮我吗?
【问题讨论】:
标签: apache-spark apache-spark-sql hive-metastore