Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,6 @@ private[sql] object QueryCompilationErrors extends QueryErrorsBase with Compilat
"invalidValue" -> toSQLExpr(invalidValue)))
}

def nullDataSourceOption(option: String): Throwable = {
new AnalysisException(
errorClass = "NULL_DATA_SOURCE_OPTION",
messageParameters = Map("option" -> option)
)
}

def unorderablePivotColError(pivotCol: Expression): Throwable = {
new AnalysisException(
errorClass = "INCOMPARABLE_PIVOT_COLUMN",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2937,4 +2937,11 @@ private[sql] object QueryExecutionErrors extends QueryErrorsBase with ExecutionE
)
)
}

def nullDataSourceOption(option: String): Throwable = {
new SparkIllegalArgumentException(
errorClass = "NULL_DATA_SOURCE_OPTION",
messageParameters = Map("option" -> option)
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import org.apache.commons.io.FilenameUtils
import org.apache.spark.SparkFiles
import org.apache.spark.internal.Logging
import org.apache.spark.sql.catalyst.util.CaseInsensitiveMap
import org.apache.spark.sql.errors.{QueryCompilationErrors, QueryExecutionErrors}
import org.apache.spark.sql.errors.QueryExecutionErrors
import org.apache.spark.sql.internal.SQLConf
import org.apache.spark.sql.types.TimestampNTZType
import org.apache.spark.util.Utils
Expand Down Expand Up @@ -56,7 +56,7 @@ class JDBCOptions(
// If an option value is `null`, throw a user-friendly error. Keys here cannot be null, as
// scala's implementation of Maps prohibits null keys.
if (v == null) {
throw QueryCompilationErrors.nullDataSourceOption(k)
throw QueryExecutionErrors.nullDataSourceOption(k)
}
properties.setProperty(k, v)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import scala.util.control.NonFatal

import test.org.apache.spark.sql.connector.catalog.functions.JavaStrLen.JavaStrLenStaticMagic

import org.apache.spark.{SparkConf, SparkException}
import org.apache.spark.{SparkConf, SparkException, SparkIllegalArgumentException}
import org.apache.spark.sql.{AnalysisException, DataFrame, ExplainSuiteHelper, QueryTest, Row}
import org.apache.spark.sql.catalyst.InternalRow
import org.apache.spark.sql.catalyst.analysis.{CannotReplaceMissingTableException, IndexAlreadyExistsException, NoSuchIndexException}
Expand Down Expand Up @@ -396,7 +396,7 @@ class JDBCV2Suite extends QueryTest with SharedSparkSession with ExplainSuiteHel
.option("pushDownOffset", null)
.table("h2.test.employee")
checkError(
exception = intercept[AnalysisException] {
exception = intercept[SparkIllegalArgumentException] {
df.collect()
},
condition = "NULL_DATA_SOURCE_OPTION",
Expand Down
Loading