Hankó Gergely created HIVE-26552: ------------------------------------ Summary: PartitionConditionRemover doesn't remove constant filter with structs inside Key: HIVE-26552 URL: https://issues.apache.org/jira/browse/HIVE-26552 Project: Hive Issue Type: Improvement Reporter: Hankó Gergely
Repro: {code:java} set hive.fetch.task.conversion=none; create table test (a string) partitioned by (y string, m string); insert into test values ('aa', 2022, 9); explain vectorization expression select * from test where (y=year(date_sub('2022-09-11',4)) and m=month(date_sub('2022-09-11',4))) or (y=year(date_sub('2022-09-11',10)) and m=month(date_sub('2022-09-11',10)) ); {code} Actual: {code:java} Filter Operator Filter Vectorization: className: VectorFilterOperator native: true predicateExpression: SelectColumnIsTrue(col 5:boolean)(children: VectorUDFAdaptor((const struct(2022.0D,9.0D)) IN (const struct(2022.0D,9.0D), const struct(2022.0D,9.0D))) -> 5:boolean) predicate: (const struct(2022.0D,9.0D)) IN (const struct(2022.0D,9.0D), const struct(2022.0D,9.0D)) (type: boolean) Statistics: Num rows: 1 Data size: 454 Basic stats: COMPLETE Column stats: COMPLETE {code} Expected: The filter operator should be optimized out similarly as it is removed in the following query: {code:java} explain vectorization expression select * from test where (y=year(date_sub('2022-09-11',4))) or (y=year(date_sub('2022-09-11',10))); {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)