You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "cboumalh (via GitHub)" <gi...@apache.org> on 2025/11/01 05:13:37 UTC
Re: [PR] [SPARK-53991][SQL] Add SQL support for KLL quantiles functions based on DataSketches [spark]
cboumalh commented on code in PR #52800:
URL: https://github.com/apache/spark/pull/52800#discussion_r2482888369
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala:
##########
@@ -3152,4 +3152,35 @@ private[sql] object QueryExecutionErrors extends QueryErrorsBase with ExecutionE
"max" -> toSQLValue(max, IntegerType),
"value" -> toSQLValue(value, IntegerType)))
}
+
+ def kllSketchInvalidQuantileRangeError(function: String, quantile: Double): Throwable = {
+ new SparkRuntimeException(
+ errorClass = "KLL_SKETCH_INVALID_QUANTILE_RANGE",
+ messageParameters = Map(
+ "quantile" -> toSQLValue(quantile, DoubleType)))
+ }
+
+ def kllSketchInvalidInputError(function: String, reason: String): Throwable = {
+ new SparkRuntimeException(
+ errorClass = "KLL_SKETCH_INVALID_INPUT",
+ messageParameters = Map("reason" -> reason))
+ }
+
+ def kllSketchIncompatibleMergeError(function: String, reason: String): Throwable = {
+ new SparkRuntimeException(
+ errorClass = "KLL_SKETCH_INCOMPATIBLE_MERGE",
+ messageParameters = Map("reason" -> reason))
+ }
+
+ def kllSketchKMustBeConstantError(function: String): Throwable = {
+ new SparkRuntimeException(
+ errorClass = "KLL_SKETCH_K_MUST_BE_CONSTANT",
+ messageParameters = Map.empty)
+ }
+
+ def kllSketchKOutOfRangeError(function: String, k: Int): Throwable = {
+ new SparkRuntimeException(
+ errorClass = "KLL_SKETCH_K_OUT_OF_RANGE",
+ messageParameters = Map("k" -> toSQLValue(k, IntegerType)))
+ }
Review Comment:
It may be beneficial to users to add this `"function" -> toSQLId(function)` in the messageParameters to know where the exception is coming from
--
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