Skip to content

Fail to parse BigQuery ddl with OPTIONS keywords. #298

@Trace2333

Description

@Trace2333

Describe the Bug
The parser is unable to correctly parse DDL statements that include OPTIONS(description=xxxxx). Mentioned ddl will return [] after parsing.

To Reproduce
Steps to reproduce the behavior:
Execute the following DDL, which results in an empty output:

CREATE TABLE `bigquery-public-data.noaa_gsod.gsod2000` (
  stn STRING OPTIONS(description="Station number (WMO/DATSAV3 number) for the location"),
  wban STRING OPTIONS(description="WBAN number where applicable—this is the historical 'Weather Bureau Air Force Navy' number, with WBAN being the acronym"),
  year STRING OPTIONS(description="The year"),
  mo STRING OPTIONS(description="The month"),
  da STRING OPTIONS(description="The day"),
  temp FLOAT64 OPTIONS(description="Mean temperature for the day in degrees Fahrenheit to the tenths. Missing = 9999.9"),
  count_temp INT64 OPTIONS(description="Number of observations used in calculating mean temperature"),
)
OPTIONS(
  description="Global summary of day data for 18 surface meteorological elements derived from synoptic/hourly observations"
);

Expected Behavior
The corresponding database tables and columns should be created as specified.

Screenshots
Results with OPTIONS removed:
Image

Results with OPTIONS retained:
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions