-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
bugSomething isn't workingSomething isn't workingeffort - mediummid-sized issue with average implementation time/difficultymid-sized issue with average implementation time/difficultyenhancementNew feature or requestNew feature or requesttestingAlters the testing/CI process for PyDoughAlters the testing/CI process for PyDough
Description
The behavior of GETPART when there is nothing in the original string after the delimiter is currently inconsistent between the ansi/sqlite implementation versus what other dialects to akin to the Snowflake SPLIT_PART function (which GETPART is based on)
The current implementation of GETPART in the ansi/sqlite translation compared to GETPART in MySQL and Snowflake is as follow:
| GETPART | ANSI/SQLITE | MySQL/SnowFlake |
|---|---|---|
| GETPART("string", "string", 1) -> | "" | "" |
| GETPART("string", "string", 2) -> | None | "" |
| GETPART("string", "string", 3) -> | None | None |
| GETPART("hello.world.", ".", 1) -> | "hello" | "hello" |
| GETPART("hello.world.", ".", 2) -> | "world" | "world" |
| GETPART("hello.world.", ".", 3) -> | None | "" |
| GETPART("hello.world.", ".", -1) -> | None | "" |
| GETPART("hello.world.", ".", -2) -> | "world" | "world" |
| GETPART("hello.world.", ".", -3) -> | "hello" | "hello" |
| GETPART("abab", "ab", 1) -> | "" | "" |
| GETPART("abab", "ab", 2) -> | "" | "" |
| GETPART("abab", "ab", 3) -> | None | "" |
| GETPART("abab", "ab", -1) -> | None | "" |
| GETPART("abab", "ab", -2) -> | "" | "" |
| GETPART("abab", "ab", -3) -> | "" | "" |
The desire behavior for the ansi/sqlite GETPART to maintain consistency through the dialects is the behavior of the MySQL/Snowflake implementation.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingeffort - mediummid-sized issue with average implementation time/difficultymid-sized issue with average implementation time/difficultyenhancementNew feature or requestNew feature or requesttestingAlters the testing/CI process for PyDoughAlters the testing/CI process for PyDough