Skip to content

Remove fastjson library - #28007

Merged
Abacn merged 18 commits into
apache:masterfrom
gabry-lab:removeFastjson
Aug 18, 2023
Merged

Remove fastjson library#28007
Abacn merged 18 commits into
apache:masterfrom
gabry-lab:removeFastjson

Conversation

@gabry-lab

Copy link
Copy Markdown
Member

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

@github-actions

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

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.

@gabry-lab

Copy link
Copy Markdown
MemberAuthor

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

Comment threadCHANGES.md
@Abacn

Copy link
Copy Markdown
Contributor

Run SQL PostCommit

@Abacn

Copy link
Copy Markdown
Contributor

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

@gabry-lab

Copy link
Copy Markdown
MemberAuthor

I will add ALLOW_TRAILING_COMMA flag

@github-actionsgithub-actionsBot added build and removed build labels Aug 17, 2023
@gabry-labgabry-lab changed the title remove fastjson libraryRemove fastjson libraryAug 17, 2023
@Abacn

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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

configfastjson defaultjackson defaultjackson relaxed
normalooo
ALLOW_BACKSLASH_ESCAPING_ANY_CHARACTERoxo
ALLOW_COMMENTSoxo
ALLOW_MISSING_VALUESoxo
ALLOW_NON_NUMERIC_NUMBERSoxo
ALLOW_NUMERIC_LEADING_ZEROSoxo
ALLOW_SINGLE_QUOTESoxo
ALLOW_TRAILING_COMMAoxo
ALLOW_UNQUOTED_CONTROL_CHARSoxo
ALLOW_UNQUOTED_FIELD_NAMESoxo
ALLOW_YAML_COMMENTSxxo

…ensions/sql/TableUtils.java
more configs to default behaviour
Co-authored-by: Yi Hu <huuyyi@gmail.com>
@github-actionsgithub-actionsBot added build and removed build labels Aug 18, 2023
@github-actionsgithub-actionsBot added build and removed build labels Aug 18, 2023
@github-actionsgithub-actionsBot added build and removed build labels Aug 18, 2023
@github-actionsgithub-actionsBot added build and removed build labels Aug 18, 2023
@gabry-lab
gabry-lab requested a review from AbacnAugust 18, 2023 13:37
@Abacn

Copy link
Copy Markdown
Contributor

Run SQL PostCommit

@AbacnAbacn left a comment

Copy link
Copy Markdown
Contributor

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:masterAug 18, 2023
@gabry-lab
gabry-lab deleted the removeFastjson branch August 18, 2023 23:59
Sign up for freeto 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

@gabry-lab@Abacn