This is an automated email from the ASF dual-hosted git repository.
maxgekk pushed a commit to branch branch-4.0
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/branch-4.0 by this push:
new a6ad0d9b59fb [SPARK-51241][SQL][TESTS] Add test cases with ignore
nulls for ANY_VALUE
a6ad0d9b59fb is described below
commit a6ad0d9b59fbdf44f958b4575123aa7df5a55046
Author: beliefer <[email protected]>
AuthorDate: Tue Feb 18 21:47:48 2025 +0100
[SPARK-51241][SQL][TESTS] Add test cases with ignore nulls for ANY_VALUE
### What changes were proposed in this pull request?
This PR proposes to add test cases with ignore nulls for `ANY_VALUE`.
### Why are the changes needed?
According to the discussion at
https://github.com/apache/spark/pull/49981#discussion_r1959439297
### Does this PR introduce _any_ user-facing change?
'No'.
### How was this patch tested?
GA
### Was this patch authored or co-authored using generative AI tooling?
'No'.
Closes #49990 from beliefer/SPARK-51241_new.
Authored-by: beliefer <[email protected]>
Signed-off-by: Max Gekk <[email protected]>
(cherry picked from commit 6dbd12a81c22fac2d75b417515cf665f4190cdde)
Signed-off-by: Max Gekk <[email protected]>
---
.../apache/spark/sql/catalyst/parser/ExpressionParserSuite.scala | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git
a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/ExpressionParserSuite.scala
b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/ExpressionParserSuite.scala
index fc8bcfa3f687..f57b2230740b 100644
---
a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/ExpressionParserSuite.scala
+++
b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/ExpressionParserSuite.scala
@@ -26,7 +26,7 @@ import org.apache.spark.SparkThrowable
import org.apache.spark.sql.catalyst.FunctionIdentifier
import org.apache.spark.sql.catalyst.analysis.{UnresolvedAttribute, _}
import org.apache.spark.sql.catalyst.expressions._
-import org.apache.spark.sql.catalyst.expressions.aggregate.{First, Last}
+import org.apache.spark.sql.catalyst.expressions.aggregate.{AnyValue, First,
Last}
import org.apache.spark.sql.catalyst.plans.logical.{OneRowRelation, Project}
import org.apache.spark.sql.catalyst.util.{DateTimeTestUtils, IntervalUtils}
import org.apache.spark.sql.catalyst.util.DateTimeConstants._
@@ -1150,13 +1150,18 @@ class ExpressionParserSuite extends AnalysisTest {
assertEqual(complexName2.quotedString, UnresolvedAttribute(Seq("fo``o",
"ba``r")))
}
- test("SPARK-19526 Support ignore nulls keywords for first and last") {
+ test("SPARK-19526: Support ignore nulls keywords for first and last") {
assertEqual("first(a ignore nulls)", First($"a",
true).toAggregateExpression())
assertEqual("first(a)", First($"a", false).toAggregateExpression())
assertEqual("last(a ignore nulls)", Last($"a",
true).toAggregateExpression())
assertEqual("last(a)", Last($"a", false).toAggregateExpression())
}
+ test("SPARK-51241: Add test cases with ignore nulls for ANY_VALUE") {
+ assertEqual("any_value(a ignore nulls)", AnyValue($"a",
true).toAggregateExpression())
+ assertEqual("any_value(a)", AnyValue($"a", false).toAggregateExpression())
+ }
+
test("timestamp literals") {
DateTimeTestUtils.outstandingZoneIds.foreach { zid =>
withSQLConf(SQLConf.SESSION_LOCAL_TIMEZONE.key -> zid.getId) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]