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

[BEAM-2292] PCollection as a Table #3138

Closed
wants to merge 2 commits into from
Closed

Conversation

mingmxu
Copy link

@mingmxu mingmxu commented May 14, 2017

add BeamPCollectionTable to create table from PCollection

Note that it changes the interface of BaseBeamTable, as a BeamPCollectionTable doesn't start from PBegin, return PCollection<BeamSQLRow> is more clear:

-  public abstract PTransform<? super PBegin, PCollection<BeamSQLRow>> buildIOReader();
+  public abstract PCollection<BeamSQLRow> buildIOReader(Pipeline pipeline);

@mingmxu
Copy link
Author

mingmxu commented May 14, 2017

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 148e0b3 on XuMingmin:BEAM-2292 into ** on apache:DSL_SQL**.

@mingmxu
Copy link
Author

mingmxu commented May 17, 2017

retest this please

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 6fd2550 on XuMingmin:BEAM-2292 into ** on apache:DSL_SQL**.

@mingmxu
Copy link
Author

mingmxu commented May 18, 2017

retest this please

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 6fd2550 on XuMingmin:BEAM-2292 into ** on apache:DSL_SQL**.

@mingmxu
Copy link
Author

mingmxu commented May 18, 2017

@xumingming Can you take a look here?

@xumingming
Copy link
Contributor

The only comment i have is: the dataType of the table seems inferable from the rows? Quote from BaseBeamTable:

  public BaseBeamTable(RelProtoDataType protoRowType) {
    this.relDataType = protoRowType.apply(BeamQueryPlanner.TYPE_FACTORY); // table dataType
    this.beamSqlRecordType = BeamSQLRecordType.from(relDataType); // rowDataType
  }

@mingmxu
Copy link
Author

mingmxu commented May 19, 2017

Do you mean the parameter of

public BeamPCollectionTable(PCollection<BeamSQLRow> upstream, RelProtoDataType protoRowType)

?
PCollection<BeamSQLRow> itself doesn't return value of field BeamSQLRow.dataType, though it can be known when processing records. This schema information is required for Calcite to validate query, I suppose we need to pass it to the construction method.

}

public BeamPCollectionTable(PCollection<BeamSQLRow> upstream, RelProtoDataType protoRowType){
this(protoRowType);
Copy link
Contributor

Choose a reason for hiding this comment

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

can the protoRowType infered from the rows?

@xumingming
Copy link
Contributor

LGTM

@mingmxu
Copy link
Author

mingmxu commented May 19, 2017

@jbonofre can you also take a peak here?

@jbonofre
Copy link
Member

R: @jbonofre

Copy link
Member

@jbonofre jbonofre left a comment

Choose a reason for hiding this comment

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

LGTM, I'm merging.

asfgit pushed a commit that referenced this pull request May 21, 2017
@jbonofre
Copy link
Member

Merged on DSL_SQL branch. You can close this pull request. Thanks !

@mingmxu
Copy link
Author

mingmxu commented May 21, 2017

Thank you @jbonofre @xumingming

@mingmxu mingmxu closed this May 21, 2017
@mingmxu mingmxu deleted the BEAM-2292 branch May 21, 2017 16:47
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.

None yet

4 participants