Jasper Duizendstra created BEAM-10071:
-----------------------------------------

             Summary: TableFieldSchema Conversion fails for beamschema
                 Key: BEAM-10071
                 URL: https://issues.apache.org/jira/browse/BEAM-10071
             Project: Beam
          Issue Type: Bug
          Components: io-java-gcp
    Affects Versions: 2.20.0
            Reporter: Jasper Duizendstra
             Fix For: Not applicable


field.setType(toStandardSQLTypeName(type).toString()); [on line 310 of 
BigQueryUtils.java|https://github.com/apache/beam/blob/455fca5ab79f74d4e79a81e66942878f35aaa08c/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryUtils.java#L314]
 will fail with a java.lang.NullPointerException.

The cause is the construction around line [210 return 
BEAM_TO_BIGQUERY_TYPE_MAPPING.get(fieldType.getTypeName()); 
|https://github.com/apache/beam/blob/455fca5ab79f74d4e79a81e66942878f35aaa08c/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryUtils.java#L210]

I believe the issue can be solved by adding the missing datatypes (CHAR, 
VARCHAR, NUMERIC, DATE, and BIT to the items on row 
[189|https://github.com/apache/beam/blob/455fca5ab79f74d4e79a81e66942878f35aaa08c/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryUtils.java#L189]



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

Reply via email to