Skip to content
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -1717,6 +1717,10 @@ private boolean checkExprNodeDescForDecimal64(ExprNodeDesc exprNodeDesc) throws
GenericUDF udf = ((ExprNodeGenericFuncDesc) exprNodeDesc).getGenericUDF();
Class<?> udfClass = udf.getClass();
if (udf instanceof GenericUDFToDecimal) {
ExprNodeDesc child = exprNodeDesc.getChildren().get(0);
if (isDecimalFamily(child.getTypeString())) {
return checkExprNodeDescForDecimal64(child);
}
return true;
}
// We have a class-level annotation that says whether the UDF's vectorization expressions
Expand Down
9 changes: 9 additions & 0 deletions ql/src/test/queries/clientpositive/cast_decimal_vectorized.q
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CREATE TABLE test_stats0 (e decimal(38,10)) stored as orc;
insert into test_stats0 (e) values (0.0);

set hive.vectorized.execution.enabled=false;
select count(*) from test_stats0 where CAST(e as DECIMAL(15,1)) BETWEEN 100.0 AND 1000.0;


set hive.vectorized.execution.enabled=true;
select count(*) from test_stats0 where CAST(e as DECIMAL(15,1)) BETWEEN 100.0 AND 1000.0;
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
PREHOOK: query: CREATE TABLE test_stats0 (e decimal(38,10)) stored as orc
PREHOOK: type: CREATETABLE
PREHOOK: Output: database:default
PREHOOK: Output: default@test_stats0
POSTHOOK: query: CREATE TABLE test_stats0 (e decimal(38,10)) stored as orc
POSTHOOK: type: CREATETABLE
POSTHOOK: Output: database:default
POSTHOOK: Output: default@test_stats0
PREHOOK: query: insert into test_stats0 (e) values (0.0)
PREHOOK: type: QUERY
PREHOOK: Input: _dummy_database@_dummy_table
PREHOOK: Output: default@test_stats0
POSTHOOK: query: insert into test_stats0 (e) values (0.0)
POSTHOOK: type: QUERY
POSTHOOK: Input: _dummy_database@_dummy_table
POSTHOOK: Output: default@test_stats0
POSTHOOK: Lineage: test_stats0.e SCRIPT []
PREHOOK: query: select count(*) from test_stats0 where CAST(e as DECIMAL(15,1)) BETWEEN 100.0 AND 1000.0
PREHOOK: type: QUERY
PREHOOK: Input: default@test_stats0
#### A masked pattern was here ####
POSTHOOK: query: select count(*) from test_stats0 where CAST(e as DECIMAL(15,1)) BETWEEN 100.0 AND 1000.0
POSTHOOK: type: QUERY
POSTHOOK: Input: default@test_stats0
#### A masked pattern was here ####
0
PREHOOK: query: select count(*) from test_stats0 where CAST(e as DECIMAL(15,1)) BETWEEN 100.0 AND 1000.0
PREHOOK: type: QUERY
PREHOOK: Input: default@test_stats0
#### A masked pattern was here ####
POSTHOOK: query: select count(*) from test_stats0 where CAST(e as DECIMAL(15,1)) BETWEEN 100.0 AND 1000.0
POSTHOOK: type: QUERY
POSTHOOK: Input: default@test_stats0
#### A masked pattern was here ####
0
Loading