ClickHouse / ClickHouse/clickhouse-odbc

Using sql with ternary op doesn't work in Tableau

Open
#323 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
285
Forks
105
Avg merge
3h 56m
Merged PRs (30d)
3

Description

Using sql with ternary op doesn't work in Tableau - Questionmark(?) is treated as unnamed binding parameter.
Example:
_Select (1 = 2 ? 3 : 4)_
is translated into
_select (1 = 2 {odbc_positional_1:Nullable(Nothing)} 3 : 4)_

Replacing it with 'if' is a valid workaround but we have quite a lot big SQL reports using ternary op already.
What's your view on this? Can it be fixed by distinguishing ternary from binding parameter?

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the ternary expression through Tableau and the ODBC driver, then trace how question marks are identified as binding parameters. Verify the behavior against the example in the issue while checking that ordinary parameter binding still works. Done means ternary SQL is passed through correctly without breaking positional parameters.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, sql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.