Last active
February 3, 2019 18:50
-
-
Save philsch/15b7a1eca0294e72661994dbd9a26a9b to your computer and use it in GitHub Desktop.
Blogpost: How to update row keys in Google Big Table (main function)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def run(): | |
| pipeline_options = PipelineOptions() | |
| pipeline = beam.Pipeline(options=pipeline_options) | |
| options = pipeline_options.view_as(AvroTransformOptions) | |
| steps = ( | |
| pipeline | |
| | 'ReadData' >> beam.io.ReadFromAvro(options.input, use_fastavro=True) | |
| | 'Transaform rowkey' >> beam.ParDo(CellTransformDoFn()) | |
| | 'WriteData' >> beam.io.WriteToAvro(options.output, BIG_TABLE_SCHEMA, use_fastavro=True)) | |
| result = pipeline.run() | |
| result.wait_until_finish() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment