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

Restore portable schema changes, with simple LogicalType support #9604

Merged
merged 6 commits into from
Sep 21, 2019

Conversation

TheNeuralBit
Copy link
Member

Un-reverts changes to the portable schema representation, with a couple of changes (22f3852):

  • Changes the LogicalType string args to a byte payload
  • Supports encoding arbitrary Java SDK LogicalTypes with the beam:fieldtype:javasdk URN. Long-term I would like to move types to a registry and discourage this URN (BEAM-7855), but for now it replicates the current implementation.

Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Choose reviewer(s) and mention them in a comment (R: @username).
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

Post-Commit Tests Status (on master branch)

Lang SDK Apex Dataflow Flink Gearpump Samza Spark
Go Build Status --- --- Build Status --- --- Build Status
Java Build Status Build Status Build Status Build Status
Build Status
Build Status
Build Status Build Status Build Status
Build Status
Python Build Status
Build Status
Build Status
Build Status
--- Build Status
Build Status
Build Status --- --- Build Status
XLang --- --- --- Build Status --- --- ---

Pre-Commit Tests Status (on master branch)

--- Java Python Go Website
Non-portable Build Status Build Status Build Status Build Status
Portable --- Build Status --- ---

See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.

@TheNeuralBit
Copy link
Member Author

Run Dataflow ValidatesRunner

@TheNeuralBit
Copy link
Member Author

Run JavaPortabilityApi PreCommit

@TheNeuralBit
Copy link
Member Author

R: @reuvenlax could you take a look at this? It restores my changes to the schema proto, but with a modification to represent all logical types with a "javasdk" urn and serialized java object in the payload (for now).

I think the precommit failure is unrelated, Hannah tells me that #9610 should resolve it.

I ran the Dataflow VR tests and also merged in #9446 locally to make sure the CloudObjectsTest works

@@ -66,8 +50,8 @@
return builder.build();
}

private static RunnerApi.Schema.Field toProto(Field field, int fieldId, int position) {
return RunnerApi.Schema.Field.newBuilder()
private static SchemaApi.Field toProto(Field field, int fieldId, int position) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Rename to fieldToProto (to be consistent with fieldFromProto)?

RunnerApi.Schema.FieldType.Builder builder =
RunnerApi.Schema.FieldType.newBuilder()
.setTypeName(TYPE_NAME_MAPPING.get(fieldType.getTypeName()));
private static SchemaApi.FieldType toProto(FieldType fieldType) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Similarly, fieldTypeToProto


private static final String URN_BEAM_LOGICAL_DATETIME = "beam:fieldtype:datetime";
private static final String URN_BEAM_LOGICAL_DECIMAL = "beam:fieldtype:decimal";
private static final String URN_BEAM_LOGICAL_JAVASDK = "beam:fieldtype:javasdk";
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 rename this URN to beam:schema:logical_type:javasdk:v1 (similar above)? It sounds clearer to me, and I saw other URNs have version numbers

BYTES = 0 [(beam_urn) = "beam:coder:bytes:v1"];

@Hannah-Jiang
Copy link
Contributor

Run JavaPortabilityApi PreCommit

@reuvenlax
Copy link
Contributor

Run Java PreCommit

@reuvenlax
Copy link
Contributor

Run Python PreCommit

@reuvenlax
Copy link
Contributor

Run Dataflow ValidatesRunner

@reuvenlax
Copy link
Contributor

Run SQL PostCommit

@TheNeuralBit
Copy link
Member Author

Thank you @Hannah-Jiang! looks like syncing past #9610 fixed the precommit issue :)

@reuvenlax
Copy link
Contributor

Run Dataflow Runner Nexmark Tests

@reuvenlax
Copy link
Contributor

LGTM. Will merge when all tests pass.

@TheNeuralBit
Copy link
Member Author

I'll write a patch for @robinyqiu's naming suggestions as well

@reuvenlax
Copy link
Contributor

Run Dataflow Runner Nexmark Tests

@reuvenlax
Copy link
Contributor

Run Dataflow ValidatesRunner

@reuvenlax
Copy link
Contributor

Run SQL PostCommit

@reuvenlax
Copy link
Contributor

Run Python PreCommit

@TheNeuralBit
Copy link
Member Author

BEAM-8286 seems to be the cause of the Python PreCommit failure

@TheNeuralBit
Copy link
Member Author

Whoops fat fingered the "close and comment"

@TheNeuralBit TheNeuralBit reopened this Sep 19, 2019
@TheNeuralBit
Copy link
Member Author

Merged past #9620 which should fix the python precommit

@reuvenlax
Copy link
Contributor

run Dataflow ValidatesRunner

@reuvenlax
Copy link
Contributor

run Flink ValidatesRunner

@reuvenlax
Copy link
Contributor

run SQL PostCommit

@reuvenlax
Copy link
Contributor

run Portable Dataflow ValidatesRunner

@reuvenlax reuvenlax merged commit 7aa42a7 into apache:master Sep 21, 2019
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.

4 participants