Conditional expressions impose constraints on the evaluation order of their inputs. In essence, they are evaluated left to right, with short-circuiting, and only evaluate the output value that was chosen. In contrast, all inputs to regular functions are evaluated before calling the function. Short-circuiting in conditional expressions can be exploited for error handling or performance tuning.
CARVIEW |
Select Language
HTTP/2 200
last-modified: Wed, 09 Jul 2025 18:06:02 GMT
content-type: text/html; charset=utf-8
vary: Cookie
vary: Accept-Encoding
content-security-policy: base-uri 'self'; object-src 'none'; script-src 'strict-dynamic' 'unsafe-inline' https: http: 'nonce-IX4QO171D1Dy+LJx1lpLOJ6SyzCne2' 'unsafe-eval'; frame-ancestors 'self' https://developers.google.com/_d/analytics-iframe; report-uri https://csp.withgoogle.com/csp/devsite/v2
strict-transport-security: max-age=63072000; includeSubdomains; preload
x-xss-protection: 0
x-content-type-options: nosniff
cache-control: no-cache, must-revalidate
expires: 0
pragma: no-cache
content-encoding: gzip
x-cloud-trace-context: b1aaa49fcc87d6bb9d47239601eb173a
date: Sat, 19 Jul 2025 14:25:02 GMT
server: Google Frontend
content-length: 19792
alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
Conditional expressions in Dataflow SQL | Google Cloud
Skip to main content
Conditional expressions in Dataflow SQL
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-09 UTC."],[[["Conditional expressions differ from regular functions by evaluating inputs from left to right and only evaluating the chosen output value, which is known as short-circuiting."],["The `CASE` expression allows for comparisons between an expression and successive `WHEN` clause values, returning the first `result` where the comparison is true, or `else_result` if none match."],["`COALESCE` returns the first non-null expression in a list, while ignoring any remaining expressions, providing a way to handle null values."],["The `IF` function evaluates a condition, returning `true_result` if the condition is true, and `else_result` if it's false, with the unevaluated result being skipped."],["`NULLIF` returns `NULL` when the `expression` equals the `expression_to_match`; otherwise, it returns the original `expression`, comparing the two expressions."]]],[]]
Conditional expressions in Dataflow SQL
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-09 UTC.