-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add support for array_remove expression #1179
Changes from 3 commits
d477f3b
988e021
1dbb3d3
ec89c3a
04bee72
68ba5ad
866423b
1ed00e1
10a4b47
de3d599
f8485c5
3594ded
4966d7c
cefc7f8
3caf95c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -2517,4 +2517,16 @@ class CometExpressionSuite extends CometTestBase with AdaptiveSparkPlanHelper { | |||||||||||
checkSparkAnswer(df.select("arrUnsupportedArgs")) | ||||||||||||
} | ||||||||||||
} | ||||||||||||
test("array_remove") { | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: there should be a blank line between tests:
Suggested change
|
||||||||||||
Seq(true, false).foreach { dictionaryEnabled => | ||||||||||||
withTempDir { dir => | ||||||||||||
val path = new Path(dir.toURI.toString, "test.parquet") | ||||||||||||
makeParquetFileAllTypes(path, dictionaryEnabled, 10000) | ||||||||||||
spark.read.parquet(path.toString).createOrReplaceTempView("t1"); | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: no need for semicolon:
Suggested change
|
||||||||||||
checkSparkAnswerAndOperator(sql("SELECT array_remove(array(_2, _3,_4), _2) from t1")) | ||||||||||||
checkSparkAnswerAndOperator(sql("SELECT array_remove(array(_2, _3,_4), 3) from t1")) | ||||||||||||
checkSparkAnswerAndOperator(sql("SELECT array_remove(array(_2, _3,_4), 10) from t1")) | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we add test case where key is null ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also can we tests where the array is null, array is empty, and array contains nulls. |
||||||||||||
} | ||||||||||||
} | ||||||||||||
} | ||||||||||||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: This can be inlined