-
Notifications
You must be signed in to change notification settings - Fork 260
Support ElementAt #2260
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
Support ElementAt #2260
Conversation
sql-plugin/src/main/scala/org/apache/spark/sql/rapids/complexTypeExtractors.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/com/nvidia/spark/rapids/GpuOverrides.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/com/nvidia/spark/rapids/GpuOverrides.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/org/apache/spark/sql/rapids/complexTypeExtractors.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/org/apache/spark/sql/rapids/complexTypeExtractors.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/org/apache/spark/sql/rapids/complexTypeExtractors.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/org/apache/spark/sql/rapids/complexTypeExtractors.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/org/apache/spark/sql/rapids/complexTypeExtractors.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/com/nvidia/spark/rapids/GpuOverrides.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/com/nvidia/spark/rapids/GpuOverrides.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/org/apache/spark/sql/rapids/complexTypeExtractors.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/com/nvidia/spark/rapids/GpuOverrides.scala
Outdated
Show resolved
Hide resolved
|
build |
sql-plugin/src/main/scala/com/nvidia/spark/rapids/GpuOverrides.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/com/nvidia/spark/rapids/GpuOverrides.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/com/nvidia/spark/rapids/GpuOverrides.scala
Outdated
Show resolved
Hide resolved
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.
I found that ElementAt is located at collectionOperations.scala instead of complexTypeExtractors.scala in Spark. Shall we move GpuElementAt into collectionOperations.scala to follow the structure of Spark SQL ?
For most expressions I think it is good to try and mirror where Spark has them so yes. |
| @@ -0,0 +1,119 @@ | |||
| /* | |||
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.
This file is moved from rapids to sql, because:
- to match the path for this file in Spark
- to be able to call private [sql] class like
AbstractDataType,ArrayType.simpleString
|
LGTM |
|
build |
|
CI failing due to a window related PR, this PR has been reverted. |
|
build |
|
|
||
| object GetArrayItemUtil { | ||
| def evalColumnar(array: GpuColumnVector, ordinal: Scalar, dataType: DataType, | ||
| zeroIndexed: Boolean): ColumnVector = { |
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.
I asked for a common implementation because I thought it could be combined cleanly. This is not combined cleanly. At a minimum we need some documentation to explain exactly what is happening because it is not obvious from just the API. However, I am inclined to admin that my request was a bad one because the corner cases are handled differently enough that it is not simple to combine them, and perhaps we should leave these separate.
sql-plugin/src/main/scala/org/apache/spark/sql/rapids/complexTypeExtractors.scala
Outdated
Show resolved
Hide resolved
Signed-off-by: Allen Xu <[email protected]>
|
build |
Signed-off-by: Allen Xu <[email protected]>
Signed-off-by: Allen Xu <[email protected]>
|
build |
|
build |
|
build |
sql-plugin/src/main/scala/org/apache/spark/sql/rapids/collectionOperations.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/org/apache/spark/sql/rapids/collectionOperations.scala
Show resolved
Hide resolved
Signed-off-by: Allen Xu <[email protected]>
|
build |
Support ElementAt. Signed-off-by: Allen Xu <[email protected]>
Support ElementAt. Signed-off-by: Allen Xu <[email protected]>
This PR is to close #2060. This gives initial support for
element_at.Note apache/spark#30297 introduce different behaviors for element_at when invalid index or key is given to lhs with ansi mode enabled and disabled.
A follow-up issue is created to track the difference.
For
select element_at(Array(1,2,3), 4):Spark 3.0.2 + spark.sql.ansi.enabled=true:
Spark 3.1.1 + spark.sql.ansi.enabled=true:
For
select element_at(map(1, 'a', 2, 'b'), 3):Spark 3.0.2 + spark.sql.ansi.enabled=true:
Spark 3.1.1 + spark.sql.ansi.enabled=true:
Signed-off-by: Allen Xu [email protected]