“INSERT INTO …” with SparkSQL HiveContext

前端 未结 6 1347
你的背包
你的背包 2021-02-05 05:32

I\'m trying to run an insert statement with my HiveContext, like this:

hiveContext.sql(\'insert into my_table (id, score) values (1, 10)\')

Th

6条回答
  •  北恋
    北恋 (楼主)
    2021-02-05 06:00

    When you first time do this

    $data.write.mode("append").saveAsTable("my_table")
    

    you should replace "append" with "overwrite", Then, you can use "append".

提交回复
热议问题