You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "Jasper Duizendstra (Jira)" <ji...@apache.org> on 2020/05/24 18:30:00 UTC

[jira] [Created] (BEAM-10071) TableFieldSchema Conversion fails for beamschema

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)