Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Function dot syntax #3369

Merged
merged 4 commits into from
Dec 18, 2024
Merged

feat: Function dot syntax #3369

merged 4 commits into from
Dec 18, 2024

Conversation

scsmithr
Copy link
Member

@scsmithr scsmithr commented Dec 18, 2024

>> CREATE TEMP TABLE t (a INT, b TEXT);
┌─────────────────────┐
│ Query success       │
│ No columns returned │
└─────────────────────┘

>> INSERT INTO t VALUES (3, 'cat'), (4, 'dog'), (NULL, 'mouse'), (5, NULL);
┌───────────────┐
│ rows_inserted │
│ UInt64        │
├───────────────┤
│             4 │
└───────────────┘

>> SELECT b.upper() FROM t;
┌───────┐
│ upper │
│ Utf8  │
├───────┤
│ CAT   │
│ NULL  │
│ MOUSE │
│ DOG   │
└───────┘

>> SELECT t.b.upper() AS my_upper, my_upper.repeat(t.a) AS my_repeat, my_repeat.lower() AS my_lower FROM t;
┌──────────┬───────────┬──────────┐
│ my_upper │ my_repeat │ my_lower │
│ Utf8     │ Utf8      │ Utf8     │
├──────────┼───────────┼──────────┤
│ MOUSE    │ NULL      │ NULL     │
│ NULL     │ NULL      │ NULL     │
│ CAT      │ CATCATCAT │ catcatc… │
│ DOG      │ DOGDOGDO… │ dogdogd… │
└──────────┴───────────┴──────────┘

Actual chaining later.

@scsmithr scsmithr changed the title Allow referencing aliases later in select list feat: Function chaining Dec 18, 2024
@scsmithr scsmithr marked this pull request as ready for review December 18, 2024 19:17
@scsmithr scsmithr enabled auto-merge (squash) December 18, 2024 19:18
@scsmithr scsmithr disabled auto-merge December 18, 2024 19:18
@scsmithr scsmithr changed the title feat: Function chaining feat: Function dot syntax Dec 18, 2024
@scsmithr scsmithr merged commit 7eff2d8 into main Dec 18, 2024
4 checks passed
@scsmithr scsmithr deleted the sean/chaining branch December 18, 2024 19:21
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