Hi everybody,
I have tried hard to load Hive transactional table with Spark 2.2 but without success. Here below is my note:
|
non-transactional table |
transactional table |
Using hiveContext or
SparkSession
hiveContext.sql or spark.sql |
work |
not supporting |
Using jdbc connect to Hive
hiveContext.read.format("jdbc").options(Map("url"
-> url,"user" -> user, "password" -> password,
"dbtable" -> "table_test")).load()
OR
sparkSession.read.format("jdbc").option("url",
url).option("driver",
"org.apache.hive.jdbc.HiveDriver").option("dbtable",
"user_tnguy11.table_test").load().show() |
return empty table |
return empty table |
Using ORC files
hiveContext.read.format("orc").load("/apps/hive/warehouse/user_tnguy11.db/table_orc_test") |
work |
fail |
I am new to Spark. Any help would be appreciated. Thanks a lot.
Regards,
Tu