goccy / bigquery-emulator

BigQuery emulator server implemented in Go
MIT License
845 stars 108 forks source link

BigQuery Storage Read API schema error #221

Open gnagel opened 1 year ago

gnagel commented 1 year ago

The schema field returned by the storage read api has the namespace field in it, this results in an avro schema parsing error:

failed to create avro codec from schema {
  "namespace":"test-test-test.sample_dataset",
  "name":"sample_table",
  "type":"record",
  "fields":[
    {"type":"string","name":"Name"}
  ]
 }: Record ought to have valid name: schema name ought to have second and remaining characters contain only [A-Za-z0-9_]: test-test-test

The fix for this is to remove the Namespace field from types/avro.go:AVROSchema, this removes both the dashes & the dot . delimiter from the namespace