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-7623] Add support to select MAP with Row as values in Beam SQL #9181

Merged
merged 1 commit into from Jul 29, 2019

Conversation

bmv126
Copy link
Contributor

@bmv126 bmv126 commented Jul 29, 2019

Currently Beam sql doesn't work well with Map having values of type Row (i.e Map<String,Row>)
An exception is thrown when trying to access a field inside the Map's Row value.

Jira: https://issues.apache.org/jira/browse/BEAM-7623

As part of this, support is added to handle map with Row as values.

R: @apilloud R: @akedin R: @amaliujia

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

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.

@amaliujia
Copy link
Contributor

LGTM

Copy link
Contributor

@akedin akedin left a comment

Choose a reason for hiding this comment

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

LGTM.

Do we support this in DDL? If so, probably makes sense to add a test in BeamDDLNestedTypesTest, and if not, then we should create a jira to add it.

.setRowSchema(inputSchema)
.apply(
SqlTransform.query(
"select PCOLLECTION.mapField['key'].strField as str, PCOLLECTION.mapField['key'].arrField[1] as arr, PCOLLECTION.nullableMapField['key'].arrField[1] as nullableField from PCOLLECTION"));
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the queries need comments at this level of complexity, it's hard to decipher what is returned in which sub-expression.

@akedin akedin merged commit c80ca6b into apache:master Jul 29, 2019
@bmv126 bmv126 deleted the map_with_row_as_value branch August 1, 2019 05:00
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

3 participants