-
Notifications
You must be signed in to change notification settings - Fork 25.8k
SQL: GROUPing BY conditional more complex CASE WHEN fails #46316
Copy link
Copy link
Closed
Labels
Description
The following query fails SELECT (CASE WHEN bool0 = TRUE THEN '1' WHEN NOT bool0 = TRUE THEN '0' ELSE CAST(NULL AS STRING) END) AS x FROM calcs GROUP BY x with
{
"error": {
"root_cause": [
{
"type": "folding_exception",
"reason": "line 1:9: Cannot find grouping for 'CASE WHEN bool0 = TRUE THEN '1' WHEN NOT bool0 = TRUE THEN '0' ELSE CAST(NULL AS STRING) END'"
}
],
"type": "folding_exception",
"reason": "line 1:9: Cannot find grouping for 'CASE WHEN bool0 = TRUE THEN '1' WHEN NOT bool0 = TRUE THEN '0' ELSE CAST(NULL AS STRING) END'"
},
"status": 400
}
While a simpler one - SELECT (CASE WHEN bool0 = TRUE THEN '1' ELSE '0' END) AS x FROM calcs GROUP BY x works as expected.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Fields
Give feedbackNo fields configured for issues without a type.