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

[FEA] Support Cache(PCBS) Array-of-Struct #3573

Closed
viadea opened this issue Sep 21, 2021 · 2 comments · Fixed by #3619
Closed

[FEA] Support Cache(PCBS) Array-of-Struct #3573

viadea opened this issue Sep 21, 2021 · 2 comments · Fixed by #3619
Assignees
Labels
feature request New feature or request

Comments

@viadea
Copy link
Collaborator

viadea commented Sep 21, 2021

Is your feature request related to a problem? Please describe.
I wish the plugin can support Cache(PCBS) Array-of-Struct.

Describe the solution you'd like
Currently if we enable PCBS to cache an Array-Of-Struct, it will fallback on CPU.

Minimum repro:

import org.apache.spark.sql.Row
import org.apache.spark.sql.types._

val data = Seq(
    Row(Row("Adam ","","Green"),1,"M",10),
    Row(Row("Bob ","Middle","Green"),2,"M",20),
    Row(Row("Cathy ","","Green"),3,"F",30)
)

val schema = (new StructType()
  .add("name",new StructType()
    .add("firstname",StringType)
    .add("middlename",StringType)
    .add("lastname",StringType)) 
  .add("low",IntegerType)
  .add("gender",StringType)
  .add("high",IntegerType))

val df = spark.createDataFrame(spark.sparkContext.parallelize(data),schema)
df.write.format("parquet").mode("overwrite").save("/tmp/testparquet")

val df2 = spark.read.parquet("/tmp/testparquet")
df2.createOrReplaceTempView("df2")

val array_of_struct=spark.sql("SELECT array(struct(low,high)) as arrayofstruct FROM df2")
array_of_struct.write.format("parquet").mode("overwrite").save("/tmp/testparquet2")
val array_of_struct2 = spark.read.parquet("/tmp/testparquet2")
array_of_struct2.cache()
array_of_struct2.collect()

Driver log:

!Exec <InMemoryTableScanExec> cannot run on GPU because unsupported data types in output: ArrayType(StructType(StructField(low,IntegerType,true), StructField(high,IntegerType,true)),true) [arrayofstruct#85]

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context, code examples, or references to existing implementations about the feature request here.

@viadea viadea added feature request New feature or request ? - Needs Triage Need team to review and classify labels Sep 21, 2021
@razajafri
Copy link
Collaborator

depends on #2054

@razajafri
Copy link
Collaborator

closed as part of #3619

@sameerz sameerz added this to the Sep 13 - Sep 24 milestone Sep 23, 2021
@sameerz sameerz removed the ? - Needs Triage Need team to review and classify label Sep 23, 2021
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 a pull request may close this issue.

3 participants