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
We're using this library, in version v2.12.0-spark_3.4. We're running a Spark 3.4 streaming query with foreachBatch(...) in append mode that writes into Snowflake.
The function called by foreachBatch(...) looks something like this:
While running the query, we observe failures with this stacktrace:
Caused by: net.snowflake.client.jdbc.SnowflakeSQLLoggedException: No response or invalid response from GET request. Error: {}
at net.snowflake.client.core.SFSession.getQueryStatus(SFSession.java:190)
at net.snowflake.client.jdbc.SFAsyncResultSet.getStatus(SFAsyncResultSet.java:101)
at net.snowflake.client.jdbc.SFAsyncResultSet.getRealResults(SFAsyncResultSet.java:162)
at net.snowflake.client.jdbc.SFAsyncResultSet.getMetaData(SFAsyncResultSet.java:277)
at net.snowflake.spark.snowflake.io.StageWriter$.executeCopyIntoTable(StageWriter.scala:603)
at net.snowflake.spark.snowflake.io.StageWriter$.writeToTableWithStagingTable(StageWriter.scala:471)
at net.snowflake.spark.snowflake.io.StageWriter$.writeToTable(StageWriter.scala:299)
at net.snowflake.spark.snowflake.io.StageWriter$.writeToStage(StageWriter.scala:238)
at net.snowflake.spark.snowflake.io.package$.writeRDD(package.scala:106)
at net.snowflake.spark.snowflake.SnowflakeWriter.save(SnowflakeWriter.scala:91)
at net.snowflake.spark.snowflake.DefaultSource.createRelation(DefaultSource.scala:156)
at org.apache.spark.sql.execution.datasources.SaveIntoDataSourceCommand.run(SaveIntoDataSourceCommand.scala:49)
at org.apache.spark.sql.execution.command.ExecutedCommandExec.$anonfun$sideEffectResult$1(commands.scala:82)
at com.databricks.spark.util.FrameProfiler$.record(FrameProfiler.scala:94)
at org.apache.spark.sql.execution.command.ExecutedCommandExec.sideEffectResult$lzycompute(commands.scala:80)
at org.apache.spark.sql.execution.command.ExecutedCommandExec.sideEffectResult(commands.scala:79)
at org.apache.spark.sql.execution.command.ExecutedCommandExec.executeCollect(commands.scala:91)
at org.apache.spark.sql.execution.QueryExecution$$anonfun$$nestedInanonfun$eagerlyExecuteCommands$1$1.$anonfun$applyOrElse$3(QueryExecution.scala:272)
at org.apache.spark.sql.catalyst.QueryPlanningTracker$.withTracker(QueryPlanningTracker.scala:166)
...
Interestingly we observe that despite the failures, everything is correctly pushed to Snowflake. The failures occur randomly, we failed to correlate it with variables like number of rows transfered, duration or write, etc.
Could you share some insight on why this could be happening?
What is your advice in the short-term as a workaround? Would you recommend tweaking params.isExecuteQueryWithSyncMode to bypass that section of the code, if not, why?
@mauriciojost thanks for the update. I also noticed that it seems the root cause of this issue is from snowflake JDBC and it was confirmed that is something needed to improve.
We're using this library, in version
v2.12.0-spark_3.4
. We're running a Spark 3.4 streaming query withforeachBatch(...)
in append mode that writes into Snowflake.The function called by
foreachBatch(...)
looks something like this:While running the query, we observe failures with this stacktrace:
Interestingly we observe that despite the failures, everything is correctly pushed to Snowflake. The failures occur randomly, we failed to correlate it with variables like number of rows transfered, duration or write, etc.
We understand that
StageWriter.executeCopyIntoTable(...)
(https://github.com/snowflakedb/spark-snowflake/blob/v2.12.0-spark_3.4/src/main/scala/net/snowflake/spark/snowflake/io/StageWriter.scala#L489) can be run in two modes, depending on the value ofparams.isExecuteQueryWithSyncMode
.params.isExecuteQueryWithSyncMode
to bypass that section of the code, if not, why?Thanks for your help,
Mauricio & @Danjok
The text was updated successfully, but these errors were encountered: