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 order-by on Array #5509

Closed
viadea opened this issue May 17, 2022 · 3 comments · Fixed by #7233
Closed

[FEA] Support order-by on Array #5509

viadea opened this issue May 17, 2022 · 3 comments · Fixed by #7233
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 May 17, 2022

I wish we can support order-by on Array.
Especially for Array[String] and Array[Long].

For example:

import org.apache.spark.sql.types._
val arrayData = Seq(
    Row("John",List("apple","orange","banana"),1,List(100L,200L,300L)),
    Row("David",List("apple","orange","banana"),2,List(100L,200L,300L)),
    Row("Harry",List("apple","other"),1,List(100L,200L,300L))
)

val arraySchema = new StructType().add("name",StringType).add("fruits", ArrayType(StringType)).add("favorite",IntegerType).add("arraylong", ArrayType(LongType))

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")

val sqltext_sort = """
select name from df2 order by fruits,arraylong
"""

spark.sql(sqltext_sort).show()

Not-supported-messages:

  !Expression <SortOrder> arraylong#116 ASC NULLS FIRST cannot run on GPU because expression SortOrder arraylong#116 ASC NULLS FIRST produces an unsupported type ArrayType(LongType,true); input expression AttributeReference arraylong#116 (ArrayType(LongType,true) is not supported)
@viadea viadea added feature request New feature or request ? - Needs Triage Need team to review and classify labels May 17, 2022
@sameerz sameerz added cudf_dependency An issue or PR with this label depends on a new feature in cudf and removed ? - Needs Triage Need team to review and classify labels May 17, 2022
@sameerz
Copy link
Collaborator

sameerz commented May 17, 2022

Depends on rapidsai/cudf#5890

@ttnghia
Copy link
Collaborator

ttnghia commented Nov 30, 2022

Cudf dependency was resolved.

@sameerz
Copy link
Collaborator

sameerz commented Jan 10, 2023

Depends on #7485 and #5430

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.

4 participants