You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "MaxGekk (via GitHub)" <gi...@apache.org> on 2024/10/09 13:34:19 UTC

Re: [PR] [SPARK-49892][SQL] Assign proper error class for _LEGACY_ERROR_TEMP_1136 [spark]

MaxGekk commented on code in PR #48367:
URL: https://github.com/apache/spark/pull/48367#discussion_r1793538801


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSource.scala:
##########
@@ -566,12 +569,15 @@ case class DataSource(
   }
 
   private def disallowWritingIntervals(
-      dataTypes: Seq[DataType],
+      dataTypesWithNames: Seq[(DataType, String)],
+      format: String,
       forbidAnsiIntervals: Boolean): Unit = {
-    dataTypes.foreach(
-      TypeUtils.invokeOnceForInterval(_, forbidAnsiIntervals) {
-      throw QueryCompilationErrors.cannotSaveIntervalIntoExternalStorageError()
-    })
+    dataTypesWithNames.foreach { case (dataType, columnName) =>
+      TypeUtils.invokeOnceForInterval(dataType, forbidAnsiIntervals) {
+      throw QueryCompilationErrors.cannotSaveIntervalIntoExternalStorageError(
+        format, toSQLId(columnName), toSQLType(dataType)

Review Comment:
   Better to follow existing convention, and apply quoting inside of `cannotSaveIntervalIntoExternalStorageError`



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org