ahmedabu98 commented on code in PR #17431:
URL: https://github.com/apache/beam/pull/17431#discussion_r861344279


##########
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:
   i don't like the sound of it either, but thought of suggesting because the 
link doesn't add that nuance (in case the user wants to know why it's not 
supported yet).
   
   we could just mention that it is supported for the other write methods and 
put the link for more details?



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