uros-db commented on code in PR #47873:
URL: https://github.com/apache/spark/pull/47873#discussion_r1732771909


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/SaveIntoDataSourceCommand.scala:
##########
@@ -44,8 +45,23 @@ case class SaveIntoDataSourceCommand(
   override def innerChildren: Seq[QueryPlan[_]] = Seq(query)
 
   override def run(sparkSession: SparkSession): Seq[Row] = {
-    val relation = dataSource.createRelation(
-      sparkSession.sqlContext, mode, options, Dataset.ofRows(sparkSession, 
query))
+    var relation: BaseRelation = null

Review Comment:
   I think it's best done like this, because `LogicalRelation` will require 
`relation` to be a `BaseRelation`, while we don't know if try/catch will return 
something, throw an exception or just pass
   
   I think we should catch only certain errors here, and not all possible 
exceptions



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to