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][JSON] Support boolean type in from_json #9597

Closed
andygrove opened this issue Nov 1, 2023 · 0 comments · Fixed by #9620
Closed

[FEA][JSON] Support boolean type in from_json #9597

andygrove opened this issue Nov 1, 2023 · 0 comments · Fixed by #9620
Assignees
Labels
feature request New feature or request

Comments

@andygrove
Copy link
Contributor

andygrove commented Nov 1, 2023

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

PR #9423 adds basic support for from_json, but did not add support for the boolean type.

Describe the solution you'd like

Add support for boolean.

Describe alternatives you've considered

Additional context

Failing test:

def test_from_json_struct_boolean():
    json_string_gen = StringGen(r'{ "a": [truefalsTRUEFALS]{0,5}, "b": [0-9]{0,2} }') \
        .with_special_pattern('{ "a": true, "b": 1 }', weight=50) \
        .with_special_pattern('{ "a": false, "b": 0 }', weight=50) \
        .with_special_pattern('', weight=50) \
        .with_special_pattern('null', weight=50)
    assert_gpu_and_cpu_are_equal_collect(
        lambda spark : unary_op_df(spark, json_string_gen) \
            .select(f.from_json('a', 'struct<a:boolean, b:boolean>')),
        conf={"spark.rapids.sql.expression.JsonToStructs": True})
@andygrove andygrove added feature request New feature or request ? - Needs Triage Need team to review and classify labels Nov 1, 2023
@andygrove andygrove self-assigned this Nov 2, 2023
@mattahrens mattahrens removed the ? - Needs Triage Need team to review and classify label Nov 7, 2023
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.

2 participants