PREHOOK: query: DESCRIBE FUNCTION if PREHOOK: type: DESCFUNCTION POSTHOOK: query: DESCRIBE FUNCTION if POSTHOOK: type: DESCFUNCTION IF(expr1,expr2,expr3) - If expr1 is TRUE (expr1 <> 0 and expr1 <> NULL) then IF() returns expr2; otherwise it returns expr3. IF() returns a numeric or string value, depending on the context in which it is used. PREHOOK: query: DESCRIBE FUNCTION EXTENDED if PREHOOK: type: DESCFUNCTION POSTHOOK: query: DESCRIBE FUNCTION EXTENDED if POSTHOOK: type: DESCFUNCTION IF(expr1,expr2,expr3) - If expr1 is TRUE (expr1 <> 0 and expr1 <> NULL) then IF() returns expr2; otherwise it returns expr3. IF() returns a numeric or string value, depending on the context in which it is used. PREHOOK: query: EXPLAIN SELECT IF(TRUE, 1, 2) AS COL1, IF(FALSE, CAST(NULL AS STRING), CAST(1 AS STRING)) AS COL2, IF(1=1, IF(2=2, 1, 2), IF(3=3, 3, 4)) AS COL3, IF(2=2, 1, NULL) AS COL4, IF(2=2, NULL, 1) AS COL5, IF(IF(TRUE, NULL, FALSE), 1, 2) AS COL6 FROM src tablesample (1 rows) PREHOOK: type: QUERY POSTHOOK: query: EXPLAIN SELECT IF(TRUE, 1, 2) AS COL1, IF(FALSE, CAST(NULL AS STRING), CAST(1 AS STRING)) AS COL2, IF(1=1, IF(2=2, 1, 2), IF(3=3, 3, 4)) AS COL3, IF(2=2, 1, NULL) AS COL4, IF(2=2, NULL, 1) AS COL5, IF(IF(TRUE, NULL, FALSE), 1, 2) AS COL6 FROM src tablesample (1 rows) POSTHOOK: type: QUERY STAGE DEPENDENCIES: Stage-0 is a root stage STAGE PLANS: Stage: Stage-0 Fetch Operator limit: -1 Processor Tree: TableScan alias: src Row Limit Per Split: 1 Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: COMPLETE Select Operator expressions: 1 (type: int), '1' (type: string), 1 (type: int), 1 (type: int), null (type: int), 2 (type: int) outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 Statistics: Num rows: 500 Data size: 50500 Basic stats: COMPLETE Column stats: COMPLETE ListSink PREHOOK: query: SELECT IF(TRUE, 1, 2) AS COL1, IF(FALSE, CAST(NULL AS STRING), CAST(1 AS STRING)) AS COL2, IF(1=1, IF(2=2, 1, 2), IF(3=3, 3, 4)) AS COL3, IF(2=2, 1, NULL) AS COL4, IF(2=2, NULL, 1) AS COL5, IF(IF(TRUE, NULL, FALSE), 1, 2) AS COL6 FROM src tablesample (1 rows) PREHOOK: type: QUERY PREHOOK: Input: default@src #### A masked pattern was here #### POSTHOOK: query: SELECT IF(TRUE, 1, 2) AS COL1, IF(FALSE, CAST(NULL AS STRING), CAST(1 AS STRING)) AS COL2, IF(1=1, IF(2=2, 1, 2), IF(3=3, 3, 4)) AS COL3, IF(2=2, 1, NULL) AS COL4, IF(2=2, NULL, 1) AS COL5, IF(IF(TRUE, NULL, FALSE), 1, 2) AS COL6 FROM src tablesample (1 rows) POSTHOOK: type: QUERY POSTHOOK: Input: default@src #### A masked pattern was here #### 1 1 1 1 NULL 2 PREHOOK: query: -- Type conversions EXPLAIN SELECT IF(TRUE, CAST(128 AS SMALLINT), CAST(1 AS TINYINT)) AS COL1, IF(FALSE, 1, 1.1) AS COL2, IF(FALSE, 1, 'ABC') AS COL3, IF(FALSE, 'ABC', 12.3) AS COL4 FROM src tablesample (1 rows) PREHOOK: type: QUERY POSTHOOK: query: -- Type conversions EXPLAIN SELECT IF(TRUE, CAST(128 AS SMALLINT), CAST(1 AS TINYINT)) AS COL1, IF(FALSE, 1, 1.1) AS COL2, IF(FALSE, 1, 'ABC') AS COL3, IF(FALSE, 'ABC', 12.3) AS COL4 FROM src tablesample (1 rows) POSTHOOK: type: QUERY STAGE DEPENDENCIES: Stage-0 is a root stage STAGE PLANS: Stage: Stage-0 Fetch Operator limit: -1 Processor Tree: TableScan alias: src Row Limit Per Split: 1 Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: COMPLETE Select Operator expressions: 128 (type: smallint), 1.1 (type: double), 'ABC' (type: string), '12.3' (type: string) outputColumnNames: _col0, _col1, _col2, _col3 Statistics: Num rows: 500 Data size: 93500 Basic stats: COMPLETE Column stats: COMPLETE ListSink PREHOOK: query: SELECT IF(TRUE, CAST(128 AS SMALLINT), CAST(1 AS TINYINT)) AS COL1, IF(FALSE, 1, 1.1) AS COL2, IF(FALSE, 1, 'ABC') AS COL3, IF(FALSE, 'ABC', 12.3) AS COL4 FROM src tablesample (1 rows) PREHOOK: type: QUERY PREHOOK: Input: default@src #### A masked pattern was here #### POSTHOOK: query: SELECT IF(TRUE, CAST(128 AS SMALLINT), CAST(1 AS TINYINT)) AS COL1, IF(FALSE, 1, 1.1) AS COL2, IF(FALSE, 1, 'ABC') AS COL3, IF(FALSE, 'ABC', 12.3) AS COL4 FROM src tablesample (1 rows) POSTHOOK: type: QUERY POSTHOOK: Input: default@src #### A masked pattern was here #### 128 1.1 ABC 12.3