【发布时间】:2021-09-03 08:10:12
【问题描述】:
我正在使用 spark 读取 CSV 文件,并使用 sparl JDBC Hive 将 DF 作为表存储在 HIVE 中。
val df = spark.read.format("csv").load("PATH_TO_CSV");
df.write
.format("jdbc")
.option("url", "jdbc:hive2://127.0.0.1:10000/default")
.option("dbtable", "student2")
.option("user", "hive")
.option("password", "hive")
.mode(SaveMode.Overwrite).save;
我在 spark shell 中遇到异常,不知道为什么会遇到此异常
org.apache.hive.service.cli.HiveSQLException: Error while compiling statement: FAILED: ParseException line 1:25 cannot recognize input near '"_c0"' 'TEXT' ',' in column name or primary key or foreign key
at org.apache.hive.jdbc.Utils.verifySuccess(Utils.java:279)
at org.apache.hive.jdbc.Utils.verifySuccessWithInfo(Utils.java:265)
at org.apache.hive.jdbc.HiveStatement.runAsyncOnServer(HiveStatement.java:303)
at org.apache.hive.jdbc.HiveStatement.execute(HiveStatement.java:244)
at infoworks.tools.hive.HiveUtils.execStmts(HiveUtils.java:506)
at infoworks.tools.hive.HiveUtils.createHiveTable(HiveUtils.java:740)
谁能帮助我为什么会遇到上述异常?
【问题讨论】:
标签: scala apache-spark hive