Skip to content
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 GpuMapConcat #5533

Merged
merged 11 commits into from
May 25, 2022
Merged

Conversation

HaoYang670
Copy link
Collaborator

@HaoYang670 HaoYang670 commented May 19, 2022

Signed-off-by: remzi [email protected]
Closes #5405.

Method of concatenating map

  1. concatenate the key child and value child
  2. Build new map column vector from the above.

Supported types

MapType(primitive types) can run on GPU.
Nested types (MapType(array, struct, map)) are not supported. Because ColumnVector.listConcatenateByRow doesn't support nested types.

Example

scala> val df = Seq((Map(1 -> 2, 9 -> 10), Map(5 -> 6)), (Map(3 -> 4), Map(7 -> 8, 11 -> 12))).toDF
df: org.apache.spark.sql.DataFrame = [_1: map<int,int>, _2: map<int,int>]

scala> df.show
22/05/19 11:55:29 WARN GpuOverrides: 
! <LocalTableScanExec> cannot run on GPU because GPU does not currently support the operator class org.apache.spark.sql.execution.LocalTableScanExec
  @Expression <AttributeReference> _1#20 could run on GPU
  @Expression <AttributeReference> _2#21 could run on GPU

+-----------------+------------------+
|               _1|                _2|
+-----------------+------------------+
|{1 -> 2, 9 -> 10}|          {5 -> 6}|
|         {3 -> 4}|{7 -> 8, 11 -> 12}|
+-----------------+------------------+

scala> df.select(map_concat($"_1", $"_2")).collect
22/05/19 11:56:06 WARN GpuOverrides: 
! <LocalTableScanExec> cannot run on GPU because GPU does not currently support the operator class org.apache.spark.sql.execution.LocalTableScanExec
  @Expression <AttributeReference> map_concat(_1, _2)#34 could run on GPU

res2: Array[org.apache.spark.sql.Row] = Array([Map(1 -> 2, 9 -> 10, 5 -> 6)], [Map(3 -> 4, 7 -> 8, 11 -> 12)])

@HaoYang670
Copy link
Collaborator Author

build

Signed-off-by: remzi <[email protected]>
@HaoYang670
Copy link
Collaborator Author

build

@HaoYang670 HaoYang670 self-assigned this May 19, 2022
Copy link
Collaborator

@revans2 revans2 left a comment

Choose a reason for hiding this comment

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

Just a few nits that I don't think would block this from going in.

Signed-off-by: remzi <[email protected]>
@HaoYang670
Copy link
Collaborator Author

build

@HaoYang670
Copy link
Collaborator Author

build

1 similar comment
@HaoYang670
Copy link
Collaborator Author

build

@HaoYang670
Copy link
Collaborator Author

Hi @revans2 I think I have addressed all of your comments. Please review, thank you!

@revans2 revans2 merged commit e29f6e7 into NVIDIA:branch-22.06 May 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEA] Support map_concat function
3 participants