[
https://issues.apache.org/jira/browse/BEAM-9650?focusedWorklogId=514935&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-514935
]
ASF GitHub Bot logged work on BEAM-9650:
----------------------------------------
Author: ASF GitHub Bot
Created on: 21/Nov/20 00:26
Start Date: 21/Nov/20 00:26
Worklog Time Spent: 10m
Work Description: pabloem commented on a change in pull request #13170:
URL: https://github.com/apache/beam/pull/13170#discussion_r528037127
##########
File path: sdks/python/apache_beam/io/gcp/bigquery_read_internal.py
##########
@@ -100,3 +127,258 @@ def process(self, unused_element, unused_signal,
gcs_locations):
)
return main_output
+
+
+class _BigQueryReadSplit(beam.transforms.DoFn):
+ def __init__(
+ self,
+ options: PipelineOptions,
+ gcs_location: Union[str, ValueProvider] = None,
+ use_json_exports: bool = False,
+ bigquery_job_labels: Dict[str, str] = None,
+ step_name: str = None,
+ job_name: str = None,
+ unique_id: str = None,
+ kms_key: str = None,
+ project: str = None,
+ temp_dataset: Union[str, DatasetReference] = None):
+ self.options = options
+ self.use_json_exports = use_json_exports
+ self.gcs_location = gcs_location
+ self.bigquery_job_labels = bigquery_job_labels or {}
+ self._step_name = step_name
+ self._job_name = job_name or 'BQ_READ_SPLIT'
+ self._source_uuid = unique_id
+ self.kms_key = kms_key
+ self.project = project
+ self.temp_dataset = temp_dataset
+ self.bq_io_metadata = None
+
+ def display_data(self):
+ return {
+ 'use_json_exports': str(self.use_json_exports),
+ 'gcs_location': str(self.gcs_location),
+ 'bigquery_job_labels': json.dumps(self.bigquery_job_labels),
+ 'kms_key': str(self.kms_key),
+ 'project': str(self.project),
+ 'temp_dataset': str(self.temp_dataset)
+ }
+
+ def _get_temp_dataset(self):
+ if isinstance(self.temp_dataset, str):
+ return DatasetReference(
+ datasetId=self.temp_dataset, projectId=self._get_project())
+ else:
+ return self.temp_dataset
+
+ def process(self, element: 'ReadFromBigQueryRequest', *args,
+ **kwargs) -> Iterable[BoundedSource]:
+ bq = bigquery_tools.BigQueryWrapper(
+ temp_dataset_id=(
+ self._get_temp_dataset().datasetId if self._get_temp_dataset(
Review comment:
hm this is a great catch Cham. I've changed this so we always use the
same Dataset, and we just delete the temporary table. WDYT?
----------------------------------------------------------------
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: 514935)
Time Spent: 20h (was: 19h 50m)
> Add consistent slowly changing side inputs support
> --------------------------------------------------
>
> Key: BEAM-9650
> URL: https://issues.apache.org/jira/browse/BEAM-9650
> Project: Beam
> Issue Type: Bug
> Components: io-ideas
> Reporter: Mikhail Gryzykhin
> Assignee: Pablo Estrada
> Priority: P3
> Time Spent: 20h
> Remaining Estimate: 0h
>
> Add implementation for slowly changing dimentions based on [design
> doc](https://docs.google.com/document/d/1LDY_CtsOJ8Y_zNv1QtkP6AGFrtzkj1q5EW_gSChOIvg/edit]
--
This message was sent by Atlassian Jira
(v8.3.4#803005)