You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Py4JJavaError: An error occurred while calling o3400.save.
: java.lang.NoSuchMethodError: org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$.getSchema(Ljava/sql/ResultSet;Lorg/apache/spark/sql/jdbc/JdbcDialect;Z)Lorg/apache/spark/sql/types/StructType;
If I use Apache Spark sql connctor with "truncate" option is set to true it's throwing above error message. If I used truncate option false which drops the destination table and recreate with different schema: for example: char(2) will be set to nvarchar(max) in the destination sql table. Any recommendation to fix this issue.
The text was updated successfully, but these errors were encountered:
Py4JJavaError: An error occurred while calling o3400.save.
I am assuming that you're using Databricks? If so, the first exception you mentioned is a duplicate of #10. Unfortunately, there's not much we can do, it's a bug on Databricks from what I can tell.
drops the destination table and recreate with different schema
This is the intended behaviour if your column is of StringType. The schema of the DataFrame will be used to recreate the table, not the schema of the existing table.
The only option I see is that you try to manually truncate or drop/recreate your table using a JDBC connection and not through the SQL Spark connector. You could then append the data to the newly created/truncated table.
Py4JJavaError: An error occurred while calling o3400.save.
: java.lang.NoSuchMethodError: org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$.getSchema(Ljava/sql/ResultSet;Lorg/apache/spark/sql/jdbc/JdbcDialect;Z)Lorg/apache/spark/sql/types/StructType;
If I use Apache Spark sql connctor with "truncate" option is set to true it's throwing above error message. If I used truncate option false which drops the destination table and recreate with different schema: for example: char(2) will be set to nvarchar(max) in the destination sql table. Any recommendation to fix this issue.
The text was updated successfully, but these errors were encountered: