Options
- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Solved
Go to solution
I am trying to insert into HIVE table through spark-sql and it fails.. Any help ?
Labels:
- Labels:
-
Apache Spark
Contributor
Created ‎06-30-2017 11:58 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Below is the query I am using.
scala> sqlContext.sql("insert into table results_test_hive values('XXXXXXXXXX', 'm:X', 0.0)")Failed with below error, org.apache.spark.sql.AnalysisException: Unsupported language features in query: insert into table results_test_hive values('XXXXXXXXXX', 'm:X', 0.0)
1 ACCEPTED SOLUTION
Expert Contributor
Created ‎06-30-2017 12:36 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@rakanchi
Spark currently doesn't support "insert into feature", you need to create dataframe and append to the table.
var data = sqlContext.createDataFrame(Seq(("ZZ", "m:x", 34.0))).toDF("pv", "metric", "value") data.show() data.write.mode("append").saveAsTable("results_test_hive") println(sqlContext.sql("select * from results_test_hive").count())
1 REPLY 1
Expert Contributor
Created ‎06-30-2017 12:36 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@rakanchi
Spark currently doesn't support "insert into feature", you need to create dataframe and append to the table.
var data = sqlContext.createDataFrame(Seq(("ZZ", "m:x", 34.0))).toDF("pv", "metric", "value") data.show() data.write.mode("append").saveAsTable("results_test_hive") println(sqlContext.sql("select * from results_test_hive").count())
