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

fix case-sensitivity bug with SQL CASE/ELSE clause #5485

Merged
merged 1 commit into from
Nov 17, 2024
Merged

Conversation

mccanne
Copy link
Collaborator

@mccanne mccanne commented Nov 17, 2024

No description provided.

@mccanne mccanne requested a review from a team November 17, 2024 14:08
@mccanne mccanne merged commit b2c46ef into main Nov 17, 2024
3 checks passed
@mccanne mccanne deleted the fix-case-bug branch November 17, 2024 18:10
@philrz
Copy link
Contributor

philrz commented Nov 17, 2024

Verified in super commit 5c1851b.

Before:

$ super -version
Version: v1.18.0-155-g5f18349a

$ super -c "
SELECT OrderID, Quantity,
CASE
    WHEN Quantity > 30 THEN 'The quantity is greater than 30'
    WHEN Quantity = 30 THEN 'The quantity is 30'
    ELSE 'The quantity is under 30'
END AS QuantityText
FROM order_details.csv;"
parse error at line 6, column 5:
    ELSE 'The quantity is under 30'
=== ^ ===

Now:

$ super -version
Version: v1.18.0-157-g5c1851be

$ super -c "
SELECT OrderID, Quantity,
CASE
    WHEN Quantity > 30 THEN 'The quantity is greater than 30'
    WHEN Quantity = 30 THEN 'The quantity is 30'
    ELSE 'The quantity is under 30'
END AS QuantityText
FROM order_details.csv;"

{OrderID:10248.,Quantity:12.,QuantityText:"The quantity is under 30"}
{OrderID:10248.,Quantity:10.,QuantityText:"The quantity is under 30"}
...
{OrderID:10443.,Quantity:12.,QuantityText:"The quantity is under 30"}

Thanks @mccanne!

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.

3 participants