You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/06/18 20:55:40 UTC
[GitHub] [spark] beliefer opened a new pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
beliefer opened a new pull request #32958:
URL: https://github.com/apache/spark/pull/32958
### What changes were proposed in this pull request?
This PR group all exception messages in `sql/core/src/main/scala/org/apache/spark/sql`.
### Why are the changes needed?
It will largely help with standardization of error messages and its maintenance.
### Does this PR introduce _any_ user-facing change?
No. Error messages remain unchanged.
### How was this patch tested?
No new tests - pass all original tests to make sure it doesn't break any existing behavior.
--
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.
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
[GitHub] [spark] AmplabJenkins commented on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-866515261
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/140181/
--
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.
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
[GitHub] [spark] AmplabJenkins commented on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-863741345
--
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.
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
[GitHub] [spark] beliefer removed a comment on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
beliefer removed a comment on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-864488167
ping @allisonwang-db
--
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.
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
[GitHub] [spark] SparkQA commented on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-870824743
**[Test build #140370 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140370/testReport)** for PR 32958 at commit [`21ba64b`](https://github.com/apache/spark/commit/21ba64b5fe271cb23d05fd8076a04edec120a00f).
--
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
[GitHub] [spark] beliefer commented on a change in pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
beliefer commented on a change in pull request #32958:
URL: https://github.com/apache/spark/pull/32958#discussion_r656730245
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
##########
@@ -1647,4 +1643,300 @@ private[spark] object QueryCompilationErrors {
def invalidYearMonthIntervalType(startFieldName: String, endFieldName: String): Throwable = {
new AnalysisException(s"'interval $startFieldName to $endFieldName' is invalid.")
}
+
+ def queryFromRawFilesIncludeCorruptRecordColumnError(): Throwable = {
+ new AnalysisException(
+ """
+ |Since Spark 2.3, the queries from raw JSON/CSV files are disallowed when the
+ |referenced columns only include the internal corrupt record column
+ |(named _corrupt_record by default). For example:
+ |spark.read.schema(schema).csv(file).filter($\"_corrupt_record\".isNotNull).count()
+ |and spark.read.schema(schema).csv(file).select(\"_corrupt_record\").show().
+ |Instead, you can cache or save the parsed results and then send the same query.
+ |For example, val df = spark.read.schema(schema).csv(file).cache() and then
+ |df.filter($\"_corrupt_record\".isNotNull).count().
+ """.stripMargin('#'))
+ }
+
+ def userDefinedPartitionNotFoundInJDBCRelationError(
+ columnName: String, schema: String): Throwable = {
+ new AnalysisException(s"User-defined partition column $columnName not " +
+ s"found in the JDBC relation: $schema")
+ }
+
+ def invalidPartitionColumnTypeError(column: StructField): Throwable = {
+ new AnalysisException(
+ s"""
+ |Partition column type should be ${NumericType.simpleString},
+ |${DateType.catalogString}, or ${TimestampType.catalogString}, but
+ |${column.dataType.catalogString} found.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def tableOrViewAlreadyExistsError(name: String): Throwable = {
+ new AnalysisException(
+ s"Table or view '$name' already exists. SaveMode: ErrorIfExists.")
+ }
+
+ def columnNameContainsInvalidCharactersError(name: String): Throwable = {
+ new AnalysisException(
+ s"""
+ |Column name "$name" contains invalid character(s).
+ |Please use alias to rename it.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def textDataSourceWithMultiColumnsError(schema: StructType): Throwable = {
+ new AnalysisException(
+ s"Text data source supports only a single column, and you have ${schema.size} columns.")
+ }
+
+ def cannotResolveFieldReferenceError(ref: FieldReference, query: LogicalPlan): Throwable = {
+ new AnalysisException(s"Cannot resolve '$ref' using ${query.output}")
+ }
+
+ def v2ExpressionUnsupportedError(expr: V2Expression): Throwable = {
Review comment:
I just follow https://github.com/apache/spark/blob/f87e24d944332844d935ad6b3152ef628a10bdc8/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/DistributionAndOrderingUtils.scala#L24
I don't know the reason.
--
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.
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
[GitHub] [spark] beliefer commented on a change in pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
beliefer commented on a change in pull request #32958:
URL: https://github.com/apache/spark/pull/32958#discussion_r655934506
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
##########
@@ -1647,4 +1643,300 @@ private[spark] object QueryCompilationErrors {
def invalidYearMonthIntervalType(startFieldName: String, endFieldName: String): Throwable = {
new AnalysisException(s"'interval $startFieldName to $endFieldName' is invalid.")
}
+
+ def queryFromRawFilesIncludeCorruptRecordColumnError(): Throwable = {
+ new AnalysisException(
+ """
+ |Since Spark 2.3, the queries from raw JSON/CSV files are disallowed when the
+ |referenced columns only include the internal corrupt record column
+ |(named _corrupt_record by default). For example:
+ |spark.read.schema(schema).csv(file).filter($\"_corrupt_record\".isNotNull).count()
+ |and spark.read.schema(schema).csv(file).select(\"_corrupt_record\").show().
+ |Instead, you can cache or save the parsed results and then send the same query.
+ |For example, val df = spark.read.schema(schema).csv(file).cache() and then
+ |df.filter($\"_corrupt_record\".isNotNull).count().
+ """.stripMargin('#'))
Review comment:
Thank you. `stripMargin` is good enough.
--
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.
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
[GitHub] [spark] beliefer commented on a change in pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
beliefer commented on a change in pull request #32958:
URL: https://github.com/apache/spark/pull/32958#discussion_r656745122
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala
##########
@@ -1422,4 +1426,251 @@ object QueryExecutionErrors {
def invalidStreamingOutputModeError(outputMode: Option[OutputMode]): Throwable = {
new UnsupportedOperationException(s"Invalid output mode: $outputMode")
}
+
+ def multiFailuresInStageMaterializationError(error: Throwable): Throwable = {
+ new SparkException("Multiple failures in stage materialization.", error)
+ }
+
+ def unrecognizedCompressionSchemaTypeIDError(typeId: Int): Throwable = {
+ new UnsupportedOperationException(s"Unrecognized compression scheme type ID: $typeId")
+ }
+
+ def getParentLoggerNotImplementedError(className: String): Throwable = {
+ new SQLFeatureNotSupportedException(s"$className.getParentLogger is not yet implemented.")
+ }
+
+ def cannotCreateParquetConverterForTypeError(t: DecimalType, parquetType: String): Throwable = {
+ new RuntimeException(
+ s"""
+ |Unable to create Parquet converter for ${t.typeName}
+ |whose Parquet type is $parquetType without decimal metadata. Please read this
+ |column/field as Spark BINARY type.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def cannotCreateParquetConverterForDecimalTypeError(
+ t: DecimalType, parquetType: String): Throwable = {
+ new RuntimeException(
+ s"""
+ |Unable to create Parquet converter for decimal type ${t.json} whose Parquet type is
+ |$parquetType. Parquet DECIMAL type can only be backed by INT32, INT64,
+ |FIXED_LEN_BYTE_ARRAY, or BINARY.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def cannotCreateParquetConverterForDataTypeError(
+ t: DataType, parquetType: String): Throwable = {
+ new RuntimeException(s"Unable to create Parquet converter for data type ${t.json} " +
+ s"whose Parquet type is $parquetType")
+ }
+
+ def cannotAddMultiPartitionsOnNonatomicPartitionTableError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Nonatomic partition table $tableName can not add multiple partitions.")
+ }
+
+ def userSpecifiedSchemaUnsupportedByDataSourceError(provider: TableProvider): Throwable = {
+ new UnsupportedOperationException(
+ s"${provider.getClass.getSimpleName} source does not support user-specified schema.")
+ }
+
+ def cannotDropMultiPartitionsOnNonatomicPartitionTableError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Nonatomic partition table $tableName can not drop multiple partitions.")
+ }
+
+ def truncateMultiPartitionUnsupportedError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"The table $tableName does not support truncation of multiple partition.")
+ }
+
+ def overwriteTableByUnsupportedExpressionError(table: Table): Throwable = {
+ new SparkException(s"Table does not support overwrite by expression: $table")
+ }
+
+ def dynamicPartitionOverwriteUnsupportedByTableError(table: Table): Throwable = {
+ new SparkException(s"Table does not support dynamic partition overwrite: $table")
+ }
+
+ def failedMergingSchemaError(schema: StructType, e: SparkException): Throwable = {
+ new SparkException(s"Failed merging schema:\n${schema.treeString}", e)
+ }
+
+ def cannotBroadcastExceedMaxTableRowsError(
+ maxBroadcastTableRows: Long, numRows: Long): Throwable = {
+ new SparkException(
+ s"Cannot broadcast the table over $maxBroadcastTableRows rows: $numRows rows")
+ }
+
+ def cannotBroadcastExceedMaxTableBytesError(
+ maxBroadcastTableBytes: Long, dataSize: Long): Throwable = {
+ new SparkException("Cannot broadcast the table that is larger than" +
+ s" ${maxBroadcastTableBytes >> 30}GB: ${dataSize >> 30} GB")
+ }
+
+ def notEnoughMemoryToBuildAndBroadcastTableError(oe: OutOfMemoryError): Throwable = {
+ new OutOfMemoryError("Not enough memory to build and broadcast the table to all " +
+ "worker nodes. As a workaround, you can either disable broadcast by setting " +
+ s"${SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key} to -1 or increase the spark " +
+ s"driver memory by setting ${SparkLauncher.DRIVER_MEMORY} to a higher value.")
+ .initCause(oe.getCause)
+ }
+
+ def executeUnsupportedByExecError(execName: String): Throwable = {
+ new UnsupportedOperationException(s"$execName does not support the execute() code path.")
+ }
+
+ def cannotMergeClassWithOtherClassError(className: String, otherClass: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Cannot merge $className with $otherClass")
+ }
+
+ def continuousProcessingUnsupportedByDataSourceError(sourceName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Data source $sourceName does not support continuous processing.")
+ }
+
+ def failedReadDataError(failureReason: Throwable): Throwable = {
+ new SparkException("Data read failed", failureReason)
+ }
+
+ def failedGenerateEpochMarkerError(failureReason: Throwable): Throwable = {
+ new SparkException("Epoch marker generation failed", failureReason)
+ }
+
+ def failedWriteJobError(failureReason: Throwable): Throwable = {
+ new SparkException("Writing job aborted.", failureReason)
+ }
+
+ def foreachWriterAbortedDueToTaskFailureError(): Throwable = {
+ new SparkException("Foreach writer has been aborted due to a task failure")
+ }
+
+ def integerOverflowError(message: String): Throwable = {
+ new ArithmeticException(s"Integer overflow. $message")
+ }
+
+ def failedReadDeltaFileError(fileToRead: Path, clazz: String, keySize: Int): Throwable = {
+ new IOException(
+ s"Error reading delta file $fileToRead of $clazz: key size cannot be $keySize")
+ }
+
+ def failedReadSnapshotFileError(fileToRead: Path, clazz: String, message: String): Throwable = {
+ new IOException(s"Error reading snapshot file $fileToRead of $clazz: $message")
+ }
+
+ def cannotPurgeAsBreakInternalStateError(): Throwable = {
+ new UnsupportedOperationException("Cannot purge as it might break internal state.")
+ }
+
+ def cleanUpSourceFilesUnsupportedError(): Throwable = {
+ new UnsupportedOperationException("Clean up source files is not supported when" +
+ " reading from the output directory of FileStreamSink.")
+ }
+
+ def latestOffsetNotCalledError(): Throwable = {
+ new UnsupportedOperationException(
+ "latestOffset(Offset, ReadLimit) should be called instead of this method")
+ }
+
+ def legacyCheckpointDirectoryExistsError(
+ checkpointPath: Path, legacyCheckpointDir: String): Throwable = {
+ new SparkException(
+ s"""
+ |Error: we detected a possible problem with the location of your checkpoint and you
+ |likely need to move it before restarting this query.
+ |
+ |Earlier version of Spark incorrectly escaped paths when writing out checkpoints for
+ |structured streaming. While this was corrected in Spark 3.0, it appears that your
+ |query was started using an earlier version that incorrectly handled the checkpoint
+ |path.
+ |
+ |Correct Checkpoint Directory: $checkpointPath
+ |Incorrect Checkpoint Directory: $legacyCheckpointDir
+ |
+ |Please move the data from the incorrect directory to the correct one, delete the
+ |incorrect directory, and then restart this query. If you believe you are receiving
+ |this message in error, you can disable it with the SQL conf
+ |${SQLConf.STREAMING_CHECKPOINT_ESCAPED_PATH_CHECK_ENABLED.key}.
+ """.stripMargin)
+ }
+
+ def subProcessExitedError(
+ exitCode: Int, stderrBuffer: CircularBuffer, cause: Throwable): Throwable = {
+ new SparkException(s"Subprocess exited with status $exitCode. " +
+ s"Error: ${stderrBuffer.toString}", cause)
+ }
+
+ def outputDataTypeUnsupportedByNodeWithoutSerdeError(
+ nodeName: String, dt: DataType): Throwable = {
+ new SparkException(s"$nodeName without serde does not support " +
+ s"${dt.getClass.getSimpleName} as output data type")
+ }
+
+ def invalidStartIndexError(numRows: Int, startIndex: Int): Throwable = {
+ new ArrayIndexOutOfBoundsException(
+ "Invalid `startIndex` provided for generating iterator over the array. " +
+ s"Total elements: $numRows, requested `startIndex`: $startIndex")
+ }
+
+ def concurrentModificationOnExternalAppendOnlyUnsafeRowArrayError(
+ className: String): Throwable = {
+ new ConcurrentModificationException(
+ s"The backing $className has been modified since the creation of this Iterator")
+ }
+
+ def doExecuteBroadcastNotImplementedByNodeError(nodeName: String): Throwable = {
+ new UnsupportedOperationException(s"$nodeName does not implement doExecuteBroadcast")
+ }
+
+ def databaseNameConflictWithSystemPreservedDatabaseError(globalTempDB: String): Throwable = {
+ new SparkException(
+ s"""
+ |$globalTempDB is a system preserved database, please rename your existing database
+ |to resolve the name conflict, or set a different value for
+ |${GLOBAL_TEMP_DATABASE.key}, and launch your Spark application again.
+ """.stripMargin.split("\n").mkString(" "))
+ }
+
+ def commentOnTableUnsupportedError(): Throwable = {
+ new SQLFeatureNotSupportedException("comment on table is not supported")
+ }
+
+ def unsupportedUpdateColumnNullabilityError(): Throwable = {
+ new SQLFeatureNotSupportedException("UpdateColumnNullability is not supported")
+ }
+
+ def renameColumnUnsupportedForOlderMySQLError(): Throwable = {
+ new SQLFeatureNotSupportedException(
+ "Rename column is only supported for MySQL version 8.0 and above.")
+ }
+
+ def hitAnErrorWhenExecutingQueryError(e: Throwable): QueryExecutionException = {
Review comment:
Please refer https://github.com/apache/spark/blob/960a7e5fceb2799882e5264540b2074ba9413e89/sql/core/src/main/scala/org/apache/spark/sql/util/QueryExecutionListener.scala#L64
So there need return `Exception`.
--
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.
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
[GitHub] [spark] cloud-fan closed pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
cloud-fan closed pull request #32958:
URL: https://github.com/apache/spark/pull/32958
--
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
[GitHub] [spark] beliefer commented on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
beliefer commented on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-871867435
@allisonwang-db Thanks for review. @cloud-fan Thanks too.
--
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
[GitHub] [spark] beliefer commented on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
beliefer commented on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-870395801
ping @cloud-fan
--
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
[GitHub] [spark] AmplabJenkins commented on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-870942252
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/140370/
--
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
[GitHub] [spark] beliefer edited a comment on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
beliefer edited a comment on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-864488167
ping @allisonwang-db
--
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.
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
[GitHub] [spark] SparkQA commented on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-866540234
**[Test build #140183 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140183/testReport)** for PR 32958 at commit [`1d08c71`](https://github.com/apache/spark/commit/1d08c71ebb2c6dc96ec02c637a7ba70a323c0eec).
--
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.
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
[GitHub] [spark] SparkQA commented on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-866531973
Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/44708/
--
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.
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
[GitHub] [spark] beliefer edited a comment on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
beliefer edited a comment on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-864488167
ping @allisonwang-db
--
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.
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
[GitHub] [spark] SparkQA commented on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-863740741
--
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.
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
[GitHub] [spark] SparkQA removed a comment on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-866540234
**[Test build #140183 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140183/testReport)** for PR 32958 at commit [`1d08c71`](https://github.com/apache/spark/commit/1d08c71ebb2c6dc96ec02c637a7ba70a323c0eec).
--
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.
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
[GitHub] [spark] AmplabJenkins commented on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-865940078
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/140125/
--
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.
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
[GitHub] [spark] beliefer commented on a change in pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
beliefer commented on a change in pull request #32958:
URL: https://github.com/apache/spark/pull/32958#discussion_r656743625
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala
##########
@@ -1422,4 +1426,251 @@ object QueryExecutionErrors {
def invalidStreamingOutputModeError(outputMode: Option[OutputMode]): Throwable = {
new UnsupportedOperationException(s"Invalid output mode: $outputMode")
}
+
+ def multiFailuresInStageMaterializationError(error: Throwable): Throwable = {
+ new SparkException("Multiple failures in stage materialization.", error)
+ }
+
+ def unrecognizedCompressionSchemaTypeIDError(typeId: Int): Throwable = {
+ new UnsupportedOperationException(s"Unrecognized compression scheme type ID: $typeId")
+ }
+
+ def getParentLoggerNotImplementedError(className: String): Throwable = {
+ new SQLFeatureNotSupportedException(s"$className.getParentLogger is not yet implemented.")
+ }
+
+ def cannotCreateParquetConverterForTypeError(t: DecimalType, parquetType: String): Throwable = {
+ new RuntimeException(
+ s"""
+ |Unable to create Parquet converter for ${t.typeName}
+ |whose Parquet type is $parquetType without decimal metadata. Please read this
+ |column/field as Spark BINARY type.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def cannotCreateParquetConverterForDecimalTypeError(
+ t: DecimalType, parquetType: String): Throwable = {
+ new RuntimeException(
+ s"""
+ |Unable to create Parquet converter for decimal type ${t.json} whose Parquet type is
+ |$parquetType. Parquet DECIMAL type can only be backed by INT32, INT64,
+ |FIXED_LEN_BYTE_ARRAY, or BINARY.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def cannotCreateParquetConverterForDataTypeError(
+ t: DataType, parquetType: String): Throwable = {
+ new RuntimeException(s"Unable to create Parquet converter for data type ${t.json} " +
+ s"whose Parquet type is $parquetType")
+ }
+
+ def cannotAddMultiPartitionsOnNonatomicPartitionTableError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Nonatomic partition table $tableName can not add multiple partitions.")
+ }
+
+ def userSpecifiedSchemaUnsupportedByDataSourceError(provider: TableProvider): Throwable = {
+ new UnsupportedOperationException(
+ s"${provider.getClass.getSimpleName} source does not support user-specified schema.")
+ }
+
+ def cannotDropMultiPartitionsOnNonatomicPartitionTableError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Nonatomic partition table $tableName can not drop multiple partitions.")
+ }
+
+ def truncateMultiPartitionUnsupportedError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"The table $tableName does not support truncation of multiple partition.")
+ }
+
+ def overwriteTableByUnsupportedExpressionError(table: Table): Throwable = {
+ new SparkException(s"Table does not support overwrite by expression: $table")
+ }
+
+ def dynamicPartitionOverwriteUnsupportedByTableError(table: Table): Throwable = {
+ new SparkException(s"Table does not support dynamic partition overwrite: $table")
+ }
+
+ def failedMergingSchemaError(schema: StructType, e: SparkException): Throwable = {
+ new SparkException(s"Failed merging schema:\n${schema.treeString}", e)
+ }
+
+ def cannotBroadcastExceedMaxTableRowsError(
+ maxBroadcastTableRows: Long, numRows: Long): Throwable = {
+ new SparkException(
+ s"Cannot broadcast the table over $maxBroadcastTableRows rows: $numRows rows")
+ }
+
+ def cannotBroadcastExceedMaxTableBytesError(
+ maxBroadcastTableBytes: Long, dataSize: Long): Throwable = {
+ new SparkException("Cannot broadcast the table that is larger than" +
+ s" ${maxBroadcastTableBytes >> 30}GB: ${dataSize >> 30} GB")
+ }
+
+ def notEnoughMemoryToBuildAndBroadcastTableError(oe: OutOfMemoryError): Throwable = {
+ new OutOfMemoryError("Not enough memory to build and broadcast the table to all " +
+ "worker nodes. As a workaround, you can either disable broadcast by setting " +
+ s"${SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key} to -1 or increase the spark " +
+ s"driver memory by setting ${SparkLauncher.DRIVER_MEMORY} to a higher value.")
+ .initCause(oe.getCause)
+ }
+
+ def executeUnsupportedByExecError(execName: String): Throwable = {
+ new UnsupportedOperationException(s"$execName does not support the execute() code path.")
+ }
+
+ def cannotMergeClassWithOtherClassError(className: String, otherClass: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Cannot merge $className with $otherClass")
+ }
+
+ def continuousProcessingUnsupportedByDataSourceError(sourceName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Data source $sourceName does not support continuous processing.")
+ }
+
+ def failedReadDataError(failureReason: Throwable): Throwable = {
+ new SparkException("Data read failed", failureReason)
+ }
+
+ def failedGenerateEpochMarkerError(failureReason: Throwable): Throwable = {
+ new SparkException("Epoch marker generation failed", failureReason)
+ }
+
+ def failedWriteJobError(failureReason: Throwable): Throwable = {
+ new SparkException("Writing job aborted.", failureReason)
+ }
+
+ def foreachWriterAbortedDueToTaskFailureError(): Throwable = {
+ new SparkException("Foreach writer has been aborted due to a task failure")
+ }
+
+ def integerOverflowError(message: String): Throwable = {
+ new ArithmeticException(s"Integer overflow. $message")
+ }
+
+ def failedReadDeltaFileError(fileToRead: Path, clazz: String, keySize: Int): Throwable = {
+ new IOException(
+ s"Error reading delta file $fileToRead of $clazz: key size cannot be $keySize")
+ }
+
+ def failedReadSnapshotFileError(fileToRead: Path, clazz: String, message: String): Throwable = {
+ new IOException(s"Error reading snapshot file $fileToRead of $clazz: $message")
+ }
+
+ def cannotPurgeAsBreakInternalStateError(): Throwable = {
+ new UnsupportedOperationException("Cannot purge as it might break internal state.")
+ }
+
+ def cleanUpSourceFilesUnsupportedError(): Throwable = {
+ new UnsupportedOperationException("Clean up source files is not supported when" +
+ " reading from the output directory of FileStreamSink.")
+ }
+
+ def latestOffsetNotCalledError(): Throwable = {
+ new UnsupportedOperationException(
+ "latestOffset(Offset, ReadLimit) should be called instead of this method")
+ }
+
+ def legacyCheckpointDirectoryExistsError(
+ checkpointPath: Path, legacyCheckpointDir: String): Throwable = {
+ new SparkException(
+ s"""
+ |Error: we detected a possible problem with the location of your checkpoint and you
+ |likely need to move it before restarting this query.
+ |
+ |Earlier version of Spark incorrectly escaped paths when writing out checkpoints for
+ |structured streaming. While this was corrected in Spark 3.0, it appears that your
+ |query was started using an earlier version that incorrectly handled the checkpoint
+ |path.
+ |
+ |Correct Checkpoint Directory: $checkpointPath
+ |Incorrect Checkpoint Directory: $legacyCheckpointDir
+ |
+ |Please move the data from the incorrect directory to the correct one, delete the
+ |incorrect directory, and then restart this query. If you believe you are receiving
+ |this message in error, you can disable it with the SQL conf
+ |${SQLConf.STREAMING_CHECKPOINT_ESCAPED_PATH_CHECK_ENABLED.key}.
+ """.stripMargin)
+ }
+
+ def subProcessExitedError(
+ exitCode: Int, stderrBuffer: CircularBuffer, cause: Throwable): Throwable = {
+ new SparkException(s"Subprocess exited with status $exitCode. " +
+ s"Error: ${stderrBuffer.toString}", cause)
+ }
+
+ def outputDataTypeUnsupportedByNodeWithoutSerdeError(
+ nodeName: String, dt: DataType): Throwable = {
+ new SparkException(s"$nodeName without serde does not support " +
+ s"${dt.getClass.getSimpleName} as output data type")
+ }
+
+ def invalidStartIndexError(numRows: Int, startIndex: Int): Throwable = {
+ new ArrayIndexOutOfBoundsException(
+ "Invalid `startIndex` provided for generating iterator over the array. " +
+ s"Total elements: $numRows, requested `startIndex`: $startIndex")
+ }
+
+ def concurrentModificationOnExternalAppendOnlyUnsafeRowArrayError(
+ className: String): Throwable = {
+ new ConcurrentModificationException(
+ s"The backing $className has been modified since the creation of this Iterator")
+ }
+
+ def doExecuteBroadcastNotImplementedByNodeError(nodeName: String): Throwable = {
+ new UnsupportedOperationException(s"$nodeName does not implement doExecuteBroadcast")
+ }
+
+ def databaseNameConflictWithSystemPreservedDatabaseError(globalTempDB: String): Throwable = {
+ new SparkException(
+ s"""
+ |$globalTempDB is a system preserved database, please rename your existing database
+ |to resolve the name conflict, or set a different value for
+ |${GLOBAL_TEMP_DATABASE.key}, and launch your Spark application again.
+ """.stripMargin.split("\n").mkString(" "))
+ }
+
+ def commentOnTableUnsupportedError(): Throwable = {
+ new SQLFeatureNotSupportedException("comment on table is not supported")
+ }
+
+ def unsupportedUpdateColumnNullabilityError(): Throwable = {
+ new SQLFeatureNotSupportedException("UpdateColumnNullability is not supported")
+ }
+
+ def renameColumnUnsupportedForOlderMySQLError(): Throwable = {
+ new SQLFeatureNotSupportedException(
+ "Rename column is only supported for MySQL version 8.0 and above.")
+ }
+
+ def hitAnErrorWhenExecutingQueryError(e: Throwable): QueryExecutionException = {
+ val message = "Hit an error when executing a query" +
+ (if (e.getMessage == null) "" else s": ${e.getMessage}")
+ new QueryExecutionException(message, e)
+ }
+
+ def nestedFieldUnsupportedError(colName: String): Throwable = {
+ new UnsupportedOperationException(s"Nested field $colName is not supported.")
+ }
+
+ def transformationsAndActionsNotInvokedByDriverError(): Throwable = {
+ new SparkException(
+ """
+ |Dataset transformations and actions can only be invoked by the driver, not inside of
+ |other Dataset transformations; for example, dataset1.map(x => dataset2.values.count()
+ |* x) is invalid because the values transformation and count action cannot be
+ |performed inside of the dataset1.map transformation. For more information,
+ |see SPARK-28702.
+ """.stripMargin.split("\n").mkString(" "))
+ }
+
+ def repeatedPivotsUnsupportedError(): Throwable = {
+ new UnsupportedOperationException("repeated pivots are not supported")
+ }
+
+ def pivotNotAfterGroupByUnsupportedError(): Throwable = {
Review comment:
`pivotUsageUnsupportedError` causes confusion
--
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.
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
[GitHub] [spark] AmplabJenkins removed a comment on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-866573855
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/44710/
--
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.
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
[GitHub] [spark] beliefer commented on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
beliefer commented on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-870395801
ping @cloud-fan
--
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
[GitHub] [spark] SparkQA commented on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-866514437
**[Test build #140181 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140181/testReport)** for PR 32958 at commit [`9b1dafc`](https://github.com/apache/spark/commit/9b1dafc5d47d51cd0f7524a24653ca19383b934a).
--
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.
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
[GitHub] [spark] SparkQA removed a comment on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-863740741
--
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.
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
[GitHub] [spark] SparkQA removed a comment on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-866514437
**[Test build #140181 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140181/testReport)** for PR 32958 at commit [`9b1dafc`](https://github.com/apache/spark/commit/9b1dafc5d47d51cd0f7524a24653ca19383b934a).
--
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.
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
[GitHub] [spark] AmplabJenkins removed a comment on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-870942252
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/140370/
--
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
[GitHub] [spark] beliefer commented on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
beliefer commented on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-868149108
cc @cloud-fan
--
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.
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
[GitHub] [spark] AmplabJenkins removed a comment on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-863741345
--
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.
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
[GitHub] [spark] cloud-fan commented on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-871866880
thanks, merging to master!
--
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
[GitHub] [spark] AmplabJenkins commented on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-866573855
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/44710/
--
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.
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
[GitHub] [spark] SparkQA commented on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-865668929
**[Test build #140125 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140125/testReport)** for PR 32958 at commit [`f87e24d`](https://github.com/apache/spark/commit/f87e24d944332844d935ad6b3152ef628a10bdc8).
--
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.
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
[GitHub] [spark] AmplabJenkins removed a comment on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-866722971
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/140183/
--
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.
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
[GitHub] [spark] beliefer commented on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
beliefer commented on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-865486368
Gentle ping @allisonwang-db
--
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.
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
[GitHub] [spark] AmplabJenkins commented on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-866542051
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/44708/
--
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.
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
[GitHub] [spark] AmplabJenkins commented on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-866722971
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/140183/
--
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.
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
[GitHub] [spark] SparkQA commented on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-865668929
**[Test build #140125 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140125/testReport)** for PR 32958 at commit [`f87e24d`](https://github.com/apache/spark/commit/f87e24d944332844d935ad6b3152ef628a10bdc8).
--
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.
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
[GitHub] [spark] allisonwang-db commented on a change in pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
allisonwang-db commented on a change in pull request #32958:
URL: https://github.com/apache/spark/pull/32958#discussion_r655934785
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
##########
@@ -1647,4 +1643,300 @@ private[spark] object QueryCompilationErrors {
def invalidYearMonthIntervalType(startFieldName: String, endFieldName: String): Throwable = {
new AnalysisException(s"'interval $startFieldName to $endFieldName' is invalid.")
}
+
+ def queryFromRawFilesIncludeCorruptRecordColumnError(): Throwable = {
+ new AnalysisException(
+ """
+ |Since Spark 2.3, the queries from raw JSON/CSV files are disallowed when the
+ |referenced columns only include the internal corrupt record column
+ |(named _corrupt_record by default). For example:
+ |spark.read.schema(schema).csv(file).filter($\"_corrupt_record\".isNotNull).count()
+ |and spark.read.schema(schema).csv(file).select(\"_corrupt_record\").show().
+ |Instead, you can cache or save the parsed results and then send the same query.
+ |For example, val df = spark.read.schema(schema).csv(file).cache() and then
+ |df.filter($\"_corrupt_record\".isNotNull).count().
+ """.stripMargin('#'))
+ }
+
+ def userDefinedPartitionNotFoundInJDBCRelationError(
+ columnName: String, schema: String): Throwable = {
+ new AnalysisException(s"User-defined partition column $columnName not " +
+ s"found in the JDBC relation: $schema")
+ }
+
+ def invalidPartitionColumnTypeError(column: StructField): Throwable = {
+ new AnalysisException(
+ s"""
+ |Partition column type should be ${NumericType.simpleString},
+ |${DateType.catalogString}, or ${TimestampType.catalogString}, but
+ |${column.dataType.catalogString} found.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def tableOrViewAlreadyExistsError(name: String): Throwable = {
+ new AnalysisException(
+ s"Table or view '$name' already exists. SaveMode: ErrorIfExists.")
+ }
+
+ def columnNameContainsInvalidCharactersError(name: String): Throwable = {
+ new AnalysisException(
+ s"""
+ |Column name "$name" contains invalid character(s).
+ |Please use alias to rename it.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def textDataSourceWithMultiColumnsError(schema: StructType): Throwable = {
+ new AnalysisException(
+ s"Text data source supports only a single column, and you have ${schema.size} columns.")
+ }
+
+ def cannotResolveFieldReferenceError(ref: FieldReference, query: LogicalPlan): Throwable = {
+ new AnalysisException(s"Cannot resolve '$ref' using ${query.output}")
+ }
+
+ def v2ExpressionUnsupportedError(expr: V2Expression): Throwable = {
+ new AnalysisException(s"$expr is not currently supported")
+ }
+
+ def cannotFindPartitionColumnInPartitionSchemaError(
+ readField: StructField, partitionSchema: StructType): Throwable = {
+ new AnalysisException(s"Can't find required partition column ${readField.name} " +
+ s"in partition schema $partitionSchema")
+ }
+
+ def cannotSpecifyDatabaseForTempViewError(tableIdent: TableIdentifier): Throwable = {
+ new AnalysisException(
+ s"Temporary view '$tableIdent' should not have specified a database")
+ }
+
+ def cannotCreateTempViewUsingHiveDataSourceError(): Throwable = {
+ new AnalysisException("Hive data source can only be used with tables, " +
+ "you can't use it with CREATE TEMP VIEW USING")
+ }
+
+ def invalidTimestampProvidedForStrategyError(
+ strategy: String, timeString: String): Throwable = {
+ new AnalysisException(
+ s"The timestamp provided for the '$strategy' option is invalid. The expected format " +
+ s"is 'YYYY-MM-DDTHH:mm:ss', but the provided timestamp: $timeString")
+ }
+
+ def notSetHostOptionError(): Throwable = {
+ new AnalysisException("Set a host to read from with option(\"host\", ...).")
+ }
+
+ def notSetPortOptionError(): Throwable = {
+ new AnalysisException("Set a port to read from with option(\"port\", ...).")
+ }
+
+ def includeTimestampIsNotSuitableError(): Throwable = {
Review comment:
maybe `invalidIncludeTimestampValueError`
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
##########
@@ -1647,4 +1643,300 @@ private[spark] object QueryCompilationErrors {
def invalidYearMonthIntervalType(startFieldName: String, endFieldName: String): Throwable = {
new AnalysisException(s"'interval $startFieldName to $endFieldName' is invalid.")
}
+
+ def queryFromRawFilesIncludeCorruptRecordColumnError(): Throwable = {
+ new AnalysisException(
+ """
+ |Since Spark 2.3, the queries from raw JSON/CSV files are disallowed when the
+ |referenced columns only include the internal corrupt record column
+ |(named _corrupt_record by default). For example:
+ |spark.read.schema(schema).csv(file).filter($\"_corrupt_record\".isNotNull).count()
+ |and spark.read.schema(schema).csv(file).select(\"_corrupt_record\").show().
+ |Instead, you can cache or save the parsed results and then send the same query.
+ |For example, val df = spark.read.schema(schema).csv(file).cache() and then
+ |df.filter($\"_corrupt_record\".isNotNull).count().
+ """.stripMargin('#'))
+ }
+
+ def userDefinedPartitionNotFoundInJDBCRelationError(
+ columnName: String, schema: String): Throwable = {
+ new AnalysisException(s"User-defined partition column $columnName not " +
+ s"found in the JDBC relation: $schema")
+ }
+
+ def invalidPartitionColumnTypeError(column: StructField): Throwable = {
+ new AnalysisException(
+ s"""
+ |Partition column type should be ${NumericType.simpleString},
+ |${DateType.catalogString}, or ${TimestampType.catalogString}, but
+ |${column.dataType.catalogString} found.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def tableOrViewAlreadyExistsError(name: String): Throwable = {
+ new AnalysisException(
+ s"Table or view '$name' already exists. SaveMode: ErrorIfExists.")
+ }
+
+ def columnNameContainsInvalidCharactersError(name: String): Throwable = {
+ new AnalysisException(
+ s"""
+ |Column name "$name" contains invalid character(s).
+ |Please use alias to rename it.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def textDataSourceWithMultiColumnsError(schema: StructType): Throwable = {
+ new AnalysisException(
+ s"Text data source supports only a single column, and you have ${schema.size} columns.")
+ }
+
+ def cannotResolveFieldReferenceError(ref: FieldReference, query: LogicalPlan): Throwable = {
+ new AnalysisException(s"Cannot resolve '$ref' using ${query.output}")
+ }
+
+ def v2ExpressionUnsupportedError(expr: V2Expression): Throwable = {
+ new AnalysisException(s"$expr is not currently supported")
+ }
+
+ def cannotFindPartitionColumnInPartitionSchemaError(
+ readField: StructField, partitionSchema: StructType): Throwable = {
+ new AnalysisException(s"Can't find required partition column ${readField.name} " +
+ s"in partition schema $partitionSchema")
+ }
+
+ def cannotSpecifyDatabaseForTempViewError(tableIdent: TableIdentifier): Throwable = {
+ new AnalysisException(
+ s"Temporary view '$tableIdent' should not have specified a database")
+ }
+
+ def cannotCreateTempViewUsingHiveDataSourceError(): Throwable = {
+ new AnalysisException("Hive data source can only be used with tables, " +
+ "you can't use it with CREATE TEMP VIEW USING")
+ }
+
+ def invalidTimestampProvidedForStrategyError(
+ strategy: String, timeString: String): Throwable = {
+ new AnalysisException(
+ s"The timestamp provided for the '$strategy' option is invalid. The expected format " +
+ s"is 'YYYY-MM-DDTHH:mm:ss', but the provided timestamp: $timeString")
+ }
+
+ def notSetHostOptionError(): Throwable = {
Review comment:
`hostOptionNotSetError`
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
##########
@@ -1647,4 +1643,300 @@ private[spark] object QueryCompilationErrors {
def invalidYearMonthIntervalType(startFieldName: String, endFieldName: String): Throwable = {
new AnalysisException(s"'interval $startFieldName to $endFieldName' is invalid.")
}
+
+ def queryFromRawFilesIncludeCorruptRecordColumnError(): Throwable = {
+ new AnalysisException(
+ """
+ |Since Spark 2.3, the queries from raw JSON/CSV files are disallowed when the
+ |referenced columns only include the internal corrupt record column
+ |(named _corrupt_record by default). For example:
+ |spark.read.schema(schema).csv(file).filter($"_corrupt_record".isNotNull).count()
+ |and spark.read.schema(schema).csv(file).select("_corrupt_record").show().
+ |Instead, you can cache or save the parsed results and then send the same query.
+ |For example, val df = spark.read.schema(schema).csv(file).cache() and then
+ |df.filter($"_corrupt_record".isNotNull).count().
+ """.stripMargin)
+ }
+
+ def userDefinedPartitionNotFoundInJDBCRelationError(
+ columnName: String, schema: String): Throwable = {
+ new AnalysisException(s"User-defined partition column $columnName not " +
+ s"found in the JDBC relation: $schema")
+ }
+
+ def invalidPartitionColumnTypeError(column: StructField): Throwable = {
+ new AnalysisException(
+ s"""
+ |Partition column type should be ${NumericType.simpleString},
+ |${DateType.catalogString}, or ${TimestampType.catalogString}, but
+ |${column.dataType.catalogString} found.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def tableOrViewAlreadyExistsError(name: String): Throwable = {
+ new AnalysisException(
+ s"Table or view '$name' already exists. SaveMode: ErrorIfExists.")
+ }
+
+ def columnNameContainsInvalidCharactersError(name: String): Throwable = {
+ new AnalysisException(
+ s"""
+ |Column name "$name" contains invalid character(s).
+ |Please use alias to rename it.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def textDataSourceWithMultiColumnsError(schema: StructType): Throwable = {
+ new AnalysisException(
+ s"Text data source supports only a single column, and you have ${schema.size} columns.")
+ }
+
+ def cannotResolveFieldReferenceError(ref: FieldReference, query: LogicalPlan): Throwable = {
+ new AnalysisException(s"Cannot resolve '$ref' using ${query.output}")
+ }
+
+ def v2ExpressionUnsupportedError(expr: V2Expression): Throwable = {
+ new AnalysisException(s"$expr is not currently supported")
+ }
+
+ def cannotFindPartitionColumnInPartitionSchemaError(
+ readField: StructField, partitionSchema: StructType): Throwable = {
+ new AnalysisException(s"Can't find required partition column ${readField.name} " +
+ s"in partition schema $partitionSchema")
+ }
+
+ def cannotSpecifyDatabaseForTempViewError(tableIdent: TableIdentifier): Throwable = {
+ new AnalysisException(
+ s"Temporary view '$tableIdent' should not have specified a database")
+ }
+
+ def cannotCreateTempViewUsingHiveDataSourceError(): Throwable = {
+ new AnalysisException("Hive data source can only be used with tables, " +
+ "you can't use it with CREATE TEMP VIEW USING")
+ }
+
+ def invalidTimestampProvidedForStrategyError(
+ strategy: String, timeString: String): Throwable = {
+ new AnalysisException(
+ s"The timestamp provided for the '$strategy' option is invalid. The expected format " +
+ s"is 'YYYY-MM-DDTHH:mm:ss', but the provided timestamp: $timeString")
+ }
+
+ def notSetHostOptionError(): Throwable = {
+ new AnalysisException("Set a host to read from with option(\"host\", ...).")
+ }
+
+ def notSetPortOptionError(): Throwable = {
+ new AnalysisException("Set a port to read from with option(\"port\", ...).")
+ }
+
+ def includeTimestampIsNotSuitableError(): Throwable = {
+ new AnalysisException("includeTimestamp must be set to either \"true\" or \"false\"")
+ }
+
+ def checkpointLocationNotSpecifiedError(): Throwable = {
+ new AnalysisException(
+ s"""
+ |checkpointLocation must be specified either
+ |through option("checkpointLocation", ...) or
+ |SparkSession.conf.set("${SQLConf.CHECKPOINT_LOCATION.key}", ...)
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def recoverQueryFromCheckpointUnsupportedError(checkpointPath: Path): Throwable = {
+ new AnalysisException("This query does not support recovering from checkpoint location. " +
+ s"Delete $checkpointPath to start over.")
+ }
+
+ def cannotFindColumnInGivenOutputError(
+ colName: String, relation: LogicalPlan): Throwable = {
+ new AnalysisException(s"Unable to find the column `$colName` " +
+ s"given [${relation.output.map(_.name).mkString(", ")}]")
+ }
+
+ def invalidBoundaryStartError(start: Long): Throwable = {
+ new AnalysisException(s"Boundary start is not a valid integer: $start")
+ }
+
+ def invalidBoundaryEndError(end: Long): Throwable = {
+ new AnalysisException(s"Boundary end is not a valid integer: $end")
+ }
+
+ def databaseDoesNotExistError(dbName: String): Throwable = {
+ new AnalysisException(s"Database '$dbName' does not exist.")
+ }
+
+ def tableDoesNotExistInDatabaseError(tableName: String, dbName: String): Throwable = {
+ new AnalysisException(s"Table '$tableName' does not exist in database '$dbName'.")
+ }
+
+ def tableOrViewNotFoundInDatabaseError(tableName: String, dbName: String): Throwable = {
+ new AnalysisException(s"Table or view '$tableName' not found in database '$dbName'")
+ }
+
+ def unexpectedTypeOfRelationError(relation: LogicalPlan, tableName: String): Throwable = {
+ new AnalysisException(
+ s"Unexpected type ${relation.getClass.getCanonicalName} of the relation $tableName")
+ }
+
+ def unsupportedTableChangeInJDBCCatalogError(change: TableChange): Throwable = {
+ new AnalysisException(s"Unsupported TableChange $change in JDBC catalog.")
+ }
+
+ def pathOptionNotSetCorrectlyWhenReadingError(): Throwable = {
+ new AnalysisException(
+ s"""
+ |There is a 'path' or 'paths' option set and load() is called
+ |with path parameters. Either remove the path option if it's the same as the path
+ |parameter, or add it to the load() parameter if you do want to read multiple paths.
+ |To ignore this check, set '${SQLConf.LEGACY_PATH_OPTION_BEHAVIOR.key}' to 'true'.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def pathOptionNotSetCorrectlyWhenWritingError(): Throwable = {
+ new AnalysisException(
+ s"""
+ |There is a 'path' option set and save() is called with a path
+ |parameter. Either remove the path option, or call save() without the parameter.
+ |To ignore this check, set '${SQLConf.LEGACY_PATH_OPTION_BEHAVIOR.key}' to 'true'.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def writeWithSaveModeUnsupportedBySourceError(source: String, createMode: String): Throwable = {
+ new AnalysisException(s"TableProvider implementation $source cannot be " +
+ s"written with $createMode mode, please use Append or Overwrite modes instead.")
+ }
+
+ def partitionByDoesNotAllowedWhenUsingInsertIntoError(): Throwable = {
+ new AnalysisException(
+ """
+ |insertInto() can't be used together with partitionBy().
+ |Partition columns have already been defined for the table.
+ |It is not necessary to use partitionBy().
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def cannotFindCatalogToHandleIdentifierError(quote: String): Throwable = {
+ new AnalysisException(s"Couldn't find a catalog to handle the identifier $quote.")
+ }
+
+ def sortByNotUsedWithBucketByError(): Throwable = {
+ new AnalysisException("sortBy must be used together with bucketBy")
+ }
+
+ def bucketByUnsupportedByOperationError(operation: String): Throwable = {
+ new AnalysisException(s"'$operation' does not support bucketBy right now")
+ }
+
+ def bucketByAndSortByUnsupportedByOperationError(operation: String): Throwable = {
+ new AnalysisException(s"'$operation' does not support bucketBy and sortBy right now")
+ }
+
+ def tableAlreadyExistsError(tableIdent: TableIdentifier): Throwable = {
+ new AnalysisException(s"Table $tableIdent already exists.")
+ }
+
+ def overwriteTableThatIsBeingReadFromError(tableName: String): Throwable = {
+ new AnalysisException(s"Cannot overwrite table $tableName that is also being read from")
+ }
+
+ def invalidPartitionTransformationError(expr: Expression): Throwable = {
+ new AnalysisException(s"Invalid partition transformation: ${expr.sql}")
+ }
+
+ def cannotResolveColumnNameAmongFieldsError(
+ colName: String, fieldsStr: String, extraMsg: String): AnalysisException = {
+ new AnalysisException(
+ s"""Cannot resolve column name "$colName" among (${fieldsStr})${extraMsg}""")
+ }
+
+ def cannotParseTimeDelayError(delayThreshold: String, e: IllegalArgumentException): Throwable = {
+ new AnalysisException(s"Unable to parse time delay '$delayThreshold'", cause = Some(e))
+ }
+
+ def invalidJoinTypeInJoinWithError(joinType: JoinType): Throwable = {
+ new AnalysisException(s"Invalid join type in joinWith: ${joinType.sql}")
+ }
+
+ def cannotPassTypedColumnInUntypedSelectError(typedCol: String): Throwable = {
+ new AnalysisException(s"Typed column $typedCol that needs input type and schema " +
+ "cannot be passed in untyped `select` API. Use the typed `Dataset.select` API instead.")
+ }
+
+ def invalidViewNameError(viewName: String): Throwable = {
+ new AnalysisException(s"Invalid view name: $viewName")
+ }
+
+ def invalidBucketsNumberError(numBuckets: String, e: String): Throwable = {
+ new AnalysisException(s"Invalid number of buckets: bucket($numBuckets, $e)")
+ }
+
+ def usingUntypedScalaUDFError(): Throwable = {
+ new AnalysisException("You're using untyped Scala UDF, which does not have the input type " +
+ "information. Spark may blindly pass null to the Scala closure with primitive-type " +
+ "argument, and the closure will see the default value of the Java type for the null " +
+ "argument, e.g. `udf((x: Int) => x, IntegerType)`, the result is 0 for null input. " +
+ "To get rid of this error, you could:\n" +
+ "1. use typed Scala UDF APIs(without return type parameter), e.g. `udf((x: Int) => x)`\n" +
+ "2. use Java UDF APIs, e.g. `udf(new UDF1[String, Integer] { " +
+ "override def call(s: String): Integer = s.length() }, IntegerType)`, " +
+ "if input types are all non primitive\n" +
+ s"3. set ${SQLConf.LEGACY_ALLOW_UNTYPED_SCALA_UDF.key} to true and " +
+ s"use this API with caution")
+ }
+
+ def aggregationFunctionBeAppliedOnNonNumericColumnError(colName: String): Throwable = {
+ new AnalysisException(s""""$colName" is not a numeric column. """ +
+ "Aggregation function can only be applied on a numeric column.")
+ }
+
+ def aggregationFunctionBeAppliedOnNonNumericColumnError(
Review comment:
aggregationFunctionAppliedOnNonNumericColumnError
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala
##########
@@ -1422,4 +1426,251 @@ object QueryExecutionErrors {
def invalidStreamingOutputModeError(outputMode: Option[OutputMode]): Throwable = {
new UnsupportedOperationException(s"Invalid output mode: $outputMode")
}
+
+ def multiFailuresInStageMaterializationError(error: Throwable): Throwable = {
+ new SparkException("Multiple failures in stage materialization.", error)
+ }
+
+ def unrecognizedCompressionSchemaTypeIDError(typeId: Int): Throwable = {
+ new UnsupportedOperationException(s"Unrecognized compression scheme type ID: $typeId")
+ }
+
+ def getParentLoggerNotImplementedError(className: String): Throwable = {
+ new SQLFeatureNotSupportedException(s"$className.getParentLogger is not yet implemented.")
+ }
+
+ def cannotCreateParquetConverterForTypeError(t: DecimalType, parquetType: String): Throwable = {
+ new RuntimeException(
+ s"""
+ |Unable to create Parquet converter for ${t.typeName}
+ |whose Parquet type is $parquetType without decimal metadata. Please read this
+ |column/field as Spark BINARY type.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def cannotCreateParquetConverterForDecimalTypeError(
+ t: DecimalType, parquetType: String): Throwable = {
+ new RuntimeException(
+ s"""
+ |Unable to create Parquet converter for decimal type ${t.json} whose Parquet type is
+ |$parquetType. Parquet DECIMAL type can only be backed by INT32, INT64,
+ |FIXED_LEN_BYTE_ARRAY, or BINARY.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def cannotCreateParquetConverterForDataTypeError(
+ t: DataType, parquetType: String): Throwable = {
+ new RuntimeException(s"Unable to create Parquet converter for data type ${t.json} " +
+ s"whose Parquet type is $parquetType")
+ }
+
+ def cannotAddMultiPartitionsOnNonatomicPartitionTableError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Nonatomic partition table $tableName can not add multiple partitions.")
+ }
+
+ def userSpecifiedSchemaUnsupportedByDataSourceError(provider: TableProvider): Throwable = {
+ new UnsupportedOperationException(
+ s"${provider.getClass.getSimpleName} source does not support user-specified schema.")
+ }
+
+ def cannotDropMultiPartitionsOnNonatomicPartitionTableError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Nonatomic partition table $tableName can not drop multiple partitions.")
+ }
+
+ def truncateMultiPartitionUnsupportedError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"The table $tableName does not support truncation of multiple partition.")
+ }
+
+ def overwriteTableByUnsupportedExpressionError(table: Table): Throwable = {
+ new SparkException(s"Table does not support overwrite by expression: $table")
+ }
+
+ def dynamicPartitionOverwriteUnsupportedByTableError(table: Table): Throwable = {
+ new SparkException(s"Table does not support dynamic partition overwrite: $table")
+ }
+
+ def failedMergingSchemaError(schema: StructType, e: SparkException): Throwable = {
+ new SparkException(s"Failed merging schema:\n${schema.treeString}", e)
+ }
+
+ def cannotBroadcastExceedMaxTableRowsError(
+ maxBroadcastTableRows: Long, numRows: Long): Throwable = {
+ new SparkException(
+ s"Cannot broadcast the table over $maxBroadcastTableRows rows: $numRows rows")
+ }
+
+ def cannotBroadcastExceedMaxTableBytesError(
+ maxBroadcastTableBytes: Long, dataSize: Long): Throwable = {
+ new SparkException("Cannot broadcast the table that is larger than" +
+ s" ${maxBroadcastTableBytes >> 30}GB: ${dataSize >> 30} GB")
+ }
+
+ def notEnoughMemoryToBuildAndBroadcastTableError(oe: OutOfMemoryError): Throwable = {
+ new OutOfMemoryError("Not enough memory to build and broadcast the table to all " +
+ "worker nodes. As a workaround, you can either disable broadcast by setting " +
+ s"${SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key} to -1 or increase the spark " +
+ s"driver memory by setting ${SparkLauncher.DRIVER_MEMORY} to a higher value.")
+ .initCause(oe.getCause)
+ }
+
+ def executeUnsupportedByExecError(execName: String): Throwable = {
+ new UnsupportedOperationException(s"$execName does not support the execute() code path.")
+ }
+
+ def cannotMergeClassWithOtherClassError(className: String, otherClass: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Cannot merge $className with $otherClass")
+ }
+
+ def continuousProcessingUnsupportedByDataSourceError(sourceName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Data source $sourceName does not support continuous processing.")
+ }
+
+ def failedReadDataError(failureReason: Throwable): Throwable = {
+ new SparkException("Data read failed", failureReason)
+ }
+
+ def failedGenerateEpochMarkerError(failureReason: Throwable): Throwable = {
+ new SparkException("Epoch marker generation failed", failureReason)
+ }
+
+ def failedWriteJobError(failureReason: Throwable): Throwable = {
+ new SparkException("Writing job aborted.", failureReason)
+ }
+
+ def foreachWriterAbortedDueToTaskFailureError(): Throwable = {
+ new SparkException("Foreach writer has been aborted due to a task failure")
+ }
+
+ def integerOverflowError(message: String): Throwable = {
+ new ArithmeticException(s"Integer overflow. $message")
+ }
+
+ def failedReadDeltaFileError(fileToRead: Path, clazz: String, keySize: Int): Throwable = {
Review comment:
failedToReadDeltaFileError
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala
##########
@@ -1422,4 +1426,251 @@ object QueryExecutionErrors {
def invalidStreamingOutputModeError(outputMode: Option[OutputMode]): Throwable = {
new UnsupportedOperationException(s"Invalid output mode: $outputMode")
}
+
+ def multiFailuresInStageMaterializationError(error: Throwable): Throwable = {
+ new SparkException("Multiple failures in stage materialization.", error)
+ }
+
+ def unrecognizedCompressionSchemaTypeIDError(typeId: Int): Throwable = {
+ new UnsupportedOperationException(s"Unrecognized compression scheme type ID: $typeId")
+ }
+
+ def getParentLoggerNotImplementedError(className: String): Throwable = {
+ new SQLFeatureNotSupportedException(s"$className.getParentLogger is not yet implemented.")
+ }
+
+ def cannotCreateParquetConverterForTypeError(t: DecimalType, parquetType: String): Throwable = {
+ new RuntimeException(
+ s"""
+ |Unable to create Parquet converter for ${t.typeName}
+ |whose Parquet type is $parquetType without decimal metadata. Please read this
+ |column/field as Spark BINARY type.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def cannotCreateParquetConverterForDecimalTypeError(
+ t: DecimalType, parquetType: String): Throwable = {
+ new RuntimeException(
+ s"""
+ |Unable to create Parquet converter for decimal type ${t.json} whose Parquet type is
+ |$parquetType. Parquet DECIMAL type can only be backed by INT32, INT64,
+ |FIXED_LEN_BYTE_ARRAY, or BINARY.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def cannotCreateParquetConverterForDataTypeError(
+ t: DataType, parquetType: String): Throwable = {
+ new RuntimeException(s"Unable to create Parquet converter for data type ${t.json} " +
+ s"whose Parquet type is $parquetType")
+ }
+
+ def cannotAddMultiPartitionsOnNonatomicPartitionTableError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Nonatomic partition table $tableName can not add multiple partitions.")
+ }
+
+ def userSpecifiedSchemaUnsupportedByDataSourceError(provider: TableProvider): Throwable = {
+ new UnsupportedOperationException(
+ s"${provider.getClass.getSimpleName} source does not support user-specified schema.")
+ }
+
+ def cannotDropMultiPartitionsOnNonatomicPartitionTableError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Nonatomic partition table $tableName can not drop multiple partitions.")
+ }
+
+ def truncateMultiPartitionUnsupportedError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"The table $tableName does not support truncation of multiple partition.")
+ }
+
+ def overwriteTableByUnsupportedExpressionError(table: Table): Throwable = {
+ new SparkException(s"Table does not support overwrite by expression: $table")
+ }
+
+ def dynamicPartitionOverwriteUnsupportedByTableError(table: Table): Throwable = {
+ new SparkException(s"Table does not support dynamic partition overwrite: $table")
+ }
+
+ def failedMergingSchemaError(schema: StructType, e: SparkException): Throwable = {
+ new SparkException(s"Failed merging schema:\n${schema.treeString}", e)
+ }
+
+ def cannotBroadcastExceedMaxTableRowsError(
Review comment:
cannotBroadcastTableOverMaxTableRowsError
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala
##########
@@ -1422,4 +1426,251 @@ object QueryExecutionErrors {
def invalidStreamingOutputModeError(outputMode: Option[OutputMode]): Throwable = {
new UnsupportedOperationException(s"Invalid output mode: $outputMode")
}
+
+ def multiFailuresInStageMaterializationError(error: Throwable): Throwable = {
+ new SparkException("Multiple failures in stage materialization.", error)
+ }
+
+ def unrecognizedCompressionSchemaTypeIDError(typeId: Int): Throwable = {
+ new UnsupportedOperationException(s"Unrecognized compression scheme type ID: $typeId")
+ }
+
+ def getParentLoggerNotImplementedError(className: String): Throwable = {
+ new SQLFeatureNotSupportedException(s"$className.getParentLogger is not yet implemented.")
+ }
+
+ def cannotCreateParquetConverterForTypeError(t: DecimalType, parquetType: String): Throwable = {
+ new RuntimeException(
+ s"""
+ |Unable to create Parquet converter for ${t.typeName}
+ |whose Parquet type is $parquetType without decimal metadata. Please read this
+ |column/field as Spark BINARY type.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def cannotCreateParquetConverterForDecimalTypeError(
+ t: DecimalType, parquetType: String): Throwable = {
+ new RuntimeException(
+ s"""
+ |Unable to create Parquet converter for decimal type ${t.json} whose Parquet type is
+ |$parquetType. Parquet DECIMAL type can only be backed by INT32, INT64,
+ |FIXED_LEN_BYTE_ARRAY, or BINARY.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def cannotCreateParquetConverterForDataTypeError(
+ t: DataType, parquetType: String): Throwable = {
+ new RuntimeException(s"Unable to create Parquet converter for data type ${t.json} " +
+ s"whose Parquet type is $parquetType")
+ }
+
+ def cannotAddMultiPartitionsOnNonatomicPartitionTableError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Nonatomic partition table $tableName can not add multiple partitions.")
+ }
+
+ def userSpecifiedSchemaUnsupportedByDataSourceError(provider: TableProvider): Throwable = {
+ new UnsupportedOperationException(
+ s"${provider.getClass.getSimpleName} source does not support user-specified schema.")
+ }
+
+ def cannotDropMultiPartitionsOnNonatomicPartitionTableError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Nonatomic partition table $tableName can not drop multiple partitions.")
+ }
+
+ def truncateMultiPartitionUnsupportedError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"The table $tableName does not support truncation of multiple partition.")
+ }
+
+ def overwriteTableByUnsupportedExpressionError(table: Table): Throwable = {
+ new SparkException(s"Table does not support overwrite by expression: $table")
+ }
+
+ def dynamicPartitionOverwriteUnsupportedByTableError(table: Table): Throwable = {
+ new SparkException(s"Table does not support dynamic partition overwrite: $table")
+ }
+
+ def failedMergingSchemaError(schema: StructType, e: SparkException): Throwable = {
+ new SparkException(s"Failed merging schema:\n${schema.treeString}", e)
+ }
+
+ def cannotBroadcastExceedMaxTableRowsError(
+ maxBroadcastTableRows: Long, numRows: Long): Throwable = {
+ new SparkException(
+ s"Cannot broadcast the table over $maxBroadcastTableRows rows: $numRows rows")
+ }
+
+ def cannotBroadcastExceedMaxTableBytesError(
Review comment:
cannotBroadcastTableOverMaxTableBytesError
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
##########
@@ -1647,4 +1643,300 @@ private[spark] object QueryCompilationErrors {
def invalidYearMonthIntervalType(startFieldName: String, endFieldName: String): Throwable = {
new AnalysisException(s"'interval $startFieldName to $endFieldName' is invalid.")
}
+
+ def queryFromRawFilesIncludeCorruptRecordColumnError(): Throwable = {
+ new AnalysisException(
+ """
+ |Since Spark 2.3, the queries from raw JSON/CSV files are disallowed when the
+ |referenced columns only include the internal corrupt record column
+ |(named _corrupt_record by default). For example:
+ |spark.read.schema(schema).csv(file).filter($"_corrupt_record".isNotNull).count()
+ |and spark.read.schema(schema).csv(file).select("_corrupt_record").show().
+ |Instead, you can cache or save the parsed results and then send the same query.
+ |For example, val df = spark.read.schema(schema).csv(file).cache() and then
+ |df.filter($"_corrupt_record".isNotNull).count().
+ """.stripMargin)
+ }
+
+ def userDefinedPartitionNotFoundInJDBCRelationError(
+ columnName: String, schema: String): Throwable = {
+ new AnalysisException(s"User-defined partition column $columnName not " +
+ s"found in the JDBC relation: $schema")
+ }
+
+ def invalidPartitionColumnTypeError(column: StructField): Throwable = {
+ new AnalysisException(
+ s"""
+ |Partition column type should be ${NumericType.simpleString},
+ |${DateType.catalogString}, or ${TimestampType.catalogString}, but
+ |${column.dataType.catalogString} found.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def tableOrViewAlreadyExistsError(name: String): Throwable = {
+ new AnalysisException(
+ s"Table or view '$name' already exists. SaveMode: ErrorIfExists.")
+ }
+
+ def columnNameContainsInvalidCharactersError(name: String): Throwable = {
+ new AnalysisException(
+ s"""
+ |Column name "$name" contains invalid character(s).
+ |Please use alias to rename it.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def textDataSourceWithMultiColumnsError(schema: StructType): Throwable = {
+ new AnalysisException(
+ s"Text data source supports only a single column, and you have ${schema.size} columns.")
+ }
+
+ def cannotResolveFieldReferenceError(ref: FieldReference, query: LogicalPlan): Throwable = {
+ new AnalysisException(s"Cannot resolve '$ref' using ${query.output}")
+ }
+
+ def v2ExpressionUnsupportedError(expr: V2Expression): Throwable = {
+ new AnalysisException(s"$expr is not currently supported")
+ }
+
+ def cannotFindPartitionColumnInPartitionSchemaError(
+ readField: StructField, partitionSchema: StructType): Throwable = {
+ new AnalysisException(s"Can't find required partition column ${readField.name} " +
+ s"in partition schema $partitionSchema")
+ }
+
+ def cannotSpecifyDatabaseForTempViewError(tableIdent: TableIdentifier): Throwable = {
+ new AnalysisException(
+ s"Temporary view '$tableIdent' should not have specified a database")
+ }
+
+ def cannotCreateTempViewUsingHiveDataSourceError(): Throwable = {
+ new AnalysisException("Hive data source can only be used with tables, " +
+ "you can't use it with CREATE TEMP VIEW USING")
+ }
+
+ def invalidTimestampProvidedForStrategyError(
+ strategy: String, timeString: String): Throwable = {
+ new AnalysisException(
+ s"The timestamp provided for the '$strategy' option is invalid. The expected format " +
+ s"is 'YYYY-MM-DDTHH:mm:ss', but the provided timestamp: $timeString")
+ }
+
+ def notSetHostOptionError(): Throwable = {
+ new AnalysisException("Set a host to read from with option(\"host\", ...).")
+ }
+
+ def notSetPortOptionError(): Throwable = {
+ new AnalysisException("Set a port to read from with option(\"port\", ...).")
+ }
+
+ def includeTimestampIsNotSuitableError(): Throwable = {
+ new AnalysisException("includeTimestamp must be set to either \"true\" or \"false\"")
+ }
+
+ def checkpointLocationNotSpecifiedError(): Throwable = {
+ new AnalysisException(
+ s"""
+ |checkpointLocation must be specified either
+ |through option("checkpointLocation", ...) or
+ |SparkSession.conf.set("${SQLConf.CHECKPOINT_LOCATION.key}", ...)
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def recoverQueryFromCheckpointUnsupportedError(checkpointPath: Path): Throwable = {
+ new AnalysisException("This query does not support recovering from checkpoint location. " +
+ s"Delete $checkpointPath to start over.")
+ }
+
+ def cannotFindColumnInGivenOutputError(
+ colName: String, relation: LogicalPlan): Throwable = {
+ new AnalysisException(s"Unable to find the column `$colName` " +
+ s"given [${relation.output.map(_.name).mkString(", ")}]")
+ }
+
+ def invalidBoundaryStartError(start: Long): Throwable = {
+ new AnalysisException(s"Boundary start is not a valid integer: $start")
+ }
+
+ def invalidBoundaryEndError(end: Long): Throwable = {
+ new AnalysisException(s"Boundary end is not a valid integer: $end")
+ }
+
+ def databaseDoesNotExistError(dbName: String): Throwable = {
+ new AnalysisException(s"Database '$dbName' does not exist.")
+ }
+
+ def tableDoesNotExistInDatabaseError(tableName: String, dbName: String): Throwable = {
+ new AnalysisException(s"Table '$tableName' does not exist in database '$dbName'.")
+ }
+
+ def tableOrViewNotFoundInDatabaseError(tableName: String, dbName: String): Throwable = {
+ new AnalysisException(s"Table or view '$tableName' not found in database '$dbName'")
+ }
+
+ def unexpectedTypeOfRelationError(relation: LogicalPlan, tableName: String): Throwable = {
+ new AnalysisException(
+ s"Unexpected type ${relation.getClass.getCanonicalName} of the relation $tableName")
+ }
+
+ def unsupportedTableChangeInJDBCCatalogError(change: TableChange): Throwable = {
+ new AnalysisException(s"Unsupported TableChange $change in JDBC catalog.")
+ }
+
+ def pathOptionNotSetCorrectlyWhenReadingError(): Throwable = {
+ new AnalysisException(
+ s"""
+ |There is a 'path' or 'paths' option set and load() is called
+ |with path parameters. Either remove the path option if it's the same as the path
+ |parameter, or add it to the load() parameter if you do want to read multiple paths.
+ |To ignore this check, set '${SQLConf.LEGACY_PATH_OPTION_BEHAVIOR.key}' to 'true'.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def pathOptionNotSetCorrectlyWhenWritingError(): Throwable = {
+ new AnalysisException(
+ s"""
+ |There is a 'path' option set and save() is called with a path
+ |parameter. Either remove the path option, or call save() without the parameter.
+ |To ignore this check, set '${SQLConf.LEGACY_PATH_OPTION_BEHAVIOR.key}' to 'true'.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def writeWithSaveModeUnsupportedBySourceError(source: String, createMode: String): Throwable = {
+ new AnalysisException(s"TableProvider implementation $source cannot be " +
+ s"written with $createMode mode, please use Append or Overwrite modes instead.")
+ }
+
+ def partitionByDoesNotAllowedWhenUsingInsertIntoError(): Throwable = {
+ new AnalysisException(
+ """
+ |insertInto() can't be used together with partitionBy().
+ |Partition columns have already been defined for the table.
+ |It is not necessary to use partitionBy().
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def cannotFindCatalogToHandleIdentifierError(quote: String): Throwable = {
+ new AnalysisException(s"Couldn't find a catalog to handle the identifier $quote.")
+ }
+
+ def sortByNotUsedWithBucketByError(): Throwable = {
+ new AnalysisException("sortBy must be used together with bucketBy")
+ }
+
+ def bucketByUnsupportedByOperationError(operation: String): Throwable = {
+ new AnalysisException(s"'$operation' does not support bucketBy right now")
+ }
+
+ def bucketByAndSortByUnsupportedByOperationError(operation: String): Throwable = {
+ new AnalysisException(s"'$operation' does not support bucketBy and sortBy right now")
+ }
+
+ def tableAlreadyExistsError(tableIdent: TableIdentifier): Throwable = {
+ new AnalysisException(s"Table $tableIdent already exists.")
+ }
+
+ def overwriteTableThatIsBeingReadFromError(tableName: String): Throwable = {
Review comment:
cannotOverwriteTableThatIsBeingReadFromError
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
##########
@@ -1647,4 +1643,300 @@ private[spark] object QueryCompilationErrors {
def invalidYearMonthIntervalType(startFieldName: String, endFieldName: String): Throwable = {
new AnalysisException(s"'interval $startFieldName to $endFieldName' is invalid.")
}
+
+ def queryFromRawFilesIncludeCorruptRecordColumnError(): Throwable = {
+ new AnalysisException(
+ """
+ |Since Spark 2.3, the queries from raw JSON/CSV files are disallowed when the
+ |referenced columns only include the internal corrupt record column
+ |(named _corrupt_record by default). For example:
+ |spark.read.schema(schema).csv(file).filter($\"_corrupt_record\".isNotNull).count()
+ |and spark.read.schema(schema).csv(file).select(\"_corrupt_record\").show().
+ |Instead, you can cache or save the parsed results and then send the same query.
+ |For example, val df = spark.read.schema(schema).csv(file).cache() and then
+ |df.filter($\"_corrupt_record\".isNotNull).count().
+ """.stripMargin('#'))
+ }
+
+ def userDefinedPartitionNotFoundInJDBCRelationError(
+ columnName: String, schema: String): Throwable = {
+ new AnalysisException(s"User-defined partition column $columnName not " +
+ s"found in the JDBC relation: $schema")
+ }
+
+ def invalidPartitionColumnTypeError(column: StructField): Throwable = {
+ new AnalysisException(
+ s"""
+ |Partition column type should be ${NumericType.simpleString},
+ |${DateType.catalogString}, or ${TimestampType.catalogString}, but
+ |${column.dataType.catalogString} found.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def tableOrViewAlreadyExistsError(name: String): Throwable = {
+ new AnalysisException(
+ s"Table or view '$name' already exists. SaveMode: ErrorIfExists.")
+ }
+
+ def columnNameContainsInvalidCharactersError(name: String): Throwable = {
+ new AnalysisException(
+ s"""
+ |Column name "$name" contains invalid character(s).
+ |Please use alias to rename it.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def textDataSourceWithMultiColumnsError(schema: StructType): Throwable = {
+ new AnalysisException(
+ s"Text data source supports only a single column, and you have ${schema.size} columns.")
+ }
+
+ def cannotResolveFieldReferenceError(ref: FieldReference, query: LogicalPlan): Throwable = {
+ new AnalysisException(s"Cannot resolve '$ref' using ${query.output}")
+ }
+
+ def v2ExpressionUnsupportedError(expr: V2Expression): Throwable = {
Review comment:
I am curious why renaming Expression to V2Expression is needed here?
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
##########
@@ -1647,4 +1643,300 @@ private[spark] object QueryCompilationErrors {
def invalidYearMonthIntervalType(startFieldName: String, endFieldName: String): Throwable = {
new AnalysisException(s"'interval $startFieldName to $endFieldName' is invalid.")
}
+
+ def queryFromRawFilesIncludeCorruptRecordColumnError(): Throwable = {
+ new AnalysisException(
+ """
+ |Since Spark 2.3, the queries from raw JSON/CSV files are disallowed when the
+ |referenced columns only include the internal corrupt record column
+ |(named _corrupt_record by default). For example:
+ |spark.read.schema(schema).csv(file).filter($"_corrupt_record".isNotNull).count()
+ |and spark.read.schema(schema).csv(file).select("_corrupt_record").show().
+ |Instead, you can cache or save the parsed results and then send the same query.
+ |For example, val df = spark.read.schema(schema).csv(file).cache() and then
+ |df.filter($"_corrupt_record".isNotNull).count().
+ """.stripMargin)
+ }
+
+ def userDefinedPartitionNotFoundInJDBCRelationError(
+ columnName: String, schema: String): Throwable = {
+ new AnalysisException(s"User-defined partition column $columnName not " +
+ s"found in the JDBC relation: $schema")
+ }
+
+ def invalidPartitionColumnTypeError(column: StructField): Throwable = {
+ new AnalysisException(
+ s"""
+ |Partition column type should be ${NumericType.simpleString},
+ |${DateType.catalogString}, or ${TimestampType.catalogString}, but
+ |${column.dataType.catalogString} found.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def tableOrViewAlreadyExistsError(name: String): Throwable = {
+ new AnalysisException(
+ s"Table or view '$name' already exists. SaveMode: ErrorIfExists.")
+ }
+
+ def columnNameContainsInvalidCharactersError(name: String): Throwable = {
+ new AnalysisException(
+ s"""
+ |Column name "$name" contains invalid character(s).
+ |Please use alias to rename it.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def textDataSourceWithMultiColumnsError(schema: StructType): Throwable = {
+ new AnalysisException(
+ s"Text data source supports only a single column, and you have ${schema.size} columns.")
+ }
+
+ def cannotResolveFieldReferenceError(ref: FieldReference, query: LogicalPlan): Throwable = {
+ new AnalysisException(s"Cannot resolve '$ref' using ${query.output}")
+ }
+
+ def v2ExpressionUnsupportedError(expr: V2Expression): Throwable = {
+ new AnalysisException(s"$expr is not currently supported")
+ }
+
+ def cannotFindPartitionColumnInPartitionSchemaError(
+ readField: StructField, partitionSchema: StructType): Throwable = {
+ new AnalysisException(s"Can't find required partition column ${readField.name} " +
+ s"in partition schema $partitionSchema")
+ }
+
+ def cannotSpecifyDatabaseForTempViewError(tableIdent: TableIdentifier): Throwable = {
+ new AnalysisException(
+ s"Temporary view '$tableIdent' should not have specified a database")
+ }
+
+ def cannotCreateTempViewUsingHiveDataSourceError(): Throwable = {
+ new AnalysisException("Hive data source can only be used with tables, " +
+ "you can't use it with CREATE TEMP VIEW USING")
+ }
+
+ def invalidTimestampProvidedForStrategyError(
+ strategy: String, timeString: String): Throwable = {
+ new AnalysisException(
+ s"The timestamp provided for the '$strategy' option is invalid. The expected format " +
+ s"is 'YYYY-MM-DDTHH:mm:ss', but the provided timestamp: $timeString")
+ }
+
+ def notSetHostOptionError(): Throwable = {
+ new AnalysisException("Set a host to read from with option(\"host\", ...).")
+ }
+
+ def notSetPortOptionError(): Throwable = {
+ new AnalysisException("Set a port to read from with option(\"port\", ...).")
+ }
+
+ def includeTimestampIsNotSuitableError(): Throwable = {
+ new AnalysisException("includeTimestamp must be set to either \"true\" or \"false\"")
+ }
+
+ def checkpointLocationNotSpecifiedError(): Throwable = {
+ new AnalysisException(
+ s"""
+ |checkpointLocation must be specified either
+ |through option("checkpointLocation", ...) or
+ |SparkSession.conf.set("${SQLConf.CHECKPOINT_LOCATION.key}", ...)
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def recoverQueryFromCheckpointUnsupportedError(checkpointPath: Path): Throwable = {
+ new AnalysisException("This query does not support recovering from checkpoint location. " +
+ s"Delete $checkpointPath to start over.")
+ }
+
+ def cannotFindColumnInGivenOutputError(
+ colName: String, relation: LogicalPlan): Throwable = {
+ new AnalysisException(s"Unable to find the column `$colName` " +
+ s"given [${relation.output.map(_.name).mkString(", ")}]")
+ }
+
+ def invalidBoundaryStartError(start: Long): Throwable = {
+ new AnalysisException(s"Boundary start is not a valid integer: $start")
+ }
+
+ def invalidBoundaryEndError(end: Long): Throwable = {
+ new AnalysisException(s"Boundary end is not a valid integer: $end")
+ }
+
+ def databaseDoesNotExistError(dbName: String): Throwable = {
+ new AnalysisException(s"Database '$dbName' does not exist.")
+ }
+
+ def tableDoesNotExistInDatabaseError(tableName: String, dbName: String): Throwable = {
+ new AnalysisException(s"Table '$tableName' does not exist in database '$dbName'.")
+ }
+
+ def tableOrViewNotFoundInDatabaseError(tableName: String, dbName: String): Throwable = {
+ new AnalysisException(s"Table or view '$tableName' not found in database '$dbName'")
+ }
+
+ def unexpectedTypeOfRelationError(relation: LogicalPlan, tableName: String): Throwable = {
+ new AnalysisException(
+ s"Unexpected type ${relation.getClass.getCanonicalName} of the relation $tableName")
+ }
+
+ def unsupportedTableChangeInJDBCCatalogError(change: TableChange): Throwable = {
+ new AnalysisException(s"Unsupported TableChange $change in JDBC catalog.")
+ }
+
+ def pathOptionNotSetCorrectlyWhenReadingError(): Throwable = {
+ new AnalysisException(
+ s"""
+ |There is a 'path' or 'paths' option set and load() is called
+ |with path parameters. Either remove the path option if it's the same as the path
+ |parameter, or add it to the load() parameter if you do want to read multiple paths.
+ |To ignore this check, set '${SQLConf.LEGACY_PATH_OPTION_BEHAVIOR.key}' to 'true'.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def pathOptionNotSetCorrectlyWhenWritingError(): Throwable = {
+ new AnalysisException(
+ s"""
+ |There is a 'path' option set and save() is called with a path
+ |parameter. Either remove the path option, or call save() without the parameter.
+ |To ignore this check, set '${SQLConf.LEGACY_PATH_OPTION_BEHAVIOR.key}' to 'true'.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def writeWithSaveModeUnsupportedBySourceError(source: String, createMode: String): Throwable = {
+ new AnalysisException(s"TableProvider implementation $source cannot be " +
+ s"written with $createMode mode, please use Append or Overwrite modes instead.")
+ }
+
+ def partitionByDoesNotAllowedWhenUsingInsertIntoError(): Throwable = {
+ new AnalysisException(
+ """
+ |insertInto() can't be used together with partitionBy().
+ |Partition columns have already been defined for the table.
+ |It is not necessary to use partitionBy().
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def cannotFindCatalogToHandleIdentifierError(quote: String): Throwable = {
+ new AnalysisException(s"Couldn't find a catalog to handle the identifier $quote.")
+ }
+
+ def sortByNotUsedWithBucketByError(): Throwable = {
+ new AnalysisException("sortBy must be used together with bucketBy")
+ }
+
+ def bucketByUnsupportedByOperationError(operation: String): Throwable = {
+ new AnalysisException(s"'$operation' does not support bucketBy right now")
+ }
+
+ def bucketByAndSortByUnsupportedByOperationError(operation: String): Throwable = {
+ new AnalysisException(s"'$operation' does not support bucketBy and sortBy right now")
+ }
+
+ def tableAlreadyExistsError(tableIdent: TableIdentifier): Throwable = {
+ new AnalysisException(s"Table $tableIdent already exists.")
+ }
+
+ def overwriteTableThatIsBeingReadFromError(tableName: String): Throwable = {
+ new AnalysisException(s"Cannot overwrite table $tableName that is also being read from")
+ }
+
+ def invalidPartitionTransformationError(expr: Expression): Throwable = {
+ new AnalysisException(s"Invalid partition transformation: ${expr.sql}")
+ }
+
+ def cannotResolveColumnNameAmongFieldsError(
+ colName: String, fieldsStr: String, extraMsg: String): AnalysisException = {
+ new AnalysisException(
+ s"""Cannot resolve column name "$colName" among (${fieldsStr})${extraMsg}""")
+ }
+
+ def cannotParseTimeDelayError(delayThreshold: String, e: IllegalArgumentException): Throwable = {
+ new AnalysisException(s"Unable to parse time delay '$delayThreshold'", cause = Some(e))
+ }
+
+ def invalidJoinTypeInJoinWithError(joinType: JoinType): Throwable = {
+ new AnalysisException(s"Invalid join type in joinWith: ${joinType.sql}")
+ }
+
+ def cannotPassTypedColumnInUntypedSelectError(typedCol: String): Throwable = {
+ new AnalysisException(s"Typed column $typedCol that needs input type and schema " +
+ "cannot be passed in untyped `select` API. Use the typed `Dataset.select` API instead.")
+ }
+
+ def invalidViewNameError(viewName: String): Throwable = {
+ new AnalysisException(s"Invalid view name: $viewName")
+ }
+
+ def invalidBucketsNumberError(numBuckets: String, e: String): Throwable = {
+ new AnalysisException(s"Invalid number of buckets: bucket($numBuckets, $e)")
+ }
+
+ def usingUntypedScalaUDFError(): Throwable = {
+ new AnalysisException("You're using untyped Scala UDF, which does not have the input type " +
+ "information. Spark may blindly pass null to the Scala closure with primitive-type " +
+ "argument, and the closure will see the default value of the Java type for the null " +
+ "argument, e.g. `udf((x: Int) => x, IntegerType)`, the result is 0 for null input. " +
+ "To get rid of this error, you could:\n" +
+ "1. use typed Scala UDF APIs(without return type parameter), e.g. `udf((x: Int) => x)`\n" +
+ "2. use Java UDF APIs, e.g. `udf(new UDF1[String, Integer] { " +
+ "override def call(s: String): Integer = s.length() }, IntegerType)`, " +
+ "if input types are all non primitive\n" +
+ s"3. set ${SQLConf.LEGACY_ALLOW_UNTYPED_SCALA_UDF.key} to true and " +
+ s"use this API with caution")
+ }
+
+ def aggregationFunctionBeAppliedOnNonNumericColumnError(colName: String): Throwable = {
Review comment:
aggregationFunctionAppliedOnNonNumericColumnError
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
##########
@@ -1647,4 +1643,300 @@ private[spark] object QueryCompilationErrors {
def invalidYearMonthIntervalType(startFieldName: String, endFieldName: String): Throwable = {
new AnalysisException(s"'interval $startFieldName to $endFieldName' is invalid.")
}
+
+ def queryFromRawFilesIncludeCorruptRecordColumnError(): Throwable = {
+ new AnalysisException(
+ """
+ |Since Spark 2.3, the queries from raw JSON/CSV files are disallowed when the
+ |referenced columns only include the internal corrupt record column
+ |(named _corrupt_record by default). For example:
+ |spark.read.schema(schema).csv(file).filter($\"_corrupt_record\".isNotNull).count()
+ |and spark.read.schema(schema).csv(file).select(\"_corrupt_record\").show().
+ |Instead, you can cache or save the parsed results and then send the same query.
+ |For example, val df = spark.read.schema(schema).csv(file).cache() and then
+ |df.filter($\"_corrupt_record\".isNotNull).count().
+ """.stripMargin('#'))
+ }
+
+ def userDefinedPartitionNotFoundInJDBCRelationError(
+ columnName: String, schema: String): Throwable = {
+ new AnalysisException(s"User-defined partition column $columnName not " +
+ s"found in the JDBC relation: $schema")
+ }
+
+ def invalidPartitionColumnTypeError(column: StructField): Throwable = {
+ new AnalysisException(
+ s"""
+ |Partition column type should be ${NumericType.simpleString},
+ |${DateType.catalogString}, or ${TimestampType.catalogString}, but
+ |${column.dataType.catalogString} found.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def tableOrViewAlreadyExistsError(name: String): Throwable = {
+ new AnalysisException(
+ s"Table or view '$name' already exists. SaveMode: ErrorIfExists.")
+ }
+
+ def columnNameContainsInvalidCharactersError(name: String): Throwable = {
+ new AnalysisException(
+ s"""
+ |Column name "$name" contains invalid character(s).
+ |Please use alias to rename it.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def textDataSourceWithMultiColumnsError(schema: StructType): Throwable = {
+ new AnalysisException(
+ s"Text data source supports only a single column, and you have ${schema.size} columns.")
+ }
+
+ def cannotResolveFieldReferenceError(ref: FieldReference, query: LogicalPlan): Throwable = {
+ new AnalysisException(s"Cannot resolve '$ref' using ${query.output}")
+ }
+
+ def v2ExpressionUnsupportedError(expr: V2Expression): Throwable = {
+ new AnalysisException(s"$expr is not currently supported")
+ }
+
+ def cannotFindPartitionColumnInPartitionSchemaError(
+ readField: StructField, partitionSchema: StructType): Throwable = {
+ new AnalysisException(s"Can't find required partition column ${readField.name} " +
+ s"in partition schema $partitionSchema")
+ }
+
+ def cannotSpecifyDatabaseForTempViewError(tableIdent: TableIdentifier): Throwable = {
+ new AnalysisException(
+ s"Temporary view '$tableIdent' should not have specified a database")
+ }
+
+ def cannotCreateTempViewUsingHiveDataSourceError(): Throwable = {
+ new AnalysisException("Hive data source can only be used with tables, " +
+ "you can't use it with CREATE TEMP VIEW USING")
+ }
+
+ def invalidTimestampProvidedForStrategyError(
+ strategy: String, timeString: String): Throwable = {
+ new AnalysisException(
+ s"The timestamp provided for the '$strategy' option is invalid. The expected format " +
+ s"is 'YYYY-MM-DDTHH:mm:ss', but the provided timestamp: $timeString")
+ }
+
+ def notSetHostOptionError(): Throwable = {
+ new AnalysisException("Set a host to read from with option(\"host\", ...).")
+ }
+
+ def notSetPortOptionError(): Throwable = {
Review comment:
`portOptionNotSetError`
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
##########
@@ -1647,4 +1643,300 @@ private[spark] object QueryCompilationErrors {
def invalidYearMonthIntervalType(startFieldName: String, endFieldName: String): Throwable = {
new AnalysisException(s"'interval $startFieldName to $endFieldName' is invalid.")
}
+
+ def queryFromRawFilesIncludeCorruptRecordColumnError(): Throwable = {
+ new AnalysisException(
+ """
+ |Since Spark 2.3, the queries from raw JSON/CSV files are disallowed when the
+ |referenced columns only include the internal corrupt record column
+ |(named _corrupt_record by default). For example:
+ |spark.read.schema(schema).csv(file).filter($\"_corrupt_record\".isNotNull).count()
+ |and spark.read.schema(schema).csv(file).select(\"_corrupt_record\").show().
+ |Instead, you can cache or save the parsed results and then send the same query.
+ |For example, val df = spark.read.schema(schema).csv(file).cache() and then
+ |df.filter($\"_corrupt_record\".isNotNull).count().
+ """.stripMargin('#'))
+ }
+
+ def userDefinedPartitionNotFoundInJDBCRelationError(
+ columnName: String, schema: String): Throwable = {
+ new AnalysisException(s"User-defined partition column $columnName not " +
+ s"found in the JDBC relation: $schema")
+ }
+
+ def invalidPartitionColumnTypeError(column: StructField): Throwable = {
+ new AnalysisException(
+ s"""
+ |Partition column type should be ${NumericType.simpleString},
+ |${DateType.catalogString}, or ${TimestampType.catalogString}, but
+ |${column.dataType.catalogString} found.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def tableOrViewAlreadyExistsError(name: String): Throwable = {
+ new AnalysisException(
+ s"Table or view '$name' already exists. SaveMode: ErrorIfExists.")
+ }
+
+ def columnNameContainsInvalidCharactersError(name: String): Throwable = {
+ new AnalysisException(
+ s"""
+ |Column name "$name" contains invalid character(s).
+ |Please use alias to rename it.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def textDataSourceWithMultiColumnsError(schema: StructType): Throwable = {
+ new AnalysisException(
+ s"Text data source supports only a single column, and you have ${schema.size} columns.")
+ }
+
+ def cannotResolveFieldReferenceError(ref: FieldReference, query: LogicalPlan): Throwable = {
+ new AnalysisException(s"Cannot resolve '$ref' using ${query.output}")
+ }
+
+ def v2ExpressionUnsupportedError(expr: V2Expression): Throwable = {
+ new AnalysisException(s"$expr is not currently supported")
+ }
+
+ def cannotFindPartitionColumnInPartitionSchemaError(
+ readField: StructField, partitionSchema: StructType): Throwable = {
+ new AnalysisException(s"Can't find required partition column ${readField.name} " +
+ s"in partition schema $partitionSchema")
+ }
+
+ def cannotSpecifyDatabaseForTempViewError(tableIdent: TableIdentifier): Throwable = {
+ new AnalysisException(
+ s"Temporary view '$tableIdent' should not have specified a database")
+ }
+
+ def cannotCreateTempViewUsingHiveDataSourceError(): Throwable = {
+ new AnalysisException("Hive data source can only be used with tables, " +
+ "you can't use it with CREATE TEMP VIEW USING")
+ }
+
+ def invalidTimestampProvidedForStrategyError(
+ strategy: String, timeString: String): Throwable = {
+ new AnalysisException(
+ s"The timestamp provided for the '$strategy' option is invalid. The expected format " +
+ s"is 'YYYY-MM-DDTHH:mm:ss', but the provided timestamp: $timeString")
+ }
+
+ def notSetHostOptionError(): Throwable = {
+ new AnalysisException("Set a host to read from with option(\"host\", ...).")
+ }
+
+ def notSetPortOptionError(): Throwable = {
+ new AnalysisException("Set a port to read from with option(\"port\", ...).")
+ }
+
+ def includeTimestampIsNotSuitableError(): Throwable = {
+ new AnalysisException("includeTimestamp must be set to either \"true\" or \"false\"")
+ }
+
+ def checkpointLocationNotSpecifiedError(): Throwable = {
+ new AnalysisException(
+ s"""
+ |checkpointLocation must be specified either
+ |through option("checkpointLocation", ...) or
+ |SparkSession.conf.set("${SQLConf.CHECKPOINT_LOCATION.key}", ...)
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def recoverQueryFromCheckpointUnsupportedError(checkpointPath: Path): Throwable = {
+ new AnalysisException("This query does not support recovering from checkpoint location. " +
+ s"Delete $checkpointPath to start over.")
+ }
+
+ def cannotFindColumnInGivenOutputError(
Review comment:
cannotFindColumnInRelationOutputError
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala
##########
@@ -1422,4 +1426,251 @@ object QueryExecutionErrors {
def invalidStreamingOutputModeError(outputMode: Option[OutputMode]): Throwable = {
new UnsupportedOperationException(s"Invalid output mode: $outputMode")
}
+
+ def multiFailuresInStageMaterializationError(error: Throwable): Throwable = {
+ new SparkException("Multiple failures in stage materialization.", error)
+ }
+
+ def unrecognizedCompressionSchemaTypeIDError(typeId: Int): Throwable = {
+ new UnsupportedOperationException(s"Unrecognized compression scheme type ID: $typeId")
+ }
+
+ def getParentLoggerNotImplementedError(className: String): Throwable = {
+ new SQLFeatureNotSupportedException(s"$className.getParentLogger is not yet implemented.")
+ }
+
+ def cannotCreateParquetConverterForTypeError(t: DecimalType, parquetType: String): Throwable = {
+ new RuntimeException(
+ s"""
+ |Unable to create Parquet converter for ${t.typeName}
+ |whose Parquet type is $parquetType without decimal metadata. Please read this
+ |column/field as Spark BINARY type.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def cannotCreateParquetConverterForDecimalTypeError(
+ t: DecimalType, parquetType: String): Throwable = {
+ new RuntimeException(
+ s"""
+ |Unable to create Parquet converter for decimal type ${t.json} whose Parquet type is
+ |$parquetType. Parquet DECIMAL type can only be backed by INT32, INT64,
+ |FIXED_LEN_BYTE_ARRAY, or BINARY.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def cannotCreateParquetConverterForDataTypeError(
+ t: DataType, parquetType: String): Throwable = {
+ new RuntimeException(s"Unable to create Parquet converter for data type ${t.json} " +
+ s"whose Parquet type is $parquetType")
+ }
+
+ def cannotAddMultiPartitionsOnNonatomicPartitionTableError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Nonatomic partition table $tableName can not add multiple partitions.")
+ }
+
+ def userSpecifiedSchemaUnsupportedByDataSourceError(provider: TableProvider): Throwable = {
+ new UnsupportedOperationException(
+ s"${provider.getClass.getSimpleName} source does not support user-specified schema.")
+ }
+
+ def cannotDropMultiPartitionsOnNonatomicPartitionTableError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Nonatomic partition table $tableName can not drop multiple partitions.")
+ }
+
+ def truncateMultiPartitionUnsupportedError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"The table $tableName does not support truncation of multiple partition.")
+ }
+
+ def overwriteTableByUnsupportedExpressionError(table: Table): Throwable = {
+ new SparkException(s"Table does not support overwrite by expression: $table")
+ }
+
+ def dynamicPartitionOverwriteUnsupportedByTableError(table: Table): Throwable = {
+ new SparkException(s"Table does not support dynamic partition overwrite: $table")
+ }
+
+ def failedMergingSchemaError(schema: StructType, e: SparkException): Throwable = {
+ new SparkException(s"Failed merging schema:\n${schema.treeString}", e)
+ }
+
+ def cannotBroadcastExceedMaxTableRowsError(
+ maxBroadcastTableRows: Long, numRows: Long): Throwable = {
+ new SparkException(
+ s"Cannot broadcast the table over $maxBroadcastTableRows rows: $numRows rows")
+ }
+
+ def cannotBroadcastExceedMaxTableBytesError(
+ maxBroadcastTableBytes: Long, dataSize: Long): Throwable = {
+ new SparkException("Cannot broadcast the table that is larger than" +
+ s" ${maxBroadcastTableBytes >> 30}GB: ${dataSize >> 30} GB")
+ }
+
+ def notEnoughMemoryToBuildAndBroadcastTableError(oe: OutOfMemoryError): Throwable = {
+ new OutOfMemoryError("Not enough memory to build and broadcast the table to all " +
+ "worker nodes. As a workaround, you can either disable broadcast by setting " +
+ s"${SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key} to -1 or increase the spark " +
+ s"driver memory by setting ${SparkLauncher.DRIVER_MEMORY} to a higher value.")
+ .initCause(oe.getCause)
+ }
+
+ def executeUnsupportedByExecError(execName: String): Throwable = {
+ new UnsupportedOperationException(s"$execName does not support the execute() code path.")
+ }
+
+ def cannotMergeClassWithOtherClassError(className: String, otherClass: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Cannot merge $className with $otherClass")
+ }
+
+ def continuousProcessingUnsupportedByDataSourceError(sourceName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Data source $sourceName does not support continuous processing.")
+ }
+
+ def failedReadDataError(failureReason: Throwable): Throwable = {
+ new SparkException("Data read failed", failureReason)
+ }
+
+ def failedGenerateEpochMarkerError(failureReason: Throwable): Throwable = {
+ new SparkException("Epoch marker generation failed", failureReason)
+ }
+
+ def failedWriteJobError(failureReason: Throwable): Throwable = {
Review comment:
writingJobAbortedError
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala
##########
@@ -1422,4 +1426,251 @@ object QueryExecutionErrors {
def invalidStreamingOutputModeError(outputMode: Option[OutputMode]): Throwable = {
new UnsupportedOperationException(s"Invalid output mode: $outputMode")
}
+
+ def multiFailuresInStageMaterializationError(error: Throwable): Throwable = {
+ new SparkException("Multiple failures in stage materialization.", error)
+ }
+
+ def unrecognizedCompressionSchemaTypeIDError(typeId: Int): Throwable = {
+ new UnsupportedOperationException(s"Unrecognized compression scheme type ID: $typeId")
+ }
+
+ def getParentLoggerNotImplementedError(className: String): Throwable = {
+ new SQLFeatureNotSupportedException(s"$className.getParentLogger is not yet implemented.")
+ }
+
+ def cannotCreateParquetConverterForTypeError(t: DecimalType, parquetType: String): Throwable = {
+ new RuntimeException(
+ s"""
+ |Unable to create Parquet converter for ${t.typeName}
+ |whose Parquet type is $parquetType without decimal metadata. Please read this
+ |column/field as Spark BINARY type.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def cannotCreateParquetConverterForDecimalTypeError(
+ t: DecimalType, parquetType: String): Throwable = {
+ new RuntimeException(
+ s"""
+ |Unable to create Parquet converter for decimal type ${t.json} whose Parquet type is
+ |$parquetType. Parquet DECIMAL type can only be backed by INT32, INT64,
+ |FIXED_LEN_BYTE_ARRAY, or BINARY.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def cannotCreateParquetConverterForDataTypeError(
+ t: DataType, parquetType: String): Throwable = {
+ new RuntimeException(s"Unable to create Parquet converter for data type ${t.json} " +
+ s"whose Parquet type is $parquetType")
+ }
+
+ def cannotAddMultiPartitionsOnNonatomicPartitionTableError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Nonatomic partition table $tableName can not add multiple partitions.")
+ }
+
+ def userSpecifiedSchemaUnsupportedByDataSourceError(provider: TableProvider): Throwable = {
+ new UnsupportedOperationException(
+ s"${provider.getClass.getSimpleName} source does not support user-specified schema.")
+ }
+
+ def cannotDropMultiPartitionsOnNonatomicPartitionTableError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Nonatomic partition table $tableName can not drop multiple partitions.")
+ }
+
+ def truncateMultiPartitionUnsupportedError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"The table $tableName does not support truncation of multiple partition.")
+ }
+
+ def overwriteTableByUnsupportedExpressionError(table: Table): Throwable = {
+ new SparkException(s"Table does not support overwrite by expression: $table")
+ }
+
+ def dynamicPartitionOverwriteUnsupportedByTableError(table: Table): Throwable = {
+ new SparkException(s"Table does not support dynamic partition overwrite: $table")
+ }
+
+ def failedMergingSchemaError(schema: StructType, e: SparkException): Throwable = {
+ new SparkException(s"Failed merging schema:\n${schema.treeString}", e)
+ }
+
+ def cannotBroadcastExceedMaxTableRowsError(
+ maxBroadcastTableRows: Long, numRows: Long): Throwable = {
+ new SparkException(
+ s"Cannot broadcast the table over $maxBroadcastTableRows rows: $numRows rows")
+ }
+
+ def cannotBroadcastExceedMaxTableBytesError(
+ maxBroadcastTableBytes: Long, dataSize: Long): Throwable = {
+ new SparkException("Cannot broadcast the table that is larger than" +
+ s" ${maxBroadcastTableBytes >> 30}GB: ${dataSize >> 30} GB")
+ }
+
+ def notEnoughMemoryToBuildAndBroadcastTableError(oe: OutOfMemoryError): Throwable = {
+ new OutOfMemoryError("Not enough memory to build and broadcast the table to all " +
+ "worker nodes. As a workaround, you can either disable broadcast by setting " +
+ s"${SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key} to -1 or increase the spark " +
+ s"driver memory by setting ${SparkLauncher.DRIVER_MEMORY} to a higher value.")
+ .initCause(oe.getCause)
+ }
+
+ def executeUnsupportedByExecError(execName: String): Throwable = {
Review comment:
executeCodePathUnsupportedError
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala
##########
@@ -1422,4 +1426,251 @@ object QueryExecutionErrors {
def invalidStreamingOutputModeError(outputMode: Option[OutputMode]): Throwable = {
new UnsupportedOperationException(s"Invalid output mode: $outputMode")
}
+
+ def multiFailuresInStageMaterializationError(error: Throwable): Throwable = {
+ new SparkException("Multiple failures in stage materialization.", error)
+ }
+
+ def unrecognizedCompressionSchemaTypeIDError(typeId: Int): Throwable = {
+ new UnsupportedOperationException(s"Unrecognized compression scheme type ID: $typeId")
+ }
+
+ def getParentLoggerNotImplementedError(className: String): Throwable = {
+ new SQLFeatureNotSupportedException(s"$className.getParentLogger is not yet implemented.")
+ }
+
+ def cannotCreateParquetConverterForTypeError(t: DecimalType, parquetType: String): Throwable = {
+ new RuntimeException(
+ s"""
+ |Unable to create Parquet converter for ${t.typeName}
+ |whose Parquet type is $parquetType without decimal metadata. Please read this
+ |column/field as Spark BINARY type.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def cannotCreateParquetConverterForDecimalTypeError(
+ t: DecimalType, parquetType: String): Throwable = {
+ new RuntimeException(
+ s"""
+ |Unable to create Parquet converter for decimal type ${t.json} whose Parquet type is
+ |$parquetType. Parquet DECIMAL type can only be backed by INT32, INT64,
+ |FIXED_LEN_BYTE_ARRAY, or BINARY.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def cannotCreateParquetConverterForDataTypeError(
+ t: DataType, parquetType: String): Throwable = {
+ new RuntimeException(s"Unable to create Parquet converter for data type ${t.json} " +
+ s"whose Parquet type is $parquetType")
+ }
+
+ def cannotAddMultiPartitionsOnNonatomicPartitionTableError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Nonatomic partition table $tableName can not add multiple partitions.")
+ }
+
+ def userSpecifiedSchemaUnsupportedByDataSourceError(provider: TableProvider): Throwable = {
+ new UnsupportedOperationException(
+ s"${provider.getClass.getSimpleName} source does not support user-specified schema.")
+ }
+
+ def cannotDropMultiPartitionsOnNonatomicPartitionTableError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Nonatomic partition table $tableName can not drop multiple partitions.")
+ }
+
+ def truncateMultiPartitionUnsupportedError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"The table $tableName does not support truncation of multiple partition.")
+ }
+
+ def overwriteTableByUnsupportedExpressionError(table: Table): Throwable = {
+ new SparkException(s"Table does not support overwrite by expression: $table")
+ }
+
+ def dynamicPartitionOverwriteUnsupportedByTableError(table: Table): Throwable = {
+ new SparkException(s"Table does not support dynamic partition overwrite: $table")
+ }
+
+ def failedMergingSchemaError(schema: StructType, e: SparkException): Throwable = {
+ new SparkException(s"Failed merging schema:\n${schema.treeString}", e)
+ }
+
+ def cannotBroadcastExceedMaxTableRowsError(
+ maxBroadcastTableRows: Long, numRows: Long): Throwable = {
+ new SparkException(
+ s"Cannot broadcast the table over $maxBroadcastTableRows rows: $numRows rows")
+ }
+
+ def cannotBroadcastExceedMaxTableBytesError(
+ maxBroadcastTableBytes: Long, dataSize: Long): Throwable = {
+ new SparkException("Cannot broadcast the table that is larger than" +
+ s" ${maxBroadcastTableBytes >> 30}GB: ${dataSize >> 30} GB")
+ }
+
+ def notEnoughMemoryToBuildAndBroadcastTableError(oe: OutOfMemoryError): Throwable = {
+ new OutOfMemoryError("Not enough memory to build and broadcast the table to all " +
+ "worker nodes. As a workaround, you can either disable broadcast by setting " +
+ s"${SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key} to -1 or increase the spark " +
+ s"driver memory by setting ${SparkLauncher.DRIVER_MEMORY} to a higher value.")
+ .initCause(oe.getCause)
+ }
+
+ def executeUnsupportedByExecError(execName: String): Throwable = {
+ new UnsupportedOperationException(s"$execName does not support the execute() code path.")
+ }
+
+ def cannotMergeClassWithOtherClassError(className: String, otherClass: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Cannot merge $className with $otherClass")
+ }
+
+ def continuousProcessingUnsupportedByDataSourceError(sourceName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Data source $sourceName does not support continuous processing.")
+ }
+
+ def failedReadDataError(failureReason: Throwable): Throwable = {
+ new SparkException("Data read failed", failureReason)
+ }
+
+ def failedGenerateEpochMarkerError(failureReason: Throwable): Throwable = {
Review comment:
failedToGenerateEpochMarkerError
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala
##########
@@ -1422,4 +1426,251 @@ object QueryExecutionErrors {
def invalidStreamingOutputModeError(outputMode: Option[OutputMode]): Throwable = {
new UnsupportedOperationException(s"Invalid output mode: $outputMode")
}
+
+ def multiFailuresInStageMaterializationError(error: Throwable): Throwable = {
+ new SparkException("Multiple failures in stage materialization.", error)
+ }
+
+ def unrecognizedCompressionSchemaTypeIDError(typeId: Int): Throwable = {
+ new UnsupportedOperationException(s"Unrecognized compression scheme type ID: $typeId")
+ }
+
+ def getParentLoggerNotImplementedError(className: String): Throwable = {
+ new SQLFeatureNotSupportedException(s"$className.getParentLogger is not yet implemented.")
+ }
+
+ def cannotCreateParquetConverterForTypeError(t: DecimalType, parquetType: String): Throwable = {
+ new RuntimeException(
+ s"""
+ |Unable to create Parquet converter for ${t.typeName}
+ |whose Parquet type is $parquetType without decimal metadata. Please read this
+ |column/field as Spark BINARY type.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def cannotCreateParquetConverterForDecimalTypeError(
+ t: DecimalType, parquetType: String): Throwable = {
+ new RuntimeException(
+ s"""
+ |Unable to create Parquet converter for decimal type ${t.json} whose Parquet type is
+ |$parquetType. Parquet DECIMAL type can only be backed by INT32, INT64,
+ |FIXED_LEN_BYTE_ARRAY, or BINARY.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def cannotCreateParquetConverterForDataTypeError(
+ t: DataType, parquetType: String): Throwable = {
+ new RuntimeException(s"Unable to create Parquet converter for data type ${t.json} " +
+ s"whose Parquet type is $parquetType")
+ }
+
+ def cannotAddMultiPartitionsOnNonatomicPartitionTableError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Nonatomic partition table $tableName can not add multiple partitions.")
+ }
+
+ def userSpecifiedSchemaUnsupportedByDataSourceError(provider: TableProvider): Throwable = {
+ new UnsupportedOperationException(
+ s"${provider.getClass.getSimpleName} source does not support user-specified schema.")
+ }
+
+ def cannotDropMultiPartitionsOnNonatomicPartitionTableError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Nonatomic partition table $tableName can not drop multiple partitions.")
+ }
+
+ def truncateMultiPartitionUnsupportedError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"The table $tableName does not support truncation of multiple partition.")
+ }
+
+ def overwriteTableByUnsupportedExpressionError(table: Table): Throwable = {
+ new SparkException(s"Table does not support overwrite by expression: $table")
+ }
+
+ def dynamicPartitionOverwriteUnsupportedByTableError(table: Table): Throwable = {
+ new SparkException(s"Table does not support dynamic partition overwrite: $table")
+ }
+
+ def failedMergingSchemaError(schema: StructType, e: SparkException): Throwable = {
+ new SparkException(s"Failed merging schema:\n${schema.treeString}", e)
+ }
+
+ def cannotBroadcastExceedMaxTableRowsError(
+ maxBroadcastTableRows: Long, numRows: Long): Throwable = {
+ new SparkException(
+ s"Cannot broadcast the table over $maxBroadcastTableRows rows: $numRows rows")
+ }
+
+ def cannotBroadcastExceedMaxTableBytesError(
+ maxBroadcastTableBytes: Long, dataSize: Long): Throwable = {
+ new SparkException("Cannot broadcast the table that is larger than" +
+ s" ${maxBroadcastTableBytes >> 30}GB: ${dataSize >> 30} GB")
+ }
+
+ def notEnoughMemoryToBuildAndBroadcastTableError(oe: OutOfMemoryError): Throwable = {
+ new OutOfMemoryError("Not enough memory to build and broadcast the table to all " +
+ "worker nodes. As a workaround, you can either disable broadcast by setting " +
+ s"${SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key} to -1 or increase the spark " +
+ s"driver memory by setting ${SparkLauncher.DRIVER_MEMORY} to a higher value.")
+ .initCause(oe.getCause)
+ }
+
+ def executeUnsupportedByExecError(execName: String): Throwable = {
+ new UnsupportedOperationException(s"$execName does not support the execute() code path.")
+ }
+
+ def cannotMergeClassWithOtherClassError(className: String, otherClass: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Cannot merge $className with $otherClass")
+ }
+
+ def continuousProcessingUnsupportedByDataSourceError(sourceName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Data source $sourceName does not support continuous processing.")
+ }
+
+ def failedReadDataError(failureReason: Throwable): Throwable = {
Review comment:
failedToReadDataError
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala
##########
@@ -1422,4 +1426,251 @@ object QueryExecutionErrors {
def invalidStreamingOutputModeError(outputMode: Option[OutputMode]): Throwable = {
new UnsupportedOperationException(s"Invalid output mode: $outputMode")
}
+
+ def multiFailuresInStageMaterializationError(error: Throwable): Throwable = {
+ new SparkException("Multiple failures in stage materialization.", error)
+ }
+
+ def unrecognizedCompressionSchemaTypeIDError(typeId: Int): Throwable = {
+ new UnsupportedOperationException(s"Unrecognized compression scheme type ID: $typeId")
+ }
+
+ def getParentLoggerNotImplementedError(className: String): Throwable = {
+ new SQLFeatureNotSupportedException(s"$className.getParentLogger is not yet implemented.")
+ }
+
+ def cannotCreateParquetConverterForTypeError(t: DecimalType, parquetType: String): Throwable = {
+ new RuntimeException(
+ s"""
+ |Unable to create Parquet converter for ${t.typeName}
+ |whose Parquet type is $parquetType without decimal metadata. Please read this
+ |column/field as Spark BINARY type.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def cannotCreateParquetConverterForDecimalTypeError(
+ t: DecimalType, parquetType: String): Throwable = {
+ new RuntimeException(
+ s"""
+ |Unable to create Parquet converter for decimal type ${t.json} whose Parquet type is
+ |$parquetType. Parquet DECIMAL type can only be backed by INT32, INT64,
+ |FIXED_LEN_BYTE_ARRAY, or BINARY.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def cannotCreateParquetConverterForDataTypeError(
+ t: DataType, parquetType: String): Throwable = {
+ new RuntimeException(s"Unable to create Parquet converter for data type ${t.json} " +
+ s"whose Parquet type is $parquetType")
+ }
+
+ def cannotAddMultiPartitionsOnNonatomicPartitionTableError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Nonatomic partition table $tableName can not add multiple partitions.")
+ }
+
+ def userSpecifiedSchemaUnsupportedByDataSourceError(provider: TableProvider): Throwable = {
+ new UnsupportedOperationException(
+ s"${provider.getClass.getSimpleName} source does not support user-specified schema.")
+ }
+
+ def cannotDropMultiPartitionsOnNonatomicPartitionTableError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Nonatomic partition table $tableName can not drop multiple partitions.")
+ }
+
+ def truncateMultiPartitionUnsupportedError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"The table $tableName does not support truncation of multiple partition.")
+ }
+
+ def overwriteTableByUnsupportedExpressionError(table: Table): Throwable = {
+ new SparkException(s"Table does not support overwrite by expression: $table")
+ }
+
+ def dynamicPartitionOverwriteUnsupportedByTableError(table: Table): Throwable = {
+ new SparkException(s"Table does not support dynamic partition overwrite: $table")
+ }
+
+ def failedMergingSchemaError(schema: StructType, e: SparkException): Throwable = {
+ new SparkException(s"Failed merging schema:\n${schema.treeString}", e)
+ }
+
+ def cannotBroadcastExceedMaxTableRowsError(
+ maxBroadcastTableRows: Long, numRows: Long): Throwable = {
+ new SparkException(
+ s"Cannot broadcast the table over $maxBroadcastTableRows rows: $numRows rows")
+ }
+
+ def cannotBroadcastExceedMaxTableBytesError(
+ maxBroadcastTableBytes: Long, dataSize: Long): Throwable = {
+ new SparkException("Cannot broadcast the table that is larger than" +
+ s" ${maxBroadcastTableBytes >> 30}GB: ${dataSize >> 30} GB")
+ }
+
+ def notEnoughMemoryToBuildAndBroadcastTableError(oe: OutOfMemoryError): Throwable = {
+ new OutOfMemoryError("Not enough memory to build and broadcast the table to all " +
+ "worker nodes. As a workaround, you can either disable broadcast by setting " +
+ s"${SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key} to -1 or increase the spark " +
+ s"driver memory by setting ${SparkLauncher.DRIVER_MEMORY} to a higher value.")
+ .initCause(oe.getCause)
+ }
+
+ def executeUnsupportedByExecError(execName: String): Throwable = {
+ new UnsupportedOperationException(s"$execName does not support the execute() code path.")
+ }
+
+ def cannotMergeClassWithOtherClassError(className: String, otherClass: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Cannot merge $className with $otherClass")
+ }
+
+ def continuousProcessingUnsupportedByDataSourceError(sourceName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Data source $sourceName does not support continuous processing.")
+ }
+
+ def failedReadDataError(failureReason: Throwable): Throwable = {
+ new SparkException("Data read failed", failureReason)
+ }
+
+ def failedGenerateEpochMarkerError(failureReason: Throwable): Throwable = {
+ new SparkException("Epoch marker generation failed", failureReason)
+ }
+
+ def failedWriteJobError(failureReason: Throwable): Throwable = {
+ new SparkException("Writing job aborted.", failureReason)
+ }
+
+ def foreachWriterAbortedDueToTaskFailureError(): Throwable = {
+ new SparkException("Foreach writer has been aborted due to a task failure")
+ }
+
+ def integerOverflowError(message: String): Throwable = {
+ new ArithmeticException(s"Integer overflow. $message")
+ }
+
+ def failedReadDeltaFileError(fileToRead: Path, clazz: String, keySize: Int): Throwable = {
+ new IOException(
+ s"Error reading delta file $fileToRead of $clazz: key size cannot be $keySize")
+ }
+
+ def failedReadSnapshotFileError(fileToRead: Path, clazz: String, message: String): Throwable = {
+ new IOException(s"Error reading snapshot file $fileToRead of $clazz: $message")
+ }
+
+ def cannotPurgeAsBreakInternalStateError(): Throwable = {
+ new UnsupportedOperationException("Cannot purge as it might break internal state.")
+ }
+
+ def cleanUpSourceFilesUnsupportedError(): Throwable = {
+ new UnsupportedOperationException("Clean up source files is not supported when" +
+ " reading from the output directory of FileStreamSink.")
+ }
+
+ def latestOffsetNotCalledError(): Throwable = {
+ new UnsupportedOperationException(
+ "latestOffset(Offset, ReadLimit) should be called instead of this method")
+ }
+
+ def legacyCheckpointDirectoryExistsError(
+ checkpointPath: Path, legacyCheckpointDir: String): Throwable = {
+ new SparkException(
+ s"""
+ |Error: we detected a possible problem with the location of your checkpoint and you
+ |likely need to move it before restarting this query.
+ |
+ |Earlier version of Spark incorrectly escaped paths when writing out checkpoints for
+ |structured streaming. While this was corrected in Spark 3.0, it appears that your
+ |query was started using an earlier version that incorrectly handled the checkpoint
+ |path.
+ |
+ |Correct Checkpoint Directory: $checkpointPath
+ |Incorrect Checkpoint Directory: $legacyCheckpointDir
+ |
+ |Please move the data from the incorrect directory to the correct one, delete the
+ |incorrect directory, and then restart this query. If you believe you are receiving
+ |this message in error, you can disable it with the SQL conf
+ |${SQLConf.STREAMING_CHECKPOINT_ESCAPED_PATH_CHECK_ENABLED.key}.
+ """.stripMargin)
+ }
+
+ def subProcessExitedError(
Review comment:
subprocessExitedError
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala
##########
@@ -1422,4 +1426,251 @@ object QueryExecutionErrors {
def invalidStreamingOutputModeError(outputMode: Option[OutputMode]): Throwable = {
new UnsupportedOperationException(s"Invalid output mode: $outputMode")
}
+
+ def multiFailuresInStageMaterializationError(error: Throwable): Throwable = {
+ new SparkException("Multiple failures in stage materialization.", error)
+ }
+
+ def unrecognizedCompressionSchemaTypeIDError(typeId: Int): Throwable = {
+ new UnsupportedOperationException(s"Unrecognized compression scheme type ID: $typeId")
+ }
+
+ def getParentLoggerNotImplementedError(className: String): Throwable = {
+ new SQLFeatureNotSupportedException(s"$className.getParentLogger is not yet implemented.")
+ }
+
+ def cannotCreateParquetConverterForTypeError(t: DecimalType, parquetType: String): Throwable = {
+ new RuntimeException(
+ s"""
+ |Unable to create Parquet converter for ${t.typeName}
+ |whose Parquet type is $parquetType without decimal metadata. Please read this
+ |column/field as Spark BINARY type.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def cannotCreateParquetConverterForDecimalTypeError(
+ t: DecimalType, parquetType: String): Throwable = {
+ new RuntimeException(
+ s"""
+ |Unable to create Parquet converter for decimal type ${t.json} whose Parquet type is
+ |$parquetType. Parquet DECIMAL type can only be backed by INT32, INT64,
+ |FIXED_LEN_BYTE_ARRAY, or BINARY.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def cannotCreateParquetConverterForDataTypeError(
+ t: DataType, parquetType: String): Throwable = {
+ new RuntimeException(s"Unable to create Parquet converter for data type ${t.json} " +
+ s"whose Parquet type is $parquetType")
+ }
+
+ def cannotAddMultiPartitionsOnNonatomicPartitionTableError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Nonatomic partition table $tableName can not add multiple partitions.")
+ }
+
+ def userSpecifiedSchemaUnsupportedByDataSourceError(provider: TableProvider): Throwable = {
+ new UnsupportedOperationException(
+ s"${provider.getClass.getSimpleName} source does not support user-specified schema.")
+ }
+
+ def cannotDropMultiPartitionsOnNonatomicPartitionTableError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Nonatomic partition table $tableName can not drop multiple partitions.")
+ }
+
+ def truncateMultiPartitionUnsupportedError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"The table $tableName does not support truncation of multiple partition.")
+ }
+
+ def overwriteTableByUnsupportedExpressionError(table: Table): Throwable = {
+ new SparkException(s"Table does not support overwrite by expression: $table")
+ }
+
+ def dynamicPartitionOverwriteUnsupportedByTableError(table: Table): Throwable = {
+ new SparkException(s"Table does not support dynamic partition overwrite: $table")
+ }
+
+ def failedMergingSchemaError(schema: StructType, e: SparkException): Throwable = {
+ new SparkException(s"Failed merging schema:\n${schema.treeString}", e)
+ }
+
+ def cannotBroadcastExceedMaxTableRowsError(
+ maxBroadcastTableRows: Long, numRows: Long): Throwable = {
+ new SparkException(
+ s"Cannot broadcast the table over $maxBroadcastTableRows rows: $numRows rows")
+ }
+
+ def cannotBroadcastExceedMaxTableBytesError(
+ maxBroadcastTableBytes: Long, dataSize: Long): Throwable = {
+ new SparkException("Cannot broadcast the table that is larger than" +
+ s" ${maxBroadcastTableBytes >> 30}GB: ${dataSize >> 30} GB")
+ }
+
+ def notEnoughMemoryToBuildAndBroadcastTableError(oe: OutOfMemoryError): Throwable = {
+ new OutOfMemoryError("Not enough memory to build and broadcast the table to all " +
+ "worker nodes. As a workaround, you can either disable broadcast by setting " +
+ s"${SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key} to -1 or increase the spark " +
+ s"driver memory by setting ${SparkLauncher.DRIVER_MEMORY} to a higher value.")
+ .initCause(oe.getCause)
+ }
+
+ def executeUnsupportedByExecError(execName: String): Throwable = {
+ new UnsupportedOperationException(s"$execName does not support the execute() code path.")
+ }
+
+ def cannotMergeClassWithOtherClassError(className: String, otherClass: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Cannot merge $className with $otherClass")
+ }
+
+ def continuousProcessingUnsupportedByDataSourceError(sourceName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Data source $sourceName does not support continuous processing.")
+ }
+
+ def failedReadDataError(failureReason: Throwable): Throwable = {
+ new SparkException("Data read failed", failureReason)
+ }
+
+ def failedGenerateEpochMarkerError(failureReason: Throwable): Throwable = {
+ new SparkException("Epoch marker generation failed", failureReason)
+ }
+
+ def failedWriteJobError(failureReason: Throwable): Throwable = {
+ new SparkException("Writing job aborted.", failureReason)
+ }
+
+ def foreachWriterAbortedDueToTaskFailureError(): Throwable = {
+ new SparkException("Foreach writer has been aborted due to a task failure")
+ }
+
+ def integerOverflowError(message: String): Throwable = {
+ new ArithmeticException(s"Integer overflow. $message")
+ }
+
+ def failedReadDeltaFileError(fileToRead: Path, clazz: String, keySize: Int): Throwable = {
+ new IOException(
+ s"Error reading delta file $fileToRead of $clazz: key size cannot be $keySize")
+ }
+
+ def failedReadSnapshotFileError(fileToRead: Path, clazz: String, message: String): Throwable = {
+ new IOException(s"Error reading snapshot file $fileToRead of $clazz: $message")
+ }
+
+ def cannotPurgeAsBreakInternalStateError(): Throwable = {
+ new UnsupportedOperationException("Cannot purge as it might break internal state.")
+ }
+
+ def cleanUpSourceFilesUnsupportedError(): Throwable = {
+ new UnsupportedOperationException("Clean up source files is not supported when" +
+ " reading from the output directory of FileStreamSink.")
+ }
+
+ def latestOffsetNotCalledError(): Throwable = {
+ new UnsupportedOperationException(
+ "latestOffset(Offset, ReadLimit) should be called instead of this method")
+ }
+
+ def legacyCheckpointDirectoryExistsError(
+ checkpointPath: Path, legacyCheckpointDir: String): Throwable = {
+ new SparkException(
+ s"""
+ |Error: we detected a possible problem with the location of your checkpoint and you
+ |likely need to move it before restarting this query.
+ |
+ |Earlier version of Spark incorrectly escaped paths when writing out checkpoints for
+ |structured streaming. While this was corrected in Spark 3.0, it appears that your
+ |query was started using an earlier version that incorrectly handled the checkpoint
+ |path.
+ |
+ |Correct Checkpoint Directory: $checkpointPath
+ |Incorrect Checkpoint Directory: $legacyCheckpointDir
+ |
+ |Please move the data from the incorrect directory to the correct one, delete the
+ |incorrect directory, and then restart this query. If you believe you are receiving
+ |this message in error, you can disable it with the SQL conf
+ |${SQLConf.STREAMING_CHECKPOINT_ESCAPED_PATH_CHECK_ENABLED.key}.
+ """.stripMargin)
+ }
+
+ def subProcessExitedError(
+ exitCode: Int, stderrBuffer: CircularBuffer, cause: Throwable): Throwable = {
+ new SparkException(s"Subprocess exited with status $exitCode. " +
+ s"Error: ${stderrBuffer.toString}", cause)
+ }
+
+ def outputDataTypeUnsupportedByNodeWithoutSerdeError(
+ nodeName: String, dt: DataType): Throwable = {
+ new SparkException(s"$nodeName without serde does not support " +
+ s"${dt.getClass.getSimpleName} as output data type")
+ }
+
+ def invalidStartIndexError(numRows: Int, startIndex: Int): Throwable = {
+ new ArrayIndexOutOfBoundsException(
+ "Invalid `startIndex` provided for generating iterator over the array. " +
+ s"Total elements: $numRows, requested `startIndex`: $startIndex")
+ }
+
+ def concurrentModificationOnExternalAppendOnlyUnsafeRowArrayError(
+ className: String): Throwable = {
+ new ConcurrentModificationException(
+ s"The backing $className has been modified since the creation of this Iterator")
+ }
+
+ def doExecuteBroadcastNotImplementedByNodeError(nodeName: String): Throwable = {
Review comment:
doExecuteBroadcastNotImplementedError
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala
##########
@@ -1422,4 +1426,251 @@ object QueryExecutionErrors {
def invalidStreamingOutputModeError(outputMode: Option[OutputMode]): Throwable = {
new UnsupportedOperationException(s"Invalid output mode: $outputMode")
}
+
+ def multiFailuresInStageMaterializationError(error: Throwable): Throwable = {
+ new SparkException("Multiple failures in stage materialization.", error)
+ }
+
+ def unrecognizedCompressionSchemaTypeIDError(typeId: Int): Throwable = {
+ new UnsupportedOperationException(s"Unrecognized compression scheme type ID: $typeId")
+ }
+
+ def getParentLoggerNotImplementedError(className: String): Throwable = {
+ new SQLFeatureNotSupportedException(s"$className.getParentLogger is not yet implemented.")
+ }
+
+ def cannotCreateParquetConverterForTypeError(t: DecimalType, parquetType: String): Throwable = {
+ new RuntimeException(
+ s"""
+ |Unable to create Parquet converter for ${t.typeName}
+ |whose Parquet type is $parquetType without decimal metadata. Please read this
+ |column/field as Spark BINARY type.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def cannotCreateParquetConverterForDecimalTypeError(
+ t: DecimalType, parquetType: String): Throwable = {
+ new RuntimeException(
+ s"""
+ |Unable to create Parquet converter for decimal type ${t.json} whose Parquet type is
+ |$parquetType. Parquet DECIMAL type can only be backed by INT32, INT64,
+ |FIXED_LEN_BYTE_ARRAY, or BINARY.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def cannotCreateParquetConverterForDataTypeError(
+ t: DataType, parquetType: String): Throwable = {
+ new RuntimeException(s"Unable to create Parquet converter for data type ${t.json} " +
+ s"whose Parquet type is $parquetType")
+ }
+
+ def cannotAddMultiPartitionsOnNonatomicPartitionTableError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Nonatomic partition table $tableName can not add multiple partitions.")
+ }
+
+ def userSpecifiedSchemaUnsupportedByDataSourceError(provider: TableProvider): Throwable = {
+ new UnsupportedOperationException(
+ s"${provider.getClass.getSimpleName} source does not support user-specified schema.")
+ }
+
+ def cannotDropMultiPartitionsOnNonatomicPartitionTableError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Nonatomic partition table $tableName can not drop multiple partitions.")
+ }
+
+ def truncateMultiPartitionUnsupportedError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"The table $tableName does not support truncation of multiple partition.")
+ }
+
+ def overwriteTableByUnsupportedExpressionError(table: Table): Throwable = {
+ new SparkException(s"Table does not support overwrite by expression: $table")
+ }
+
+ def dynamicPartitionOverwriteUnsupportedByTableError(table: Table): Throwable = {
+ new SparkException(s"Table does not support dynamic partition overwrite: $table")
+ }
+
+ def failedMergingSchemaError(schema: StructType, e: SparkException): Throwable = {
+ new SparkException(s"Failed merging schema:\n${schema.treeString}", e)
+ }
+
+ def cannotBroadcastExceedMaxTableRowsError(
+ maxBroadcastTableRows: Long, numRows: Long): Throwable = {
+ new SparkException(
+ s"Cannot broadcast the table over $maxBroadcastTableRows rows: $numRows rows")
+ }
+
+ def cannotBroadcastExceedMaxTableBytesError(
+ maxBroadcastTableBytes: Long, dataSize: Long): Throwable = {
+ new SparkException("Cannot broadcast the table that is larger than" +
+ s" ${maxBroadcastTableBytes >> 30}GB: ${dataSize >> 30} GB")
+ }
+
+ def notEnoughMemoryToBuildAndBroadcastTableError(oe: OutOfMemoryError): Throwable = {
+ new OutOfMemoryError("Not enough memory to build and broadcast the table to all " +
+ "worker nodes. As a workaround, you can either disable broadcast by setting " +
+ s"${SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key} to -1 or increase the spark " +
+ s"driver memory by setting ${SparkLauncher.DRIVER_MEMORY} to a higher value.")
+ .initCause(oe.getCause)
+ }
+
+ def executeUnsupportedByExecError(execName: String): Throwable = {
+ new UnsupportedOperationException(s"$execName does not support the execute() code path.")
+ }
+
+ def cannotMergeClassWithOtherClassError(className: String, otherClass: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Cannot merge $className with $otherClass")
+ }
+
+ def continuousProcessingUnsupportedByDataSourceError(sourceName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Data source $sourceName does not support continuous processing.")
+ }
+
+ def failedReadDataError(failureReason: Throwable): Throwable = {
+ new SparkException("Data read failed", failureReason)
+ }
+
+ def failedGenerateEpochMarkerError(failureReason: Throwable): Throwable = {
+ new SparkException("Epoch marker generation failed", failureReason)
+ }
+
+ def failedWriteJobError(failureReason: Throwable): Throwable = {
+ new SparkException("Writing job aborted.", failureReason)
+ }
+
+ def foreachWriterAbortedDueToTaskFailureError(): Throwable = {
+ new SparkException("Foreach writer has been aborted due to a task failure")
+ }
+
+ def integerOverflowError(message: String): Throwable = {
+ new ArithmeticException(s"Integer overflow. $message")
+ }
+
+ def failedReadDeltaFileError(fileToRead: Path, clazz: String, keySize: Int): Throwable = {
+ new IOException(
+ s"Error reading delta file $fileToRead of $clazz: key size cannot be $keySize")
+ }
+
+ def failedReadSnapshotFileError(fileToRead: Path, clazz: String, message: String): Throwable = {
Review comment:
failedToReadSnapshotFileError
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala
##########
@@ -1422,4 +1426,251 @@ object QueryExecutionErrors {
def invalidStreamingOutputModeError(outputMode: Option[OutputMode]): Throwable = {
new UnsupportedOperationException(s"Invalid output mode: $outputMode")
}
+
+ def multiFailuresInStageMaterializationError(error: Throwable): Throwable = {
+ new SparkException("Multiple failures in stage materialization.", error)
+ }
+
+ def unrecognizedCompressionSchemaTypeIDError(typeId: Int): Throwable = {
+ new UnsupportedOperationException(s"Unrecognized compression scheme type ID: $typeId")
+ }
+
+ def getParentLoggerNotImplementedError(className: String): Throwable = {
+ new SQLFeatureNotSupportedException(s"$className.getParentLogger is not yet implemented.")
+ }
+
+ def cannotCreateParquetConverterForTypeError(t: DecimalType, parquetType: String): Throwable = {
+ new RuntimeException(
+ s"""
+ |Unable to create Parquet converter for ${t.typeName}
+ |whose Parquet type is $parquetType without decimal metadata. Please read this
+ |column/field as Spark BINARY type.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def cannotCreateParquetConverterForDecimalTypeError(
+ t: DecimalType, parquetType: String): Throwable = {
+ new RuntimeException(
+ s"""
+ |Unable to create Parquet converter for decimal type ${t.json} whose Parquet type is
+ |$parquetType. Parquet DECIMAL type can only be backed by INT32, INT64,
+ |FIXED_LEN_BYTE_ARRAY, or BINARY.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def cannotCreateParquetConverterForDataTypeError(
+ t: DataType, parquetType: String): Throwable = {
+ new RuntimeException(s"Unable to create Parquet converter for data type ${t.json} " +
+ s"whose Parquet type is $parquetType")
+ }
+
+ def cannotAddMultiPartitionsOnNonatomicPartitionTableError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Nonatomic partition table $tableName can not add multiple partitions.")
+ }
+
+ def userSpecifiedSchemaUnsupportedByDataSourceError(provider: TableProvider): Throwable = {
+ new UnsupportedOperationException(
+ s"${provider.getClass.getSimpleName} source does not support user-specified schema.")
+ }
+
+ def cannotDropMultiPartitionsOnNonatomicPartitionTableError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Nonatomic partition table $tableName can not drop multiple partitions.")
+ }
+
+ def truncateMultiPartitionUnsupportedError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"The table $tableName does not support truncation of multiple partition.")
+ }
+
+ def overwriteTableByUnsupportedExpressionError(table: Table): Throwable = {
+ new SparkException(s"Table does not support overwrite by expression: $table")
+ }
+
+ def dynamicPartitionOverwriteUnsupportedByTableError(table: Table): Throwable = {
+ new SparkException(s"Table does not support dynamic partition overwrite: $table")
+ }
+
+ def failedMergingSchemaError(schema: StructType, e: SparkException): Throwable = {
+ new SparkException(s"Failed merging schema:\n${schema.treeString}", e)
+ }
+
+ def cannotBroadcastExceedMaxTableRowsError(
+ maxBroadcastTableRows: Long, numRows: Long): Throwable = {
+ new SparkException(
+ s"Cannot broadcast the table over $maxBroadcastTableRows rows: $numRows rows")
+ }
+
+ def cannotBroadcastExceedMaxTableBytesError(
+ maxBroadcastTableBytes: Long, dataSize: Long): Throwable = {
+ new SparkException("Cannot broadcast the table that is larger than" +
+ s" ${maxBroadcastTableBytes >> 30}GB: ${dataSize >> 30} GB")
+ }
+
+ def notEnoughMemoryToBuildAndBroadcastTableError(oe: OutOfMemoryError): Throwable = {
+ new OutOfMemoryError("Not enough memory to build and broadcast the table to all " +
+ "worker nodes. As a workaround, you can either disable broadcast by setting " +
+ s"${SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key} to -1 or increase the spark " +
+ s"driver memory by setting ${SparkLauncher.DRIVER_MEMORY} to a higher value.")
+ .initCause(oe.getCause)
+ }
+
+ def executeUnsupportedByExecError(execName: String): Throwable = {
+ new UnsupportedOperationException(s"$execName does not support the execute() code path.")
+ }
+
+ def cannotMergeClassWithOtherClassError(className: String, otherClass: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Cannot merge $className with $otherClass")
+ }
+
+ def continuousProcessingUnsupportedByDataSourceError(sourceName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Data source $sourceName does not support continuous processing.")
+ }
+
+ def failedReadDataError(failureReason: Throwable): Throwable = {
+ new SparkException("Data read failed", failureReason)
+ }
+
+ def failedGenerateEpochMarkerError(failureReason: Throwable): Throwable = {
+ new SparkException("Epoch marker generation failed", failureReason)
+ }
+
+ def failedWriteJobError(failureReason: Throwable): Throwable = {
+ new SparkException("Writing job aborted.", failureReason)
+ }
+
+ def foreachWriterAbortedDueToTaskFailureError(): Throwable = {
+ new SparkException("Foreach writer has been aborted due to a task failure")
+ }
+
+ def integerOverflowError(message: String): Throwable = {
+ new ArithmeticException(s"Integer overflow. $message")
+ }
+
+ def failedReadDeltaFileError(fileToRead: Path, clazz: String, keySize: Int): Throwable = {
+ new IOException(
+ s"Error reading delta file $fileToRead of $clazz: key size cannot be $keySize")
+ }
+
+ def failedReadSnapshotFileError(fileToRead: Path, clazz: String, message: String): Throwable = {
+ new IOException(s"Error reading snapshot file $fileToRead of $clazz: $message")
+ }
+
+ def cannotPurgeAsBreakInternalStateError(): Throwable = {
+ new UnsupportedOperationException("Cannot purge as it might break internal state.")
+ }
+
+ def cleanUpSourceFilesUnsupportedError(): Throwable = {
+ new UnsupportedOperationException("Clean up source files is not supported when" +
+ " reading from the output directory of FileStreamSink.")
+ }
+
+ def latestOffsetNotCalledError(): Throwable = {
+ new UnsupportedOperationException(
+ "latestOffset(Offset, ReadLimit) should be called instead of this method")
+ }
+
+ def legacyCheckpointDirectoryExistsError(
+ checkpointPath: Path, legacyCheckpointDir: String): Throwable = {
+ new SparkException(
+ s"""
+ |Error: we detected a possible problem with the location of your checkpoint and you
+ |likely need to move it before restarting this query.
+ |
+ |Earlier version of Spark incorrectly escaped paths when writing out checkpoints for
+ |structured streaming. While this was corrected in Spark 3.0, it appears that your
+ |query was started using an earlier version that incorrectly handled the checkpoint
+ |path.
+ |
+ |Correct Checkpoint Directory: $checkpointPath
+ |Incorrect Checkpoint Directory: $legacyCheckpointDir
+ |
+ |Please move the data from the incorrect directory to the correct one, delete the
+ |incorrect directory, and then restart this query. If you believe you are receiving
+ |this message in error, you can disable it with the SQL conf
+ |${SQLConf.STREAMING_CHECKPOINT_ESCAPED_PATH_CHECK_ENABLED.key}.
+ """.stripMargin)
+ }
+
+ def subProcessExitedError(
+ exitCode: Int, stderrBuffer: CircularBuffer, cause: Throwable): Throwable = {
+ new SparkException(s"Subprocess exited with status $exitCode. " +
+ s"Error: ${stderrBuffer.toString}", cause)
+ }
+
+ def outputDataTypeUnsupportedByNodeWithoutSerdeError(
+ nodeName: String, dt: DataType): Throwable = {
+ new SparkException(s"$nodeName without serde does not support " +
+ s"${dt.getClass.getSimpleName} as output data type")
+ }
+
+ def invalidStartIndexError(numRows: Int, startIndex: Int): Throwable = {
+ new ArrayIndexOutOfBoundsException(
+ "Invalid `startIndex` provided for generating iterator over the array. " +
+ s"Total elements: $numRows, requested `startIndex`: $startIndex")
+ }
+
+ def concurrentModificationOnExternalAppendOnlyUnsafeRowArrayError(
+ className: String): Throwable = {
+ new ConcurrentModificationException(
+ s"The backing $className has been modified since the creation of this Iterator")
+ }
+
+ def doExecuteBroadcastNotImplementedByNodeError(nodeName: String): Throwable = {
+ new UnsupportedOperationException(s"$nodeName does not implement doExecuteBroadcast")
+ }
+
+ def databaseNameConflictWithSystemPreservedDatabaseError(globalTempDB: String): Throwable = {
+ new SparkException(
+ s"""
+ |$globalTempDB is a system preserved database, please rename your existing database
+ |to resolve the name conflict, or set a different value for
+ |${GLOBAL_TEMP_DATABASE.key}, and launch your Spark application again.
+ """.stripMargin.split("\n").mkString(" "))
+ }
+
+ def commentOnTableUnsupportedError(): Throwable = {
+ new SQLFeatureNotSupportedException("comment on table is not supported")
+ }
+
+ def unsupportedUpdateColumnNullabilityError(): Throwable = {
+ new SQLFeatureNotSupportedException("UpdateColumnNullability is not supported")
+ }
+
+ def renameColumnUnsupportedForOlderMySQLError(): Throwable = {
+ new SQLFeatureNotSupportedException(
+ "Rename column is only supported for MySQL version 8.0 and above.")
+ }
+
+ def hitAnErrorWhenExecutingQueryError(e: Throwable): QueryExecutionException = {
Review comment:
I feel this can be simplifed to `failedToExecuteQueryError`. Also for the return type: `QueryExecutionException` -> `Throwable`
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala
##########
@@ -1422,4 +1426,251 @@ object QueryExecutionErrors {
def invalidStreamingOutputModeError(outputMode: Option[OutputMode]): Throwable = {
new UnsupportedOperationException(s"Invalid output mode: $outputMode")
}
+
+ def multiFailuresInStageMaterializationError(error: Throwable): Throwable = {
+ new SparkException("Multiple failures in stage materialization.", error)
+ }
+
+ def unrecognizedCompressionSchemaTypeIDError(typeId: Int): Throwable = {
+ new UnsupportedOperationException(s"Unrecognized compression scheme type ID: $typeId")
+ }
+
+ def getParentLoggerNotImplementedError(className: String): Throwable = {
+ new SQLFeatureNotSupportedException(s"$className.getParentLogger is not yet implemented.")
+ }
+
+ def cannotCreateParquetConverterForTypeError(t: DecimalType, parquetType: String): Throwable = {
+ new RuntimeException(
+ s"""
+ |Unable to create Parquet converter for ${t.typeName}
+ |whose Parquet type is $parquetType without decimal metadata. Please read this
+ |column/field as Spark BINARY type.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def cannotCreateParquetConverterForDecimalTypeError(
+ t: DecimalType, parquetType: String): Throwable = {
+ new RuntimeException(
+ s"""
+ |Unable to create Parquet converter for decimal type ${t.json} whose Parquet type is
+ |$parquetType. Parquet DECIMAL type can only be backed by INT32, INT64,
+ |FIXED_LEN_BYTE_ARRAY, or BINARY.
+ """.stripMargin.replaceAll("\n", " "))
+ }
+
+ def cannotCreateParquetConverterForDataTypeError(
+ t: DataType, parquetType: String): Throwable = {
+ new RuntimeException(s"Unable to create Parquet converter for data type ${t.json} " +
+ s"whose Parquet type is $parquetType")
+ }
+
+ def cannotAddMultiPartitionsOnNonatomicPartitionTableError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Nonatomic partition table $tableName can not add multiple partitions.")
+ }
+
+ def userSpecifiedSchemaUnsupportedByDataSourceError(provider: TableProvider): Throwable = {
+ new UnsupportedOperationException(
+ s"${provider.getClass.getSimpleName} source does not support user-specified schema.")
+ }
+
+ def cannotDropMultiPartitionsOnNonatomicPartitionTableError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Nonatomic partition table $tableName can not drop multiple partitions.")
+ }
+
+ def truncateMultiPartitionUnsupportedError(tableName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"The table $tableName does not support truncation of multiple partition.")
+ }
+
+ def overwriteTableByUnsupportedExpressionError(table: Table): Throwable = {
+ new SparkException(s"Table does not support overwrite by expression: $table")
+ }
+
+ def dynamicPartitionOverwriteUnsupportedByTableError(table: Table): Throwable = {
+ new SparkException(s"Table does not support dynamic partition overwrite: $table")
+ }
+
+ def failedMergingSchemaError(schema: StructType, e: SparkException): Throwable = {
+ new SparkException(s"Failed merging schema:\n${schema.treeString}", e)
+ }
+
+ def cannotBroadcastExceedMaxTableRowsError(
+ maxBroadcastTableRows: Long, numRows: Long): Throwable = {
+ new SparkException(
+ s"Cannot broadcast the table over $maxBroadcastTableRows rows: $numRows rows")
+ }
+
+ def cannotBroadcastExceedMaxTableBytesError(
+ maxBroadcastTableBytes: Long, dataSize: Long): Throwable = {
+ new SparkException("Cannot broadcast the table that is larger than" +
+ s" ${maxBroadcastTableBytes >> 30}GB: ${dataSize >> 30} GB")
+ }
+
+ def notEnoughMemoryToBuildAndBroadcastTableError(oe: OutOfMemoryError): Throwable = {
+ new OutOfMemoryError("Not enough memory to build and broadcast the table to all " +
+ "worker nodes. As a workaround, you can either disable broadcast by setting " +
+ s"${SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key} to -1 or increase the spark " +
+ s"driver memory by setting ${SparkLauncher.DRIVER_MEMORY} to a higher value.")
+ .initCause(oe.getCause)
+ }
+
+ def executeUnsupportedByExecError(execName: String): Throwable = {
+ new UnsupportedOperationException(s"$execName does not support the execute() code path.")
+ }
+
+ def cannotMergeClassWithOtherClassError(className: String, otherClass: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Cannot merge $className with $otherClass")
+ }
+
+ def continuousProcessingUnsupportedByDataSourceError(sourceName: String): Throwable = {
+ new UnsupportedOperationException(
+ s"Data source $sourceName does not support continuous processing.")
+ }
+
+ def failedReadDataError(failureReason: Throwable): Throwable = {
+ new SparkException("Data read failed", failureReason)
+ }
+
+ def failedGenerateEpochMarkerError(failureReason: Throwable): Throwable = {
+ new SparkException("Epoch marker generation failed", failureReason)
+ }
+
+ def failedWriteJobError(failureReason: Throwable): Throwable = {
+ new SparkException("Writing job aborted.", failureReason)
+ }
+
+ def foreachWriterAbortedDueToTaskFailureError(): Throwable = {
+ new SparkException("Foreach writer has been aborted due to a task failure")
+ }
+
+ def integerOverflowError(message: String): Throwable = {
+ new ArithmeticException(s"Integer overflow. $message")
+ }
+
+ def failedReadDeltaFileError(fileToRead: Path, clazz: String, keySize: Int): Throwable = {
+ new IOException(
+ s"Error reading delta file $fileToRead of $clazz: key size cannot be $keySize")
+ }
+
+ def failedReadSnapshotFileError(fileToRead: Path, clazz: String, message: String): Throwable = {
+ new IOException(s"Error reading snapshot file $fileToRead of $clazz: $message")
+ }
+
+ def cannotPurgeAsBreakInternalStateError(): Throwable = {
+ new UnsupportedOperationException("Cannot purge as it might break internal state.")
+ }
+
+ def cleanUpSourceFilesUnsupportedError(): Throwable = {
+ new UnsupportedOperationException("Clean up source files is not supported when" +
+ " reading from the output directory of FileStreamSink.")
+ }
+
+ def latestOffsetNotCalledError(): Throwable = {
+ new UnsupportedOperationException(
+ "latestOffset(Offset, ReadLimit) should be called instead of this method")
+ }
+
+ def legacyCheckpointDirectoryExistsError(
+ checkpointPath: Path, legacyCheckpointDir: String): Throwable = {
+ new SparkException(
+ s"""
+ |Error: we detected a possible problem with the location of your checkpoint and you
+ |likely need to move it before restarting this query.
+ |
+ |Earlier version of Spark incorrectly escaped paths when writing out checkpoints for
+ |structured streaming. While this was corrected in Spark 3.0, it appears that your
+ |query was started using an earlier version that incorrectly handled the checkpoint
+ |path.
+ |
+ |Correct Checkpoint Directory: $checkpointPath
+ |Incorrect Checkpoint Directory: $legacyCheckpointDir
+ |
+ |Please move the data from the incorrect directory to the correct one, delete the
+ |incorrect directory, and then restart this query. If you believe you are receiving
+ |this message in error, you can disable it with the SQL conf
+ |${SQLConf.STREAMING_CHECKPOINT_ESCAPED_PATH_CHECK_ENABLED.key}.
+ """.stripMargin)
+ }
+
+ def subProcessExitedError(
+ exitCode: Int, stderrBuffer: CircularBuffer, cause: Throwable): Throwable = {
+ new SparkException(s"Subprocess exited with status $exitCode. " +
+ s"Error: ${stderrBuffer.toString}", cause)
+ }
+
+ def outputDataTypeUnsupportedByNodeWithoutSerdeError(
+ nodeName: String, dt: DataType): Throwable = {
+ new SparkException(s"$nodeName without serde does not support " +
+ s"${dt.getClass.getSimpleName} as output data type")
+ }
+
+ def invalidStartIndexError(numRows: Int, startIndex: Int): Throwable = {
+ new ArrayIndexOutOfBoundsException(
+ "Invalid `startIndex` provided for generating iterator over the array. " +
+ s"Total elements: $numRows, requested `startIndex`: $startIndex")
+ }
+
+ def concurrentModificationOnExternalAppendOnlyUnsafeRowArrayError(
+ className: String): Throwable = {
+ new ConcurrentModificationException(
+ s"The backing $className has been modified since the creation of this Iterator")
+ }
+
+ def doExecuteBroadcastNotImplementedByNodeError(nodeName: String): Throwable = {
+ new UnsupportedOperationException(s"$nodeName does not implement doExecuteBroadcast")
+ }
+
+ def databaseNameConflictWithSystemPreservedDatabaseError(globalTempDB: String): Throwable = {
+ new SparkException(
+ s"""
+ |$globalTempDB is a system preserved database, please rename your existing database
+ |to resolve the name conflict, or set a different value for
+ |${GLOBAL_TEMP_DATABASE.key}, and launch your Spark application again.
+ """.stripMargin.split("\n").mkString(" "))
+ }
+
+ def commentOnTableUnsupportedError(): Throwable = {
+ new SQLFeatureNotSupportedException("comment on table is not supported")
+ }
+
+ def unsupportedUpdateColumnNullabilityError(): Throwable = {
+ new SQLFeatureNotSupportedException("UpdateColumnNullability is not supported")
+ }
+
+ def renameColumnUnsupportedForOlderMySQLError(): Throwable = {
+ new SQLFeatureNotSupportedException(
+ "Rename column is only supported for MySQL version 8.0 and above.")
+ }
+
+ def hitAnErrorWhenExecutingQueryError(e: Throwable): QueryExecutionException = {
+ val message = "Hit an error when executing a query" +
+ (if (e.getMessage == null) "" else s": ${e.getMessage}")
+ new QueryExecutionException(message, e)
+ }
+
+ def nestedFieldUnsupportedError(colName: String): Throwable = {
+ new UnsupportedOperationException(s"Nested field $colName is not supported.")
+ }
+
+ def transformationsAndActionsNotInvokedByDriverError(): Throwable = {
+ new SparkException(
+ """
+ |Dataset transformations and actions can only be invoked by the driver, not inside of
+ |other Dataset transformations; for example, dataset1.map(x => dataset2.values.count()
+ |* x) is invalid because the values transformation and count action cannot be
+ |performed inside of the dataset1.map transformation. For more information,
+ |see SPARK-28702.
+ """.stripMargin.split("\n").mkString(" "))
+ }
+
+ def repeatedPivotsUnsupportedError(): Throwable = {
+ new UnsupportedOperationException("repeated pivots are not supported")
+ }
+
+ def pivotNotAfterGroupByUnsupportedError(): Throwable = {
Review comment:
Maybe `pivotUsageUnsupportedError`
--
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.
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
[GitHub] [spark] AmplabJenkins removed a comment on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-865940078
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/140125/
--
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.
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
[GitHub] [spark] SparkQA removed a comment on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-865668929
**[Test build #140125 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140125/testReport)** for PR 32958 at commit [`f87e24d`](https://github.com/apache/spark/commit/f87e24d944332844d935ad6b3152ef628a10bdc8).
--
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.
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
[GitHub] [spark] beliefer commented on a change in pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
beliefer commented on a change in pull request #32958:
URL: https://github.com/apache/spark/pull/32958#discussion_r655934506
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
##########
@@ -1647,4 +1643,300 @@ private[spark] object QueryCompilationErrors {
def invalidYearMonthIntervalType(startFieldName: String, endFieldName: String): Throwable = {
new AnalysisException(s"'interval $startFieldName to $endFieldName' is invalid.")
}
+
+ def queryFromRawFilesIncludeCorruptRecordColumnError(): Throwable = {
+ new AnalysisException(
+ """
+ |Since Spark 2.3, the queries from raw JSON/CSV files are disallowed when the
+ |referenced columns only include the internal corrupt record column
+ |(named _corrupt_record by default). For example:
+ |spark.read.schema(schema).csv(file).filter($\"_corrupt_record\".isNotNull).count()
+ |and spark.read.schema(schema).csv(file).select(\"_corrupt_record\").show().
+ |Instead, you can cache or save the parsed results and then send the same query.
+ |For example, val df = spark.read.schema(schema).csv(file).cache() and then
+ |df.filter($\"_corrupt_record\".isNotNull).count().
+ """.stripMargin('#'))
Review comment:
Thank you. `stripMargin` is good enough.
--
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.
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
[GitHub] [spark] AmplabJenkins removed a comment on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-866515261
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/140181/
--
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.
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
[GitHub] [spark] allisonwang-db commented on a change in pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
allisonwang-db commented on a change in pull request #32958:
URL: https://github.com/apache/spark/pull/32958#discussion_r655928725
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
##########
@@ -1485,12 +1485,8 @@ private[spark] object QueryCompilationErrors {
}
def cannotResolveColumnNameAmongAttributesError(
- lattr: Attribute, rightOutputAttrs: Seq[Attribute]): Throwable = {
- new AnalysisException(
- s"""
- |Cannot resolve column name "${lattr.name}" among
- |(${rightOutputAttrs.map(_.name).mkString(", ")})
- """.stripMargin.replaceAll("\n", " "))
+ colName: String, fieldNames: String): Throwable = {
+ new AnalysisException(s"""Cannot resolve column name "$colName" among ($fieldNames)""")
Review comment:
nit: use " instead of """
--
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.
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
[GitHub] [spark] SparkQA commented on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-866515250
**[Test build #140181 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140181/testReport)** for PR 32958 at commit [`9b1dafc`](https://github.com/apache/spark/commit/9b1dafc5d47d51cd0f7524a24653ca19383b934a).
* This patch **fails Scala style tests**.
* This patch merges cleanly.
* This patch adds no public classes.
--
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.
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
[GitHub] [spark] SparkQA commented on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-866717773
**[Test build #140183 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140183/testReport)** for PR 32958 at commit [`1d08c71`](https://github.com/apache/spark/commit/1d08c71ebb2c6dc96ec02c637a7ba70a323c0eec).
* This patch passes all tests.
* This patch merges cleanly.
* This patch adds no public classes.
--
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.
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
[GitHub] [spark] SparkQA commented on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-865927345
**[Test build #140125 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140125/testReport)** for PR 32958 at commit [`f87e24d`](https://github.com/apache/spark/commit/f87e24d944332844d935ad6b3152ef628a10bdc8).
* This patch passes all tests.
* This patch merges cleanly.
* This patch adds no public classes.
--
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.
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
[GitHub] [spark] SparkQA commented on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-865726741
Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/44652/
--
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.
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
[GitHub] [spark] beliefer commented on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
beliefer commented on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-864488167
cc @allisonwang-db
--
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.
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
[GitHub] [spark] AmplabJenkins removed a comment on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-866542051
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/44708/
--
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.
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
[GitHub] [spark] AmplabJenkins removed a comment on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-865726870
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/44652/
--
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.
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
[GitHub] [spark] beliefer commented on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
beliefer commented on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-865486368
Gentle ping @allisonwang-db
--
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.
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
[GitHub] [spark] SparkQA commented on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-865707005
Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/44652/
--
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.
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
[GitHub] [spark] SparkQA commented on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-866573827
Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/44710/
--
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.
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
[GitHub] [spark] SparkQA commented on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-866568401
Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/44710/
--
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.
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
[GitHub] [spark] SparkQA commented on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-866542035
Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/44708/
--
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.
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
[GitHub] [spark] beliefer removed a comment on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
beliefer removed a comment on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-864488167
ping @allisonwang-db
--
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.
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
[GitHub] [spark] allisonwang-db commented on a change in pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
allisonwang-db commented on a change in pull request #32958:
URL: https://github.com/apache/spark/pull/32958#discussion_r655930570
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
##########
@@ -1647,4 +1643,300 @@ private[spark] object QueryCompilationErrors {
def invalidYearMonthIntervalType(startFieldName: String, endFieldName: String): Throwable = {
new AnalysisException(s"'interval $startFieldName to $endFieldName' is invalid.")
}
+
+ def queryFromRawFilesIncludeCorruptRecordColumnError(): Throwable = {
+ new AnalysisException(
+ """
+ |Since Spark 2.3, the queries from raw JSON/CSV files are disallowed when the
+ |referenced columns only include the internal corrupt record column
+ |(named _corrupt_record by default). For example:
+ |spark.read.schema(schema).csv(file).filter($\"_corrupt_record\".isNotNull).count()
+ |and spark.read.schema(schema).csv(file).select(\"_corrupt_record\").show().
+ |Instead, you can cache or save the parsed results and then send the same query.
+ |For example, val df = spark.read.schema(schema).csv(file).cache() and then
+ |df.filter($\"_corrupt_record\".isNotNull).count().
+ """.stripMargin('#'))
Review comment:
why use `'#'` here?
--
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.
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
[GitHub] [spark] allisonwang-db commented on a change in pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
allisonwang-db commented on a change in pull request #32958:
URL: https://github.com/apache/spark/pull/32958#discussion_r655928725
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
##########
@@ -1485,12 +1485,8 @@ private[spark] object QueryCompilationErrors {
}
def cannotResolveColumnNameAmongAttributesError(
- lattr: Attribute, rightOutputAttrs: Seq[Attribute]): Throwable = {
- new AnalysisException(
- s"""
- |Cannot resolve column name "${lattr.name}" among
- |(${rightOutputAttrs.map(_.name).mkString(", ")})
- """.stripMargin.replaceAll("\n", " "))
+ colName: String, fieldNames: String): Throwable = {
+ new AnalysisException(s"""Cannot resolve column name "$colName" among ($fieldNames)""")
Review comment:
nit: use " instead of """
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
##########
@@ -1647,4 +1643,300 @@ private[spark] object QueryCompilationErrors {
def invalidYearMonthIntervalType(startFieldName: String, endFieldName: String): Throwable = {
new AnalysisException(s"'interval $startFieldName to $endFieldName' is invalid.")
}
+
+ def queryFromRawFilesIncludeCorruptRecordColumnError(): Throwable = {
+ new AnalysisException(
+ """
+ |Since Spark 2.3, the queries from raw JSON/CSV files are disallowed when the
+ |referenced columns only include the internal corrupt record column
+ |(named _corrupt_record by default). For example:
+ |spark.read.schema(schema).csv(file).filter($\"_corrupt_record\".isNotNull).count()
+ |and spark.read.schema(schema).csv(file).select(\"_corrupt_record\").show().
+ |Instead, you can cache or save the parsed results and then send the same query.
+ |For example, val df = spark.read.schema(schema).csv(file).cache() and then
+ |df.filter($\"_corrupt_record\".isNotNull).count().
+ """.stripMargin('#'))
Review comment:
why use `'#'` here?
--
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.
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
[GitHub] [spark] beliefer commented on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
beliefer commented on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-866817039
ping @allisonwang-db
--
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.
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
[GitHub] [spark] AmplabJenkins commented on pull request #32958: [SPARK-35065][SQL] Group exception messages in spark/sql (core)
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32958:
URL: https://github.com/apache/spark/pull/32958#issuecomment-865726870
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/44652/
--
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.
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