Skip to content

Read a star's REPLACE and ILIKE - #9

Merged
IL-William merged 1 commit into
masterfrom
fix/star-replace-ilike-master
Oct 11, 2026
Merged

IL-William merged 1 commit into
masterfrom
fix/star-replace-ilike-master

Conversation

@IL-William

@IL-William IL-William commented Oct 11, 2026 •

Copy link
Copy Markdown
Owner

Patch 10 of the engine fork that collin pins (dbt-collin decision 0028). A star's REPLACE and ILIKE are now read when the star is expanded, as its EXCLUDE, EXCEPT and RENAME already were.

Until now the star expanded every column as it was:

  • SELECT * REPLACE (UPPER(b) AS b) FROM p came out with b a copy of p.b;
  • SELECT * ILIKE 'a%' FROM p came out with a, b and c.

The change

  • REPLACE: a column it names takes the replacing expression in its place, under its own name. It reads what the expression reads, and keeps the expression.
  • ILIKE: keeps only the columns whose name the pattern matches, as SQL's LIKE does (% for any run, _ for any one character), without regard to case.

Tests

  • ILIKE: a prefix, a suffix, a single-character pattern, a qualified star, a pattern in another case, and a CTE read through.
  • REPLACE: replacing with an expression of the column itself, of another column, and inside a CTE.
  • Both fail without the patch. 2964 tests pass, and cargo fmt --check is clean.

Measured through collin

Project Effect
3507 model Snowflake project, both its compiles cache identical, --indirect too: no model uses either option
Cal-ITP, Shopify identical
lineage-library book_labels.title is now a transform of books.title, and loan_keys keeps its three _id columns and is parsed: the three marks for these limits go

Nothing goes to pondpilot/flowscope.

🤖 Generated with Claude Code

https://claude.ai/code/session_017VTEw2dNNL9Pn57Hkeeirn

A wildcard's EXCLUDE, EXCEPT and RENAME were read when it was expanded,
its REPLACE and ILIKE were not: the star expanded every column as it was.

    SELECT * REPLACE (UPPER(b) AS b) FROM p
    SELECT * ILIKE 'a%' FROM p

The first came out with b a copy of p.b, the second with a, b and c.

A column a REPLACE names now takes the replacing expression in its place,
under its own name, reading what the expression reads, the expression
kept on the column. An ILIKE keeps the columns whose name its pattern
matches, as SQL's LIKE does, % for any run and _ for any one character,
without regard to case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017VTEw2dNNL9Pn57Hkeeirn
@IL-William
IL-William merged commit 8b83631 into master Oct 11, 2026
8 checks passed
@IL-William
IL-William deleted the fix/star-replace-ilike-master branch October 11, 2026 07:24
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