beam icon indicating copy to clipboard operation
beam copied to clipboard

[Bug]: Beam SQL docs: the Parquet type mapping table on the CREATE EXTERNAL TABLE page is wrong

Open jonathansudhakar1 opened this issue 3 weeks ago • 2 comments

What happened?

The Parquet Schema table on the Beam SQL CREATE EXTERNAL TABLE page (source, L532-L589) says which Avro type each Beam SQL type becomes. Several rows don't match what ParquetTable actually does. It converts the table schema with AvroUtils.toAvroSchema (getFieldSchema, L1141-L1272).

Beam SQL type Docs say Actual Avro type
TINYINT, SMALLINT, INTEGER long int
BIGINT long long
FLOAT double float
DOUBLE double double
DATE long (with logical type) int (date)
TIME long (with logical type) not supported: fails with Unhandled logical type beam:logical_type:time:v1 (#40994)
TIMESTAMP long (with logical type) long (timestamp-millis)
BINARY, VARBINARY (missing) bytes
MAP (missing) map (VARCHAR keys only; other key types fail with Avro only supports maps with string keys)

DECIMAL (bytes, decimal), BOOLEAN, CHAR/VARCHAR (string), ARRAY (array) and ROW (record) are correct.

I checked this on master (74ab567d2e3) with a temporary JUnit test in sdks/java/extensions/sql. For each type, it runs CREATE EXTERNAL TABLE t (c <type>) TYPE parquet ... and prints AvroUtils.toAvroSchema of the table schema. Every column comes out as a ["null", <type>] union, because DDL columns are nullable by default. A second test writes a row with INSERT and reads it back with SELECT *. That round trip succeeds for every type above except TIME (#40994), DATE (#41017) and ROW (#18883).

Expected: the table lists the types ParquetTable actually writes, and it marks TIME as unsupported for now.

I'm planning to submit a docs fix for this.

Issue Priority

Priority: 3 (minor)

Issue Components

  • [ ] Component: Python SDK
  • [ ] Component: Java SDK
  • [ ] Component: Go SDK
  • [ ] Component: Typescript SDK
  • [ ] Component: IO connector
  • [ ] Component: Beam YAML
  • [ ] Component: Beam examples
  • [ ] Component: Beam playground
  • [ ] Component: Beam katas
  • [x] Component: Website
  • [ ] Component: Infrastructure
  • [ ] Component: Spark Runner
  • [ ] Component: Flink Runner
  • [ ] Component: Prism Runner
  • [ ] Component: Hazelcast Jet Runner
  • [ ] Component: Google Cloud Dataflow Runner

jonathansudhakar1 avatar Nov 05 '26 17:11 jonathansudhakar1

.take-issue

jonathansudhakar1 avatar Nov 05 '26 17:11 jonathansudhakar1

.add-labels bug,'awaiting triage'

jonathansudhakar1 avatar Nov 05 '26 17:11 jonathansudhakar1