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

Add support for structs in GpuScalarSubquery #4895

Closed
tgravescs opened this issue Mar 2, 2022 · 1 comment · Fixed by #4923
Closed

Add support for structs in GpuScalarSubquery #4895

tgravescs opened this issue Mar 2, 2022 · 1 comment · Fixed by #4923
Assignees
Labels
P1 Nice to have for release performance A performance related task/issue

Comments

@tgravescs
Copy link
Collaborator

Is your feature request related to a problem? Please describe.

Recently I found a case where a query was optimized so that the hash aggregate returned multiple aggregates in a struct, but our GpuScalarSubquery doesn't support handling of structs. We should add support for this.

 :  :- Subquery scalar-subquery#56, [id=#54]
  :  :  +- *(2) Project [named_struct(count(s), count(s)#31L, max(d), max(d)#33, max(i), max(i)#17, min(i), min(i)#19) AS mergedValue#55]
  :  :     +- *(2) HashAggregate(keys=[], functions=[count(s#37), max(d#38), max(i#35), min(i#35)])
  :  :        +- Exchange SinglePartition, ENSURE_REQUIREMENTS, [id=#49]
  :  :           +- *(1) HashAggregate(keys=[], functions=[partial_count(s#37), partial_max(d#38), partial_max(i#35), partial_min(i#35)])
  :  :              +- *(1) Project [s#37, d#38, i#35]
  :  :                 +- *(1) Scan ExistingRDD[l#34L,i#35,f#36,s#37,d#38]

!Expression <ScalarSubquery> Subquery scalar-subquery#150, [id=#300] cannot run on GPU because expression ScalarSubquery Subquery scalar-subquery#150, [id=#300] produces an unsupported type StructType(StructField(count(s),LongType,false), StructField(max(d),DecimalType(38,10),true), StructField(max(i),IntegerType,true), StructField(min(i),IntegerType,true))

Specifically in this environment the test_scalar_subquery test failed because the Project wasn't on the GPU.

@tgravescs tgravescs added feature request New feature or request ? - Needs Triage Need team to review and classify labels Mar 2, 2022
@tgravescs
Copy link
Collaborator Author

note that this type of optimization in spark could be reproduced by a change like: apache/spark#32298

@sperlingxx sperlingxx self-assigned this Mar 7, 2022
@sameerz sameerz added P1 Nice to have for release performance A performance related task/issue and removed ? - Needs Triage Need team to review and classify feature request New feature or request labels Mar 8, 2022
sperlingxx added a commit that referenced this issue Mar 11, 2022
Signed-off-by: sperlingxx <lovedreamf@gmail.com>

Closes #4895

Enable GpuScalarSubquery on nested types, so as to adapt the Spark patch apache/spark#32298 which is under development.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 Nice to have for release performance A performance related task/issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants