Skip to content

fix: change group by alias to positional to support trino engine#40

Open
kovipaulo wants to merge 1 commit intometaplane:mainfrom
kovipaulo:fix/trino-group-by-alias
Open

fix: change group by alias to positional to support trino engine#40
kovipaulo wants to merge 1 commit intometaplane:mainfrom
kovipaulo:fix/trino-group-by-alias

Conversation

@kovipaulo
Copy link

Summary of Changes

Changed the grouping logic in the expect_row_values_to_have_data_for_every_n_datepart test macro. Specifically, replaced the alias-based grouping (group by date_{{date_part}}) with a positional grouping (group by 1).

Why Do We Need These Changes

This change fixes a SQL compilation error when running this test on Trino or Presto engines.

These engines resolve the GROUP BY clause before the SELECT projection, meaning they cannot resolve the column alias defined in the SELECT statement, causing a "Column not found" error.

Using GROUP BY 1:

  1. Resolves the issue on Trino/Starburst.
  2. Maintains compatibility with other supported adapters.

Closes #39

Reviewers

@GuruM

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.

[BUG] expect_row_values_to_have_data_for_every_n_datepart fails on Trino due to GROUP BY alias

1 participant