Skip to content

encodeSchemaField() not quoting record field names #414

@pgcamus

Description

@pgcamus

What happened?

Attempt to create a table with a RECORD field one of whose embedded field names is "current" using the Google BigQuery Python SDK.

2025-07-01T20:50:14.276Z        ERROR   server/handler.go:2667  internalError   {"error": "internalError: failed to create table CREATE TABLE `unittest.efcdecdadc.resource_feeder` (`id` STRING,`type` STRING,`title` STRING,`config` STRUCT<voltage DOUBLE>,`ratings` STRUCT<power STRUCT<apparent DOUBLE>,voltage DOUBLE,current DOUBLE>,`upline` STRUCT<substation STRING,parent STRING>,`downline` STRUCT<bus STRING>,`raw` STRING): failed to parse statements: failed to parse statement: INVALID_ARGUMENT: Syntax error: Unexpected keyword CURRENT [type.googleapis.com/zetasql.ErrorLocation='\\x08\\x01\\x10\\xc2\\x01']"}

What did you expect to happen?

The table should haven been created.

How can we reproduce it (as minimally and precisely as possible)?

Create a table with a RECORD field containing a field named "current".

Anything else we need to know?

The issue is that encodeSchemaField() is not escaping record field names, whereas other codepaths in CreateTable() do this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions