prodriguezdefino commented on code in PR #21879:
URL: https://github.com/apache/beam/pull/21879#discussion_r900506673


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryServicesImpl.java:
##########
@@ -616,13 +616,24 @@ private DatasetServiceImpl(BigQueryOptions bqOptions) {
     @Override
     public @Nullable Table getTable(TableReference tableRef, List<String> 
selectedFields)
         throws IOException, InterruptedException {
-      return getTable(tableRef, selectedFields, createDefaultBackoff(), 
Sleeper.DEFAULT);
+      return getTable(tableRef, selectedFields, 
TableMetadataView.STORAGE_STATS);

Review Comment:
   I used the enum value on the default behavior marked on the [api 
page](https://cloud.google.com/bigquery/docs/reference/rest/v2/tables/get) 
based on @ayberk comment and for clarity sake. 
   
   JIC I just ran the the requests on a simple table, see below. 
   
   this is the response with unset `view` param: 
   ```{
     "kind": "bigquery#table",
     "etag": "mlPgtbB4NwSxbglNCDXbVg==",
     "id": "pabs-pso-lab:dataflowps2bq.testpubsubbq",
     "selfLink": 
"https://content-bigquery.googleapis.com/bigquery/v2/projects/pabs-pso-lab/datasets/dataflowps2bq/tables/testpubsubbq";,
     "tableReference": {
       "projectId": "pabs-pso-lab",
       "datasetId": "dataflowps2bq",
       "tableId": "testpubsubbq"
     },
     "schema": {
       "fields": [
         {
           "name": "Student_Name",
           "type": "STRING",
           "mode": "REQUIRED"
         }
       ]
     },
     "numBytes": "1000",
     "numLongTermBytes": "1000",
     "numRows": "100",
     "creationTime": "1618523588042",
     "lastModifiedTime": "1618531373191",
     "type": "TABLE",
     "location": "US",
     "numTotalLogicalBytes": "1000",
     "numActiveLogicalBytes": "0",
     "numLongTermLogicalBytes": "1000"
   }
   ```
   
   This setting `STORAGE_STATS` on `view`: 
   ```
   {
     "kind": "bigquery#table",
     "etag": "mlPgtbB4NwSxbglNCDXbVg==",
     "id": "pabs-pso-lab:dataflowps2bq.testpubsubbq",
     "selfLink": 
"https://content-bigquery.googleapis.com/bigquery/v2/projects/pabs-pso-lab/datasets/dataflowps2bq/tables/testpubsubbq";,
     "tableReference": {
       "projectId": "pabs-pso-lab",
       "datasetId": "dataflowps2bq",
       "tableId": "testpubsubbq"
     },
     "schema": {
       "fields": [
         {
           "name": "Student_Name",
           "type": "STRING",
           "mode": "REQUIRED"
         }
       ]
     },
     "numBytes": "1000",
     "numLongTermBytes": "1000",
     "numRows": "100",
     "creationTime": "1618523588042",
     "lastModifiedTime": "1618531373191",
     "type": "TABLE",
     "location": "US",
     "numTotalLogicalBytes": "1000",
     "numActiveLogicalBytes": "0",
     "numLongTermLogicalBytes": "1000"
   }
   ```
   This one when setting `FULL` on `view`: 
   ```
   {
     "kind": "bigquery#table",
     "etag": "mlPgtbB4NwSxbglNCDXbVg==",
     "id": "pabs-pso-lab:dataflowps2bq.testpubsubbq",
     "selfLink": 
"https://content-bigquery.googleapis.com/bigquery/v2/projects/pabs-pso-lab/datasets/dataflowps2bq/tables/testpubsubbq";,
     "tableReference": {
       "projectId": "pabs-pso-lab",
       "datasetId": "dataflowps2bq",
       "tableId": "testpubsubbq"
     },
     "schema": {
       "fields": [
         {
           "name": "Student_Name",
           "type": "STRING",
           "mode": "REQUIRED"
         }
       ]
     },
     "numBytes": "1000",
     "numLongTermBytes": "1000",
     "numRows": "100",
     "creationTime": "1618523588042",
     "lastModifiedTime": "1618531373191",
     "type": "TABLE",
     "location": "US",
     "numTotalLogicalBytes": "1000",
     "numActiveLogicalBytes": "0",
     "numLongTermLogicalBytes": "1000"
   }
   ```
   And this one when using `BASIC` on `view`: 
   ```
   {
     "kind": "bigquery#table",
     "etag": "mlPgtbB4NwSxbglNCDXbVg==",
     "id": "pabs-pso-lab:dataflowps2bq.testpubsubbq",
     "selfLink": 
"https://content-bigquery.googleapis.com/bigquery/v2/projects/pabs-pso-lab/datasets/dataflowps2bq/tables/testpubsubbq";,
     "tableReference": {
       "projectId": "pabs-pso-lab",
       "datasetId": "dataflowps2bq",
       "tableId": "testpubsubbq"
     },
     "schema": {
       "fields": [
         {
           "name": "Student_Name",
           "type": "STRING",
           "mode": "REQUIRED"
         }
       ]
     },
     "creationTime": "1618523588042",
     "type": "TABLE"
   }
   ```



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to