Skip to content

[SPARK-40152][SQL][TESTS] Move tests from SplitPart to elementAt#37637

Closed
wangyum wants to merge 1 commit intoapache:masterfrom
wangyum:SPARK-40152-3
Closed

[SPARK-40152][SQL][TESTS] Move tests from SplitPart to elementAt#37637
wangyum wants to merge 1 commit intoapache:masterfrom
wangyum:SPARK-40152-3

Conversation

@wangyum
Copy link
Member

@wangyum wangyum commented Aug 24, 2022

What changes were proposed in this pull request?

Move tests from SplitPart to elementAt in CollectionExpressionsSuite.

Why are the changes needed?

Simplify test.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

N/A.

Copy link
Contributor

@LuciferYang LuciferYang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, LGTM

@HyukjinKwon
Copy link
Member

Merged to master

@wangyum wangyum deleted the SPARK-40152-3 branch August 24, 2022 04:37
checkEvaluation(ElementAt(str, Literal(10), outOfBoundValue), UTF8String.fromString(""))
checkEvaluation(ElementAt(str, Literal(-10), outOfBoundValue), UTF8String.fromString(""))

checkEvaluation(ElementAt(StringSplitSQL(Literal.create(null, StringType), delimiter),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fails with ANSI mode on:

[info] - elementAt *** FAILED *** (309 milliseconds)
[info]   Exception evaluating element_at(stringsplitsql(11.12.13, .), 10, Some(), true) (ExpressionEvalHelper.scala:205)
[info]   org.scalatest.exceptions.TestFailedException:
[info]   at org.scalatest.Assertions.newAssertionFailedException(Assertions.scala:472)
[info]   at org.scalatest.Assertions.newAssertionFailedException$(Assertions.scala:471)
[info]   at org.scalatest.funsuite.AnyFunSuite.newAssertionFailedException(AnyFunSuite.scala:1563)
[info]   at org.scalatest.Assertions.fail(Assertions.scala:949)
[info]   at org.scalatest.Assertions.fail$(Assertions.scala:945)
[info]   at org.scalatest.funsuite.AnyFunSuite.fail(AnyFunSuite.scala:1563)
[info]   at org.apache.spark.sql.catalyst.expressions.ExpressionEvalHelper.checkEvaluationWithoutCodegen(ExpressionEvalHelper.scala:205)
[info]   at org.apache.spark.sql.catalyst.expressions.ExpressionEvalHelper.checkEvaluationWithoutCodegen$(ExpressionEvalHelper.scala:199)
[info]   at org.apache.spark.sql.catalyst.expressions.CollectionExpressionsSuite.checkEvaluationWithoutCodegen(CollectionExpressionsSuite.scala:39)
[info]   at org.apache.spark.sql.catalyst.expressions.ExpressionEvalHelper.checkEvaluation(ExpressionEvalHelper.scala:87)
[info]   at org.apache.spark.sql.catalyst.expressions.ExpressionEvalHelper.checkEvaluation$(ExpressionEvalHelper.scala:82)
[info]   at org.apache.spark.sql.catalyst.expressions.CollectionExpressionsSuite.checkEvaluation(CollectionExpressionsSuite.scala:39)
[info]   at org.apache.spark.sql.catalyst.expressions.CollectionExpressionsSuite.$anonfun$new$333(CollectionExpressionsSuite.scala:1546)

https://github.com/apache/spark/runs/8046961366?check_suite_focus=true

HyukjinKwon pushed a commit that referenced this pull request Aug 27, 2022
Move tests from SplitPart to elementAt in CollectionExpressionsSuite.

Simplify test.

No.

N/A.

Closes #37637 from wangyum/SPARK-40152-3.

Authored-by: Yuming Wang <yumwang@ebay.com>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
(cherry picked from commit 06997d6)
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
@HyukjinKwon
Copy link
Member

Merged to branch-3.3 too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants