Skip to content

Support infer_schema for CSV and inline file formats in Snowflake - #373

Open
monti-python wants to merge 12 commits into
dbt-labs:mainfrom
monti-python:fix_schema_inference_issues
Open

Support infer_schema for CSV and inline file formats in Snowflake#373
monti-python wants to merge 12 commits into
dbt-labs:mainfrom
monti-python:fix_schema_inference_issues

Conversation

@monti-python

@monti-python monti-python commented Nov 9, 2025

Copy link
Copy Markdown

Solves #254, #284, and #336

Description & motivation

Schema inference (infer_schema: True) doesn't work neither for CSVs nor inline file formats. This is because:

  • Inline file formats are not supported with the INFER_SCHEMA() Snowflake function
  • CSV file formats need an additional file format for schema inference (one with PARSE_HEADER = True)

This PR solves both issues above and also does:

  • Support case-sensitive generated column aliases when setting ignore_case to False (convert inferred columns to quote: true)
  • Simplify parsing logic
  • Harmonize the way columns are treated (declared vs inferred columns)
  • Add integration tests for CSV and JSON with schema inference

Checklist

  • I have verified that these changes work locally
  • I have added an integration test for my fix/feature (if applicable)

@monti-python

monti-python commented Nov 9, 2025

Copy link
Copy Markdown
Author

@jeremyyeo @dataders FYI Snowflake integration tests are failing due to authentication errors with your test account.

Tests are running successfully in my own account though.

@github-actions

github-actions Bot commented May 9, 2026

Copy link
Copy Markdown

This PR has been marked as Stale because it has been open with no activity as of late. If you would like the PR to remain open, please comment on the PR or else it will be closed in 7 days.

@github-actions github-actions Bot added the Stale label May 9, 2026
@monti-python
monti-python requested a review from a team as a code owner June 11, 2026 17:03
@monti-python
monti-python force-pushed the fix_schema_inference_issues branch from 0e15711 to 2c2586f Compare June 11, 2026 23:03
@monti-python

Copy link
Copy Markdown
Author

I'd appreciate your feedback on this one @jeremyyeo @dataders @b-per

@github-actions github-actions Bot removed the Stale label Jun 12, 2026
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.

1 participant