Skip to content

Feat: to_json Infinity/-Infinity Nan values support#3875

Open
kazantsev-maksim wants to merge 61 commits into
apache:mainfrom
kazantsev-maksim:to_json_infinity_nan_support
Open

Feat: to_json Infinity/-Infinity Nan values support#3875
kazantsev-maksim wants to merge 61 commits into
apache:mainfrom
kazantsev-maksim:to_json_infinity_nan_support

Conversation

@kazantsev-maksim
Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Closes #3016

Rationale for this change

What changes are included in this PR?

How are these changes tested?

Tested with existing unit tests

@kazantsev-maksim
Copy link
Copy Markdown
Contributor Author

@kazuyukitanimura @andygrove Could you take another see when you have time.

Comment on lines +35 to +37
-- query expect_fallback(Struct type: StructType(StructField(a,ArrayType(IntegerType,false),false)) contains unsupported types)
query ignore("Need support Spark 4.0.0")
SELECT to_json(named_struct(a, array(b)))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you create a separate structs_to_json_spark4.sql for these tests and set min spark version 4 for that file, and change these to expect_fallback

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the branch from master and updated the tests.

Comment thread spark/src/test/scala/org/apache/comet/CometJsonExpressionSuite.scala Outdated
@andygrove andygrove requested a review from comphead May 1, 2026 17:54
@andygrove
Copy link
Copy Markdown
Member

I started CI. I will review once CI has run. Thanks @kazantsev-maksim

@kazantsev-maksim
Copy link
Copy Markdown
Contributor Author

Tests using expect_fallback work incorrectly on Spark versions >= 4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feat: to_json does not support +Infinity, -Infinity for numeric types

3 participants