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

[b/330573524] Prevent IF from treating NULL as FALSE #49

Merged
merged 1 commit into from
Mar 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions connector/tableau/looker-jdbc/dialect.tdd
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,8 @@
<argument type='spatial' />
</function>
<function group='logical' name='IIF' return-type='bool'>
<formula>IF((%1), (%2), (%3))</formula>
<!-- To prevent IF from coercing NULL to FALSE, wrap in another IF that checks for NULL. -->
<formula>IF((%1) IS NOT NULL, IF((%1), (%2), (%3)), NULL)</formula>
olivrlee marked this conversation as resolved.
Show resolved Hide resolved
<argument type='bool' />
<argument type='bool' />
<argument type='bool' />
Expand All @@ -687,7 +688,7 @@
<argument type='real' />
</function>
<function group='logical' name='IIF' return-type='int'>
<formula>IF((%1), (%2), (%3))</formula>
<formula>IF((%1) IS NOT NULL, IF((%1), (%2), (%3)), NULL)</formula>
<argument type='bool' />
<argument type='int' />
<argument type='int' />
Expand All @@ -700,7 +701,7 @@
<argument type='int' />
</function>
<function group='logical' name='IIF' return-type='str'>
<formula>IF((%1), (%2), (%3))</formula>
<formula>IF((%1) IS NOT NULL, IF((%1), (%2), (%3)), NULL)</formula>
<argument type='bool' />
<argument type='str' />
<argument type='str' />
Expand All @@ -713,7 +714,7 @@
<argument type='str' />
</function>
<function group='logical' name='IIF' return-type='datetime'>
<formula>IF((%1), (%2), (%3))</formula>
<formula>IF((%1) IS NOT NULL, IF((%1), (%2), (%3)), NULL)</formula>
<argument type='bool' />
<argument type='datetime' />
<argument type='datetime' />
Expand All @@ -726,7 +727,7 @@
<argument type='datetime' />
</function>
<function group='logical' name='IIF' return-type='date'>
<formula>IF((%1), (%2), (%3))</formula>
<formula>IF((%1) IS NOT NULL, IF((%1), (%2), (%3)), NULL)</formula>
<argument type='bool' />
<argument type='date' />
<argument type='date' />
Expand All @@ -739,7 +740,7 @@
<argument type='date' />
</function>
<function group='logical' name='IIF' return-type='spatial'>
<formula>IF((%1), (%2), (%3))</formula>
<formula>IF((%1) IS NOT NULL, IF((%1), (%2), (%3)), NULL)</formula>
<argument type='bool' />
<argument type='spatial' />
<argument type='spatial' />
Expand Down
Loading