You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by ge...@apache.org on 2024/02/02 19:55:33 UTC
(spark) branch master updated: [SPARK-46964][SQL] Change the signature of the hllInvalidLgK query execution error to take an integer as 4th argument
This is an automated email from the ASF dual-hosted git repository.
gengliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new 0965412d5174 [SPARK-46964][SQL] Change the signature of the hllInvalidLgK query execution error to take an integer as 4th argument
0965412d5174 is described below
commit 0965412d517441a15d4da0b5fc8fe34a9b5ec40f
Author: Menelaos Karavelas <me...@databricks.com>
AuthorDate: Fri Feb 2 11:55:21 2024 -0800
[SPARK-46964][SQL] Change the signature of the hllInvalidLgK query execution error to take an integer as 4th argument
### What changes were proposed in this pull request?
The current signature of the `hllInvalidLgK` query execution error takes four arguments:
1. The SQL function (a string).
2. The minimum possible `lgk` value (an integer).
3. The maximum possible `lgk` value (an integer).
4. The actual invalid `lgk` value (a string).
There is no meaningful reason for the 4th argument to be a string. In this PR we change it to be an integer, just like the minimum and maximum valid values.
### Why are the changes needed?
Seeking to make the signature of the `hllInvalidLgK` error more meaningful and self-consistent.
### Does this PR introduce _any_ user-facing change?
No, there is no user-facing changes because of this PR. This is just an internal change.
### How was this patch tested?
Existing tests suffice.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #44995 from mkaravel/hll-invalid-lgk-error-arg.
Authored-by: Menelaos Karavelas <me...@databricks.com>
Signed-off-by: Gengliang Wang <ge...@apache.org>
---
.../sql/catalyst/expressions/aggregate/datasketchesAggregates.scala | 2 +-
.../main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/datasketchesAggregates.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/datasketchesAggregates.scala
index 595ae32d77b9..02925f3625d2 100644
--- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/datasketchesAggregates.scala
+++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/datasketchesAggregates.scala
@@ -196,7 +196,7 @@ object HllSketchAgg {
def checkLgK(lgConfigK: Int): Unit = {
if (lgConfigK < minLgConfigK || lgConfigK > maxLgConfigK) {
throw QueryExecutionErrors.hllInvalidLgK(function = "hll_sketch_agg",
- min = minLgConfigK, max = maxLgConfigK, value = lgConfigK.toString)
+ min = minLgConfigK, max = maxLgConfigK, value = lgConfigK)
}
}
}
diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala
index 9ff076c5fd50..af5cafdc8a3a 100644
--- a/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala
+++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala
@@ -2601,14 +2601,14 @@ private[sql] object QueryExecutionErrors extends QueryErrorsBase with ExecutionE
cause = e)
}
- def hllInvalidLgK(function: String, min: Int, max: Int, value: String): Throwable = {
+ def hllInvalidLgK(function: String, min: Int, max: Int, value: Int): Throwable = {
new SparkRuntimeException(
errorClass = "HLL_INVALID_LG_K",
messageParameters = Map(
"function" -> toSQLId(function),
"min" -> toSQLValue(min, IntegerType),
"max" -> toSQLValue(max, IntegerType),
- "value" -> value))
+ "value" -> toSQLValue(value, IntegerType)))
}
def hllInvalidInputSketchBuffer(function: String): Throwable = {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org