【发布时间】:2017-03-20 18:55:44
【问题描述】:
许多搜索指向 pyspark 代码以在 hive 元存储中创建表,例如:
hivecx.sql("...create table syntax that matches the dataframe...")
df.write.mode("overwrite").partitionBy('partition_colname').insertInto("national_dev.xh_claimline")
我尝试了许多写/保存/插入和模式的变体,但总是得到:
Caused by: java.io.FileNotFoundException: File does not exist: /user/hive/warehouse/national_dev.db/xh_claimline/000000_0
表目录存在于 hadoop 中,但 000000_0 子目录不存在。我以为这是因为表是空的,我还没有写信。
hadoop fs -ls /user/hive/warehouse/national_dev.db/xh_claimline
Found 2 items
drwxrwxrwt - mryan hive 0 2017-03-20 12:26 /user/hive/warehouse/national_dev.db/xh_claimline/.hive-staging_hive_2017-03-20_12-26-35_382_2703713921168172595-1
drwxrwxrwt - mryan hive 0 2017-03-20 12:29 /user/hive/warehouse/national_dev.db/xh_claimline/.hive-staging_hive_2017-03-20_12-29-40_775_73045420253990110-1
在 Cloudera 上,Spark 版本: 17/03/20 11:45:21 信息 spark.SparkContext:运行 Spark 版本 1.6.0
【问题讨论】: