Yu Xu created CALCITE-6982: ------------------------------ Summary: Removes cast from string also support in IS_NULL/IS_NOT_NULL Key: CALCITE-6982 URL: https://issues.apache.org/jira/browse/CALCITE-6982 Project: Calcite Issue Type: Improvement Components: core Affects Versions: 1.39.0 Reporter: Yu Xu Assignee: Yu Xu Fix For: 1.40.0
SQL {code:java} select \"employee_id\" from \"foodmart\".\"employee\" where 10 is distinct from cast('10' as int){code} would covert to {code:java} SELECT \"employee_id\"\nFROM \"foodmart\".\"employee\"\nWHERE (10 IS NOT NULL OR CAST('10' AS INTEGER) IS NOT NULL) AND 10 = '10' IS NOT TRUE {code} here CAST('10' AS INTEGER) IS NOT NULL : cast is not necessary should convert to: {code:java} SELECT \"employee_id\"\n FROM \"foodmart\".\"employee\"\n WHERE (10 IS NOT NULL OR '10' IS NOT NULL) AND 10 = '10' IS NOT TRUE{code} -- This message was sent by Atlassian Jira (v8.20.10#820010)