feat(yaml): Add BigTable write connector#35435
Conversation
… connected and actually look good on user end for mutations
…hemaTransformProviderIT, and testing out new mutations etc
…ted new user input, all mutations work correctly, put demo code for it
...ain/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableSimpleWriteSchemaTransformProvider.java
Outdated
Show resolved
Hide resolved
...ain/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableSimpleWriteSchemaTransformProvider.java
Outdated
Show resolved
Hide resolved
...ain/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableSimpleWriteSchemaTransformProvider.java
Outdated
Show resolved
Hide resolved
...ain/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableSimpleWriteSchemaTransformProvider.java
Outdated
Show resolved
Hide resolved
...t/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableSimpleWriteSchemaTransformProviderIT.java
Outdated
Show resolved
Hide resolved
…am/sdk/io/gcp/bigtable/BigtableSimpleWriteSchemaTransformProvider.java Co-authored-by: Derrick Williams <myutat@gmail.com>
| # # Deletes all cells in a specific column, optionally within a time range. | ||
| # - {key: 'row2', | ||
| # type: 'DeleteFromColumn', | ||
| # family_name: "cf1", | ||
| # column_qualifier: "cq1", | ||
| # start_timestamp_micros: 2000, | ||
| # end_timestamp_micros: 5000 } | ||
| # | ||
| # # Deletes all cells in a specific column family. | ||
| # - {key: 'row3', | ||
| # type: 'DeleteFromFamily', | ||
| # family_name: "cf2" } | ||
| # | ||
| # # Deletes all cells in a specific row. | ||
| # - {key: 'row4', | ||
| # type: 'DeleteFromRow' } |
There was a problem hiding this comment.
should we use this or create another pipeline?
| # - pipeline: | ||
| # type: chain | ||
| # transforms: | ||
| # - type: ReadFromBigTable | ||
| # config: | ||
| # project: 'apache-beam-testing' | ||
| # instance: 'bt-write-tests' | ||
| # table: 'test-table' | ||
| # - type: MapToFields # Convert bytes back to strings for comparison | ||
| # name: ConvertBytesToStrings | ||
| # config: | ||
| # language: python | ||
| # fields: | ||
| # key: | ||
| # callable: | | ||
| # def convert_to_string(row): | ||
| # return row.key.decode('utf-8') if row.key is not None else None | ||
| # family_name: | ||
| # callable: | | ||
| # def convert_to_string(row): | ||
| # return row.family_name.decode('utf-8') if row.family_name is not None else None | ||
| # column_qualifier: | ||
| # callable: | | ||
| # def convert_to_string(row): | ||
| # return row.column_qualifier.decode('utf-8') if row.column_qualifier is not None else None | ||
| # value: | ||
| # callable: | | ||
| # def convert_to_string(row): | ||
| # return row.value.decode('utf-8') if row.value is not None else None | ||
| # - type: AssertEqual | ||
| # config: | ||
| # elements: |
There was a problem hiding this comment.
can we use ReadFromBigTable?
| .withProjectId(configuration.getProjectId())); | ||
| Schema inputSchema = input.getSinglePCollection().getSchema(); | ||
|
|
||
| System.out.println("Input Schema for BigTableMutations: " + inputSchema); |
There was a problem hiding this comment.
We should log the input schema only if it's relevant (e.g. if it's invalid and causing failures). It's not very useful when everything is WAI (and probably will just be noisy)
| // // new schema inputs get sent to the new transform provider mutation function | ||
| bigtableMutations = changeMutationInput(input); | ||
| } else { | ||
| System.out.println( |
There was a problem hiding this comment.
This should be throwing an error right? not just printing?
.../src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableWriteSchemaTransformProvider.java
Outdated
Show resolved
Hide resolved
| // // new schema inputs get sent to the new transform provider mutation function | ||
| bigtableMutations = changeMutationInput(input); | ||
| } else { | ||
| System.out.println( |
There was a problem hiding this comment.
Just saw you throw a RuntimeException below. I think that can be thrown here instead with the message you have here
.../src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableWriteSchemaTransformProvider.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableWriteSchemaTransformProvider.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableWriteSchemaTransformProvider.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableWriteSchemaTransformProvider.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableWriteSchemaTransformProvider.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableWriteSchemaTransformProvider.java
Outdated
Show resolved
Hide resolved
| 'ReadFromBigTable': | ||
| project: 'project_id' | ||
| instance: 'instance_id' | ||
| table: 'table_id' |
There was a problem hiding this comment.
let's not expose ReadFromBigtable just yet
There was a problem hiding this comment.
okay i put comments around it, do i comment out the read from bigtable in underlying provider or keep that so the IT tests dont fail?
There was a problem hiding this comment.
Let's remove it too. It should not be exposed to users
Do you mean IT tests are failing without it? How come?
| project: 'project_id' | ||
| instance: 'instance_id' | ||
| table: 'table_id' | ||
| Rows: "rows" |
| underlying_provider: | ||
| type: beamJar | ||
| transforms: | ||
| 'ReadFromBigTable': 'beam:schematransform:org.apache.beam:bigtable_read:v1' |
There was a problem hiding this comment.
the only test failing is Execution failed for task ':sdks:python:test-suites:tox:py39:testPy39CloudCoverage'.
I think its ready to merge, up to @ahmedabu98 and @derrickaw now,
ahmedabu98
left a comment
There was a problem hiding this comment.
Thanks for sticking through it @arnava2004! LGTM
@damccorm @derrickaw @fozzie15 @ahmedabu98
I added the BigTable Connector for BeamYaml
added new logic for bigtable yaml with the option to simplify the user input and make it more readable than the old logic,
all mutations work correctly
added tests to integration_test.py (I commented out some bugs in integration_test.py from new commits on the main branch, will remove if no more errors)
added a new test IT class called BigTableSimpleWriteSchemaTransformProviderIT
all logic works, please let me know if anything looks off/funny and if anything can be improved
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, commentfixes #<ISSUE NUMBER>instead.CHANGES.mdwith noteworthy changes.See the Contributor Guide for more tips on how to make review process smoother.
To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md
GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.