Ran Tao created CALCITE-6027:
--------------------------------

             Summary: Add the rule to simplify cardinality on map_keys and 
map_values functions
                 Key: CALCITE-6027
                 URL: https://issues.apache.org/jira/browse/CALCITE-6027
             Project: Calcite
          Issue Type: New Feature
    Affects Versions: 1.35.0
            Reporter: Ran Tao


when we call cardinality on map_keys or map_values, such as:


{code:java}
select cardinality(map_keys(map['foo', 1, 'bar', 2]));
select cardinality(map_values(map['foo', 1, 'bar', 2]));{code}
they can be simplified to
{code:java}
select cardinality(map['foo', 1, 'bar', 2]);
select cardinality(map['foo', 1, 'bar', 2]); {code}
 

Some other mature engines such as presto has same optimized rule.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to