Skip to content

Restore portable schema changes, with simple LogicalType support - #9604

Merged
reuvenlax merged 6 commits into
apache:masterfrom
TheNeuralBit:revert-revert-schema
Sep 21, 2019
Merged

Restore portable schema changes, with simple LogicalType support#9604
reuvenlax merged 6 commits into
apache:masterfrom
TheNeuralBit:revert-revert-schema

Conversation

@TheNeuralBit

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

LangSDKApexDataflowFlinkGearpumpSamzaSpark
GoBuild Status------Build Status------Build Status
JavaBuild StatusBuild StatusBuild StatusBuild Status
Build Status
Build Status
Build StatusBuild StatusBuild Status
Build Status
PythonBuild 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)

---JavaPythonGoWebsite
Non-portableBuild StatusBuild StatusBuild StatusBuild Status
Portable---Build Status------

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

@TheNeuralBit

Copy link
Copy Markdown
MemberAuthor

Run Dataflow ValidatesRunner

@TheNeuralBit

Copy link
Copy Markdown
MemberAuthor

Run JavaPortabilityApi PreCommit

@TheNeuralBit

Copy link
Copy Markdown
MemberAuthor

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


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

Run JavaPortabilityApi PreCommit

@reuvenlax

Copy link
Copy Markdown
Contributor

Run Java PreCommit

@reuvenlax

Copy link
Copy Markdown
Contributor

Run Python PreCommit

@reuvenlax

Copy link
Copy Markdown
Contributor

Run Dataflow ValidatesRunner

@reuvenlax

Copy link
Copy Markdown
Contributor

Run SQL PostCommit

@TheNeuralBit

Copy link
Copy Markdown
MemberAuthor

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

@reuvenlax

Copy link
Copy Markdown
Contributor

Run Dataflow Runner Nexmark Tests

@reuvenlax

Copy link
Copy Markdown
Contributor

LGTM. Will merge when all tests pass.

@TheNeuralBit

Copy link
Copy Markdown
MemberAuthor

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

@reuvenlax

Copy link
Copy Markdown
Contributor

Run Dataflow Runner Nexmark Tests

@reuvenlax

Copy link
Copy Markdown
Contributor

Run Dataflow ValidatesRunner

@reuvenlax

Copy link
Copy Markdown
Contributor

Run SQL PostCommit

@reuvenlax

Copy link
Copy Markdown
Contributor

Run Python PreCommit

@TheNeuralBit

Copy link
Copy Markdown
MemberAuthor

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

@TheNeuralBit

Copy link
Copy Markdown
MemberAuthor

Whoops fat fingered the "close and comment"

@TheNeuralBit

Copy link
Copy Markdown
MemberAuthor

Merged past #9620 which should fix the python precommit

@reuvenlax

Copy link
Copy Markdown
Contributor

run Dataflow ValidatesRunner

@reuvenlax

Copy link
Copy Markdown
Contributor

run Flink ValidatesRunner

@reuvenlax

Copy link
Copy Markdown
Contributor

run SQL PostCommit

@reuvenlax

Copy link
Copy Markdown
Contributor

run Portable Dataflow ValidatesRunner

@reuvenlax
reuvenlax merged commit 7aa42a7 into apache:masterSep 21, 2019
Sign up for freeto 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

@TheNeuralBit@Hannah-Jiang@reuvenlax@robinyqiu