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

Remove fastjson library #28007

Merged
merged 18 commits into from
Aug 18, 2023
Merged

Remove fastjson library #28007

merged 18 commits into from
Aug 18, 2023

Conversation

gabrywu
Copy link
Member

@gabrywu gabrywu commented Aug 15, 2023

fix #24154,
hi @apilloud can you help to review this PR?

@github-actions
Copy link
Contributor

Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment assign set of reviewers

@github-actions
Copy link
Contributor

Assigning reviewers. If you would like to opt out of this review, comment assign to next reviewer:

R: @bvolpato for label java.
R: @damccorm for label build.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@Abacn
Copy link
Contributor

Abacn commented Aug 16, 2023

Thanks for working on this! There are merge conflicts - could you please rebase onto the current master? Also, consider add this change to CHANGES.md.

@gabrywu
Copy link
Member Author

gabrywu commented Aug 16, 2023

Thanks for working on this! There are merge conflicts - could you please rebase onto the current master? Also, consider add this change to CHANGES.md.

added

CHANGES.md Show resolved Hide resolved
@Abacn
Copy link
Contributor

Abacn commented Aug 16, 2023

Run SQL PostCommit

@Abacn
Copy link
Contributor

Abacn commented Aug 16, 2023

There are test failures:

org.apache.beam.sdk.extensions.sql.meta.provider.kafka.KafkaTableProviderIT.testFake2[0]

Error Message
java.lang.RuntimeException: illegal table properties: { "format" : "json",}
	at org.apache.beam.sdk.extensions.sql.TableUtils.parseProperties(TableUtils.java:50)
	at org.apache.beam.sdk.extensions.sql.meta.provider.kafka.KafkaTableProviderIT.testFake2(KafkaTableProviderIT.java:156)
...

Previously a ill-formed json { "format" : "json",} works, now it does not.

Similarly, it is nice to tolerant trailing comma

@gabrywu
Copy link
Member Author

gabrywu commented Aug 17, 2023

I will add ALLOW_TRAILING_COMMA flag

@github-actions github-actions bot added build and removed build labels Aug 17, 2023
@gabrywu gabrywu changed the title remove fastjson library Remove fastjson library Aug 17, 2023
@Abacn
Copy link
Contributor

Abacn commented Aug 17, 2023

Thanks again for the fix. It appears fastjson parser in general is more relax than the default jackson mapper. Let me do some small experiments regarding the default behavior of two parsers, specifically, the list in https://fasterxml.github.io/jackson-core/javadoc/2.9/com/fasterxml/jackson/core/JsonParser.Feature.html

@Abacn
Copy link
Contributor

Abacn commented Aug 17, 2023

Experiment result shows fastjson in general is much more relax in non-standard syntax. We may need to add other configs, see below.

config fastjson default jackson default jackson relaxed
normal o o o
ALLOW_BACKSLASH_ESCAPING_ANY_CHARACTER o x o
ALLOW_COMMENTS o x o
ALLOW_MISSING_VALUES o x o
ALLOW_NON_NUMERIC_NUMBERS o x o
ALLOW_NUMERIC_LEADING_ZEROS o x o
ALLOW_SINGLE_QUOTES o x o
ALLOW_TRAILING_COMMA o x o
ALLOW_UNQUOTED_CONTROL_CHARS o x o
ALLOW_UNQUOTED_FIELD_NAMES o x o
ALLOW_YAML_COMMENTS x x o

…ensions/sql/TableUtils.java


more configs to default behaviour

Co-authored-by: Yi Hu <[email protected]>
@github-actions github-actions bot added build and removed build labels Aug 18, 2023
@github-actions github-actions bot added build and removed build labels Aug 18, 2023
@github-actions github-actions bot added build and removed build labels Aug 18, 2023
@github-actions github-actions bot added build and removed build labels Aug 18, 2023
@gabrywu gabrywu requested a review from Abacn August 18, 2023 13:37
@Abacn
Copy link
Contributor

Abacn commented Aug 18, 2023

Run SQL PostCommit

Copy link
Contributor

@Abacn Abacn left a comment

Choose a reason for hiding this comment

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

LGTM

@Abacn Abacn merged commit 3d0bc5b into apache:master Aug 18, 2023
@gabrywu gabrywu deleted the removeFastjson branch August 18, 2023 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request]: fastjson & fastjson2 dependencies
2 participants