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

AVRO-3666: [JAVA] Separate parsing from Schema class #2513

Merged

Conversation

opwvhk
Copy link
Contributor

@opwvhk opwvhk commented Sep 21, 2023

What is the purpose of the change

Allow using pluggable parser implementations, allowing multiple formats to be parsed with the same code.

Verifying this change

This change adds test for all added code. The change in IDLReader is for readability and is covered by existing tests.

Question: how can I better handle the collection parameter to the FormattedSchemaParser interface?

Documentation

This code introduces a new feature: the documentation (Getting Started with Java) now refers to the new code, and the Javadoc documents the rest.

@github-actions github-actions bot added Java Pull Requests for Java binding website labels Sep 21, 2023
@opwvhk opwvhk force-pushed the AVRO-3666-SchemaParser-unified-parser-interface branch 3 times, most recently from e5179e9 to 4d88a15 Compare September 21, 2023 15:23
@github-actions github-actions bot added the build label Sep 21, 2023
@opwvhk opwvhk changed the title [WIP] AVRO-3666: [JAVA] Separate parsing from Schema class AVRO-3666: [JAVA] Separate parsing from Schema class Nov 2, 2023
@opwvhk opwvhk marked this pull request as ready for review November 2, 2023 19:28
@opwvhk opwvhk force-pushed the AVRO-3666-SchemaParser-unified-parser-interface branch from 34971c0 to e92eac8 Compare November 9, 2023 08:51
This allows using pluggable parser implementations, allowing multiple
formats to be parsed with the same code.
Includes the use of NameValidator and parsing multiple files with
circular references between them.
@opwvhk opwvhk force-pushed the AVRO-3666-SchemaParser-unified-parser-interface branch from 588b055 to 5b024c1 Compare November 14, 2023 14:50
Fix the compile error by disabling the cache for the Hadoop2 build.
This cannot be code related, as the other test builds succeed.
@opwvhk opwvhk force-pushed the AVRO-3666-SchemaParser-unified-parser-interface branch from 5e10934 to d74a925 Compare November 15, 2023 10:50
@opwvhk opwvhk requested a review from clesaec November 20, 2023 09:30
Copy link
Contributor

@clesaec clesaec left a comment

Choose a reason for hiding this comment

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

Nice first stepto refactor Schema parsing (full would be to externalize all static parsing function from schema to a SchemaParser like class).
Just one question with ParseContext.namespace field.

Copy link
Contributor

@clesaec clesaec left a comment

Choose a reason for hiding this comment

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

ParseContext::fullName method seems useless (always called with "space" argument as null ?), but, LGTM globally (and enhance current code)

Copy link
Contributor

@clesaec clesaec left a comment

Choose a reason for hiding this comment

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

👍

@opwvhk opwvhk merged commit fd14339 into apache:main Dec 1, 2023
16 checks passed
@opwvhk opwvhk deleted the AVRO-3666-SchemaParser-unified-parser-interface branch December 1, 2023 11:01
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/*
Copy link
Contributor

Choose a reason for hiding this comment

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

There seems to be a double license here?

Protocol protocol = idlFile.getProtocol();
System.out.println(protocol);
Assert.assertEquals(5, protocol.getTypes().size());
// Path testIdl = Paths.get(".", "src", "test", "idl",
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we remove this test if it isn't being used?

@@ -1,3 +1,21 @@
/*
Copy link
Contributor

Choose a reason for hiding this comment

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

Double header?

@opwvhk opwvhk restored the AVRO-3666-SchemaParser-unified-parser-interface branch December 12, 2023 13:45
@opwvhk opwvhk deleted the AVRO-3666-SchemaParser-unified-parser-interface branch December 12, 2023 13:46
@opwvhk opwvhk restored the AVRO-3666-SchemaParser-unified-parser-interface branch March 8, 2024 07:56
@opwvhk opwvhk deleted the AVRO-3666-SchemaParser-unified-parser-interface branch April 4, 2024 19:11
RanbirK pushed a commit to RanbirK/avro that referenced this pull request May 13, 2024
This allows using pluggable parser implementations, allowing multiple
formats to be parsed with the same code.

This includes the use of NameValidator and parsing multiple files with
circular references between them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Java Pull Requests for Java binding website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants