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

Missing parentheses around SELECT as expressions #8

Open
cpg314 opened this issue Feb 14, 2025 · 0 comments
Open

Missing parentheses around SELECT as expressions #8

cpg314 opened this issue Feb 14, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@cpg314
Copy link
Owner

cpg314 commented Feb 14, 2025

local u = import 'sqlsonnet.libsonnet';

 local x = u.select({
   fields: [1.5],
});

u.select({
    fields: [
        u.fn('round', [
        x
        ])
    ],
})

generates

SELECT
  round(
    SELECT
      1.5
  )

which is not valid in Clickhouse's dialect.

On the other hand,

SELECT
  round(
    (SELECT
      1.5)
  )

is fine, so we are just missing parentheses.

@cpg314 cpg314 added the bug Something isn't working label Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant