【发布时间】:2021-01-17 05:14:22
【问题描述】:
当我从 synapse 数据库中读取 spark 中的表(使用 azure databricks)时遇到问题。该表定义如下:
CREATE TABLE A
(
[ID] [int] NOT NULL,
[Value] [int] NOT NULL,
[Description] [nvarchar](30) NOT NULL,
)
Description 字段可以为空白(即""),也可以包含空格。在突触中,我对这个字段没有任何问题,当我用 spark 读取表格时,也没有将其放入数据框。当我写df.show() 或df.count() 之类的东西时,问题就出现了。出现如下错误:
com.databricks.spark.sqldw.SqlDWSideException: Azure Synapse Analytics failed to execute the JDBC query produced by the connector.
Py4JJavaError: An error occurred while calling o1779.showString.
: com.databricks.spark.sqldw.SqlDWSideException: Azure Synapse Analytics failed to execute the JDBC query produced by the connector.
Underlying SQLException(s):
- com.microsoft.sqlserver.jdbc.SQLServerException: Query aborted-- the maximum reject threshold (0 rows) was reached while reading from an external source: 1 rows rejected out of total 1 rows processed.
Column ordinal: 2, Expected data type: NVARCHAR(30) collate SQL_Latin1_General_CP1_CI_AS NOT NULL. [ErrorCode = 107090] [SQLState = S0001]
【问题讨论】:
标签: apache-spark pyspark azure-databricks azure-synapse