You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "Moritz Mack (Jira)" <ji...@apache.org> on 2021/10/22 13:19:00 UTC

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

     [ https://issues.apache.org/jira/browse/BEAM-10071?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Moritz Mack updated BEAM-10071:
-------------------------------
    Resolution: Fixed
        Status: Resolved  (was: Open)

> 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
>            Priority: P3
>              Labels: GCP, easy-fix, patch
>             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)