Mi piacerebbe salvare i dati in un dataframe Spark (v 1.3.0) in una tabella Hive usando PySpark.salva Spark dataframe su Hive: tabella non leggibile perché "parquet not a SequenceFile"
I documentation stati:
"spark.sql.hive.convertMetastoreParquet: Quando è impostato su false, Spark SQL utilizzerà il Hive SerDe per tavoli in legno al posto del supporto integrato".
Guardando il Spark tutorial, è sembra che questa proprietà può essere impostata:
from pyspark.sql import HiveContext
sqlContext = HiveContext(sc)
sqlContext.sql("SET spark.sql.hive.convertMetastoreParquet=false")
# code to create dataframe
my_dataframe.saveAsTable("my_dataframe")
Tuttavia, quando si tenta di interrogare la tabella salvata in Hive restituisce:
hive> select * from my_dataframe;
OK
Failed with exception java.io.IOException:java.io.IOException:
hdfs://hadoop01.woolford.io:8020/user/hive/warehouse/my_dataframe/part-r-00001.parquet
not a SequenceFile
Come faccio a salvare la tabella in modo che sia immediatamente leggibile in Hive?
Hai pubblicato esattamente la stessa risposta [qui] (http://stackoverflow.com/questions/31341498/save-spark-dataframe-as-dynamic-partitioned-table-in-hive/37504196#37504196).se ritieni che la domanda sia duplice, devi contrassegnarla come tale e non pubblicare la stessa risposta due volte imo. – Jaap
Sembra che il codice per TBL_HIVE_IS_NOT_HAPPY e TBL_HIVE_IS_HAPPY sia esattamente lo stesso. Mi sto perdendo qualcosa? –