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

integrate concat_ws for memsql and snowflake #2603

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

theodosis1989
Copy link
Contributor

What type of PR is this?

  • Bug Fix

What does this PR do / why is it needed ?

The current translation of joinStrings from PURE is to the CONCAT method in SQL. In some of the SQL implementations, including MemSQL and Snowflake that are addressed in this MR, the CONCAT method concatenates the variables without a delimiter, and produces null when one the values is null.

Example1: ['A', 'B']->joinStrings('|') in PURE, produces SQL CONCAT('A', 'B', '|') which evaluates to 'AB|'.
Example2: ['A', null]->joinStrings('|') in PURE, produces SQL CONCAT('A', null, '|') which evaluates to NULL.

Fix:
This MR maps the joinStrings for MemSQL and Snowflake to CONCAT_WS instead.
CONCAT_WS concatenates the variables using a delimiter
Example1: ['A', 'B']->joinStrings('|') in PURE, produces SQL CONCAT_WS('|', 'A', 'B') which evaluates to 'A|B'.
Example2: ['A', 'B']->joinStrings('|') in PURE, produces SQL CONCAT_WS('|', 'A', NULL) which evaluates to 'A'.

Which issue(s) this PR fixes:

Fixes #

Other notes for reviewers:

Does this PR introduce a user-facing change?

@theodosis1989 theodosis1989 requested a review from a team as a code owner February 2, 2024 12:51
Copy link

github-actions bot commented Feb 2, 2024

Test Results

     763 files       763 suites   1h 7m 18s ⏱️
12 601 tests 12 368 ✔️ 233 💤 0
15 712 runs  15 461 ✔️ 251 💤 0

Results for commit 0723dc8.

♻️ This comment has been updated with latest results.

@finos-admin
Copy link
Member

This PR is stale because it has been open for 30 days with no activity. Please remove stale label or add any comment to keep this open. Otherwise this will be closed in 5 days.

@finos-admin finos-admin removed the Stale label Apr 5, 2024
@finos-admin
Copy link
Member

This PR is stale because it has been open for 30 days with no activity. Please remove stale label or add any comment to keep this open. Otherwise this will be closed in 5 days.

@finos-admin finos-admin removed the Stale label May 10, 2024
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.

None yet

2 participants