Skip to content

Convert scalar TableSchema to ProtoSchema AST #6782

Description

@haphungw
  1. Map all 14 BigQuery scalar types (STRING, BYTES, INT64, DOUBLE, BOOL, TIMESTAMP, DATE, TIME, DATETIME, GEOGRAPHY, NUMERIC, BIGNUMERIC, INTERVAL, JSON) to proto2 types (FieldDescriptorProto::Type).
  2. Map NULLABLE, REQUIRED, and REPEATED modes to proto2 labels (LABEL_OPTIONAL, LABEL_REQUIRED, LABEL_REPEATED). Map unset modes to LABEL_OPTIONAL.
  3. Construct the root DescriptorProto with 1-based sequential field tags.
  4. Implement entry pointTryFrom<&TableSchema> for ProtoSchema and TryFrom<TableSchema> for ProtoSchema for public conversion.
  5. Expose SchemaError with typed variants for unsupported and invalid types.
  6. Verify that the generated descriptors load correctly into prost_reflect::DescriptorPool and roundtrip dynamic messages.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

api: bigqueryIssues related to the BigQuery API.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions