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 GetMapValue with non-literal key #5406

Closed
viadea opened this issue Apr 29, 2022 · 2 comments
Closed

[FEA] Support GetMapValue with non-literal key #5406

viadea opened this issue Apr 29, 2022 · 2 comments
Labels
duplicate This issue or pull request already exists

Comments

@viadea
Copy link
Collaborator

viadea commented Apr 29, 2022

I wish we can support GetMapValue with non-literal key.

For example:

from pyspark.sql.types import *
from pyspark.sql.functions import *
jsonString="""{"Zipcode":704,"ZipCodeType":"STANDARD","City":"PARC PARQUE","State":"PR","Zipcode":999}"""
df=spark.createDataFrame([(1, jsonString)],["id","value"])
df2=df.withColumn("value",from_json(df.value,MapType(StringType(),StringType())))

df2.withColumn('newcol', expr(f""" map_filter(value, (k,v)  -> value[split(k, "abc")[0]] is not NULL    )       """) ).collect()

Not-supported messages:

!Expression <GetMapValue> value#136[split(lambda k#225, abc, 2)[0]] cannot run on GPU because key only supports StringType if it is a literal value
@viadea viadea added feature request New feature or request ? - Needs Triage Need team to review and classify labels Apr 29, 2022
@sameerz sameerz added the cudf_dependency An issue or PR with this label depends on a new feature in cudf label May 3, 2022
@sameerz
Copy link
Collaborator

sameerz commented May 3, 2022

@mythrocks is this a duplicate of #5204 ?

@mythrocks
Copy link
Collaborator

Yep, it's a dupe. The libcudf end of it supports only scalar keys, currently.

It's not hard to add support for vectors. Just needs doing.

@revans2 revans2 added duplicate This issue or pull request already exists and removed ? - Needs Triage Need team to review and classify feature request New feature or request cudf_dependency An issue or PR with this label depends on a new feature in cudf labels May 4, 2022
@revans2 revans2 closed this as completed May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

4 participants