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 Group-By on Array[String] #4656

Closed
viadea opened this issue Jan 28, 2022 · 4 comments · Fixed by #6066
Closed

[FEA] Support Group-By on Array[String] #4656

viadea opened this issue Jan 28, 2022 · 4 comments · Fixed by #6066
Assignees
Labels
cudf_dependency An issue or PR with this label depends on a new feature in cudf feature request New feature or request

Comments

@viadea
Copy link
Collaborator

viadea commented Jan 28, 2022

I wish we can support group-by on Array[String].

Minimum repro:

import org.apache.spark.sql.types.{ArrayType, StringType, StructType}
val arrayData = Seq(
    Row("John",List("apple","orange","banana")),
    Row("David",List("apple","orange","banana")),
    Row("Harry",List("apple","other"))
)

val arraySchema = new StructType().add("name",StringType).add("fruits", ArrayType(StringType))

val df = spark.createDataFrame(spark.sparkContext.parallelize(arrayData),arraySchema)
df.write.mode("overwrite").format("parquet").save("/tmp/testparquet")
val df2=spark.read.parquet("/tmp/testparquet")
df2.createOrReplaceTempView("df2")
spark.sql("select fruits from df2 group by fruits").show()

Not-supported-messages:

 !Exec <HashAggregateExec> cannot run on GPU because ArrayTypes or MapTypes in grouping expressions are not supported
    @Expression <AttributeReference> fruits#71 could run on GPU
    @Expression <Alias> cast(fruits#71 as string) AS fruits#76 could run on GPU
      @Expression <Cast> cast(fruits#71 as string) could run on GPU
        @Expression <AttributeReference> fruits#71 could run on GPU
    !Exec <ShuffleExchangeExec> cannot run on GPU because not all partitioning can be replaced; Columnar exchange without columnar children is inefficient
      !Partitioning <HashPartitioning> cannot run on GPU because hash_key expression AttributeReference fruits#71 (ArrayType(StringType,true) is not supported)
        @Expression <AttributeReference> fruits#71 could run on GPU
      !Exec <HashAggregateExec> cannot run on GPU because ArrayTypes or MapTypes in grouping expressions are not supported
@viadea viadea added feature request New feature or request ? - Needs Triage Need team to review and classify labels Jan 28, 2022
@sameerz sameerz added the cudf_dependency An issue or PR with this label depends on a new feature in cudf label Jan 28, 2022
@sameerz sameerz assigned andygrove and revans2 and unassigned andygrove Jan 28, 2022
@revans2
Copy link
Collaborator

revans2 commented Feb 1, 2022

I filed rapidsai/cudf#10181 as the CUDF dependency that we need for this.

@revans2 revans2 removed their assignment Feb 1, 2022
@revans2
Copy link
Collaborator

revans2 commented Feb 1, 2022

I split up the original CUDF issue into two and added rapidsai/cudf#10184 for sorting of lists of strings. It is not required to do the initial work, but would really be nice to have.

@sameerz sameerz removed the ? - Needs Triage Need team to review and classify label Feb 1, 2022
@revans2
Copy link
Collaborator

revans2 commented Mar 10, 2022

In CUDF the ask is being listed as a special case of rapidsai/cudf#8039 so this is actually likely to be more generic in that the key could be lists of lists/etc.

@sameerz
Copy link
Collaborator

sameerz commented May 10, 2022

Depends on adding murmur3 hashing for list columns issue rapidsai/cudf#10378

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cudf_dependency An issue or PR with this label depends on a new feature in cudf feature request New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants