Skip to content

fix(bigquery)!: support LOAD DATA FROM FILES syntax#7482

Merged
georgesittas merged 5 commits intotobymao:mainfrom
RedZapdos123:fix/bigquery-load-data-from-files
Apr 15, 2026
Merged

fix(bigquery)!: support LOAD DATA FROM FILES syntax#7482
georgesittas merged 5 commits intotobymao:mainfrom
RedZapdos123:fix/bigquery-load-data-from-files

Conversation

@RedZapdos123
Copy link
Copy Markdown
Contributor

@RedZapdos123 RedZapdos123 commented Apr 9, 2026

Summary:

  • add BigQuery parser support for LOAD DATA ... FROM FILES(...) syntax used in BigQuery docs
  • keep existing LOAD DATA ... INPATH ... parsing behavior by falling back to the base parser when FROM FILES is not matched
  • make LoadData.inpath optional and add optional files payload for BigQuery form
  • add BigQuery generator override to emit LOAD DATA [OVERWRITE|INTO TABLE ...] FROM FILES(...)
  • add BigQuery regression tests for both OVERWRITE ... FROM FILES(...) and INTO TABLE ... FROM FILES(...)

Closes #7480.

Validation:

  • Reproduced issue before fix: ParseError: Required keyword: 'inpath' missing
  • python -m pytest -q tests/dialects/test_bigquery.py -vv
  • python -m pytest -q
  • Direct parse reproduction now succeeds, and returns LoadData

The validations screenshots of the tests run, locally on WSL:

image image

Signed-off-by: Mridankan Mandal <xerontitan90@gmail.com>
Copy link
Copy Markdown
Collaborator

@VaggelisD VaggelisD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @RedZapdos123, thank you for your contribution, leaving a few comments:

Comment thread sqlglot/parsers/bigquery.py Outdated
Comment thread tests/dialects/test_bigquery.py Outdated
Comment thread tests/dialects/test_bigquery.py Outdated
Comment thread sqlglot/generators/bigquery.py Outdated
Signed-off-by: Mridankan Mandal <xerontitan90@gmail.com>
Signed-off-by: Mridankan Mandal <xerontitan90@gmail.com>
Signed-off-by: Mridankan Mandal <xerontitan90@gmail.com>
@RedZapdos123 RedZapdos123 force-pushed the fix/bigquery-load-data-from-files branch from 5194ed5 to 8e7e831 Compare April 14, 2026 15:41
Copy link
Copy Markdown
Collaborator

@VaggelisD VaggelisD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more comment and should be good to go I believe:

Comment thread sqlglot/generator.py Outdated
Signed-off-by: Mridankan Mandal <xerontitan90@gmail.com>
@georgesittas georgesittas changed the title fix(bigquery): support LOAD DATA FROM FILES syntax fix(bigquery)!: support LOAD DATA FROM FILES syntax Apr 15, 2026
@georgesittas georgesittas merged commit 800ca41 into tobymao:main Apr 15, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BigQuery: LOAD DATA ... FROM FILES(...) raises ParseError: Required keyword 'inpath' missing

4 participants