apache / apache/beam

Spanner JSON Type Not Supported When Reading Schema

Open
#21,337 0 comments 0 reactions 0 assignees View on GitHub
gcp io java new feature P3
Dominant language
Java
Stars
8.7k
Forks
4.7k
Avg merge
1d 20h
Merged PRs (30d)
196

Description

Our existing data pipeline failed when we added the new [JSON column](https://cloud.google.com/spanner/docs/working-with-json) to a Spanner table that it writes to.  The following is the stack trace.
```

Error message from worker: java.lang.IllegalArgumentException: Unknown spanner type JSON
org.apache.beam.sdk.io.gcp.spanner.SpannerSchema$Column.parseSpannerType(SpannerSchema.java:179)

org.apache.beam.sdk.io.gcp.spanner.SpannerSchema$Column.create(SpannerSchema.java:142)
org.apache.beam.sdk.io.gcp.spanner.SpannerSchema$Builder.addColumn(SpannerSchema.java:74)

org.apache.beam.sdk.io.gcp.spanner.ReadSpannerSchema.processElement(ReadSpannerSchema.java:63)
```

I included a proposed patch below that has not yet been tested.

https://github.com/apache/beam/compare/master...vilai-paypal:spanner_json_schema?expand=1

Imported from Jira [BEAM-13470](https://issues.apache.org/jira/browse/BEAM-13470). Original Jira may contain additional context.
Reported by: vilai.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.