[ 
https://issues.apache.org/jira/browse/BEAM-9305?focusedWorklogId=397745&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-397745
 ]

ASF GitHub Bot logged work on BEAM-9305:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 04/Mar/20 18:25
            Start Date: 04/Mar/20 18:25
    Worklog Time Spent: 10m 
      Work Description: pabloem commented on pull request #11040: [BEAM-9305] 
Allow value provider query strings in _CustomBigQuerySource
URL: https://github.com/apache/beam/pull/11040#discussion_r387850061
 
 

 ##########
 File path: sdks/python/apache_beam/io/gcp/bigquery.py
 ##########
 @@ -644,6 +644,8 @@ def estimate_size(self):
           self.table_reference.tableId)
       return int(table.numBytes)
     else:
+      if isinstance(self.query, ValueProvider):
+        self.query = self.query.get()
 
 Review comment:
   I would probably do this without changing the class variable.
   
   I'd do a local variable: `query = self.query.get()`, and do it on every 
instance where `self.query` is accessed.
   
   The reason is that the Source objects may be recreated in different workers, 
and the  `self.query` variable would contain the original ValueProvider in all 
of those.
 
----------------------------------------------------------------
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:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 397745)
    Time Spent: 1h 10m  (was: 1h)

> Support ValueProvider for BigQuerySource query string
> -----------------------------------------------------
>
>                 Key: BEAM-9305
>                 URL: https://issues.apache.org/jira/browse/BEAM-9305
>             Project: Beam
>          Issue Type: New Feature
>          Components: io-py-gcp
>            Reporter: Elias Djurfeldt
>            Assignee: Elias Djurfeldt
>            Priority: Minor
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> Users should be able to use ValueProviders for the query string in 
> BigQuerySource.
> Ref: 
> [https://stackoverflow.com/questions/60146887/expected-eta-to-avail-pipeline-i-o-and-runtime-parameters-in-apache-beam-gcp-dat/60170614?noredirect=1#comment106464448_60170614]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to