Skip to content

Conversation

@finchxxia
Copy link

To fix issue#2163

Add support for SAMPLE clause on subqueries/derived tables. Previously, SAMPLE clause was only supported on table references, but Snowflake and other databases also support it on subqueries.

Add support for SAMPLE clause on subqueries/derived tables.
Previously, SAMPLE clause was only supported on table references,
but Snowflake and other databases also support it on subqueries.

Example:
  SELECT * FROM (SELECT * FROM mytable) SAMPLE (10)
  SELECT * FROM (SELECT * FROM mytable) AS t SAMPLE (50 PERCENT)
  SELECT * FROM (SELECT * FROM mytable) SAMPLE (10) SEED (42)
Copy link
Contributor

@iffyio iffyio left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @finchxxia!

@iffyio
Copy link
Contributor

iffyio commented Jan 22, 2026

@finchxxia could you take a look at the ci failure when you get some time?

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.

Snowflake: cannot parse SAMPLE in subquery

2 participants