phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alok Singh <a...@cloudability.com>
Subject Array functions with CASE statement
Date Sun, 20 Nov 2016 19:20:20 GMT
----TEST CASE----

Environment:Phoenix 4.7/HBase 1.1.2

CREATE TABLE TEST_TABLE (
       NAME VARCHAR(100) NOT NULL PRIMARY KEY,
       C1 VARCHAR(32),
       C2 VARCHAR(32)
    );

SELECT NAME, (CASE WHEN ALL(ARRAY[C1,C2]) = 'A' THEN 1 ELSE 2 END) AS VAL
FROM TEST_TABLE;

SELECT NAME, (CASE WHEN ANY(ARRAY[C1,C2]) = 'A' THEN 1 ELSE 2 END) AS VAL
FROM TEST_TABLE;
------

Both select statements fail with a parse error <<[Error Code: 602, SQL
State: 42P00]  ERROR 602 (42P00): Syntax error. Missing "LPAREN">>

Are ANY/ALL functions not supported within a CASE statement?

Alok

Mime
View raw message