[
https://issues.apache.org/jira/browse/BEAM-6914?focusedWorklogId=219742&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-219742
]
ASF GitHub Bot logged work on BEAM-6914:
----------------------------------------
Author: ASF GitHub Bot
Created on: 28/Mar/19 01:26
Start Date: 28/Mar/19 01:26
Worklog Time Spent: 10m
Work Description: chamikaramj commented on pull request #8143:
[BEAM-6914] Reverting behavior of Native BQ sink in Python
URL: https://github.com/apache/beam/pull/8143#discussion_r269829232
##########
File path: sdks/python/apache_beam/runners/dataflow/dataflow_runner.py
##########
@@ -590,6 +591,32 @@ def run_Flatten(self, transform_node, options):
PropertyNames.ENCODING: step.encoding,
PropertyNames.OUTPUT_NAME: PropertyNames.OUT}])
+ def apply_WriteToBigQuery(self, transform, pcoll, options):
+ # Make sure this is the WriteToBigQuery class that we expected, and that
+ # users did not specifically request the new BQ sink by passing experiment
+ # flag.
+ experiments = options.view_as(DebugOptions).experiments or []
+ if (not isinstance(transform, beam.io.WriteToBigQuery)
+ or 'new_bq_sink' in experiments):
+ return self.apply_PTransform(transform, pcoll, options)
+ standard_options = options.view_as(StandardOptions)
+ if standard_options.streaming:
+ if (transform.write_disposition ==
+ beam.io.BigQueryDisposition.WRITE_TRUNCATE):
+ raise RuntimeError('Can not use write truncation mode in streaming')
+ return self.apply_PTransform(transform, pcoll, options)
+ else:
+ from apache_beam.io.gcp.bigquery_tools import
parse_table_schema_from_json
+ return pcoll | 'WriteToBigQuery' >> beam.io.Write(
+ beam.io.BigQuerySink(
+ transform.table_reference.tableId,
+ transform.table_reference.datasetId,
+ transform.table_reference.projectId,
+ parse_table_schema_from_json(json.dumps(transform.schema)),
+ transform.create_disposition,
+ transform.write_disposition,
Review comment:
How about validate and coder parameters ?
https://github.com/apache/beam/blob/master/sdks/python/apache_beam/io/gcp/bigquery.py#L397
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 219742)
Time Spent: 1h 50m (was: 1h 40m)
> Use BigQuerySink as default for 2.12.
> -------------------------------------
>
> Key: BEAM-6914
> URL: https://issues.apache.org/jira/browse/BEAM-6914
> Project: Beam
> Issue Type: Improvement
> Components: sdk-py-core
> Reporter: Pablo Estrada
> Assignee: Pablo Estrada
> Priority: Blocker
> Fix For: 2.12.0
>
> Time Spent: 1h 50m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)