火花数据帧不附加表 [英] spark dataframe not appending to the table

查看:111
本文介绍了火花数据帧不附加表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用写表时,我无法追加到表数据框写

I am unable to append to a table when writing to a table using dataframe write

下面是我使用的命令

 df1.write.mode("append").jdbc("jdbc:jtds:sqlserver://noi-nipuna-w81/sams","sams", props)

This is the exception I get
java.sql.SQLException: There is already an object named 'sams' in the database.
        at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:372)

我在哪里犯了一个错误
我使用的火花1.4版

Where am I making a mistake I am using spark 1.4 version

推荐答案

我与MS SQL Server的同样的问题。我发现,更新的火花1.6.0解决了这一问题(<一个href=\"http://stackoverflow.com/questions/33065782/how-to-write-into-microsoft-sql-server-table-even-if-table-exist-using-pyspark/35311980#35311980\">link其他SO回答)。原因是检查,如果表中存在的童车查询。

I had the same problem with MS SQL Server. I found that updating Spark to 1.6.0 fixed the problem (link to the other SO answer). The reason was a buggy query for checking if the table exists.

这篇关于火花数据帧不附加表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆