[
https://issues.apache.org/jira/browse/BEAM-14273?focusedWorklogId=763865&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-763865
]
ASF GitHub Bot logged work on BEAM-14273:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 28/Apr/22 20:20
Start Date: 28/Apr/22 20:20
Worklog Time Spent: 10m
Work Description: pabloem commented on code in PR #17431:
URL: https://github.com/apache/beam/pull/17431#discussion_r861280210
##########
sdks/python/apache_beam/io/gcp/bigquery.py:
##########
@@ -2190,6 +2190,20 @@ def expand(self, pcoll):
'A schema must be provided when writing to BigQuery using '
'Avro based file loads')
+ if self.schema and type(self.schema) is dict:
+
+ def find_in_nested_dict(schema):
+ for field in schema['fields']:
+ if field['type'] == 'JSON':
+ raise ValueError(
+ 'Found JSON type in table schema. JSON data '
+ 'insertion is currently not supported with '
+ 'FILE_LOADS write method.')
+ elif field['type'] == 'STRUCT':
+ find_in_nested_dict(field)
Review Comment:
so this is not supported for AVRO nor JSON file loads. Is that correct? Can
you perhaps post a reference to BQ docs in the `ValueError`? This would make it
easiest for customers to check when this issue surfaces.
Issue Time Tracking
-------------------
Worklog Id: (was: 763865)
Time Spent: 4h (was: 3h 50m)
> Update BQ connector to support new JSON type (Python)
> -----------------------------------------------------
>
> Key: BEAM-14273
> URL: https://issues.apache.org/jira/browse/BEAM-14273
> Project: Beam
> Issue Type: New Feature
> Components: io-py-gcp
> Reporter: Ahmed Abualsaud
> Assignee: Ahmed Abualsaud
> Priority: P2
> Time Spent: 4h
> Remaining Estimate: 0h
>
> BQ has a new JSON type that is defined here:
> [https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#json_type]
> We should update Beam BQ Java and Python connectors to support that for
> various read methods (export jobs, storage API) and write methods (load jobs,
> streaming inserts, storage API).
> We should also add integration tests that exercise reading from /writing to
> BQ tables with columns that has JSON type.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)