calcite
calcite copied to clipboard
[CALCITE-4099] Unify Strong.Policy and NullPolicy
- Deprecate Strong.Policy in favor of NullPolicy
- Add NullPolicy.NEVER for describing operators that never return null
- Replace Strong.Policy with NullPolicy using the following mapping: Strong.Policy.ANY -> NullPolicy.STRICT Strong.Policy.AS_IS -> NullPolicy.NONE Strong.Policy.CUSTOM -> NullPolicy.NONE Strong.Policy.NOT_NULL -> NullPolicy.NEVER essentially AS_IS and CUSTOM are now handled in the same way.
- Deprecate APIs using/returning Strong.Policy
- Use NullPolicy mapping from RexImpTable as the primary source of truth
- Modify NullPolicy for IsXx, NOT, and CAST operators in RexImpTable to be aligned with desired behavior
- Define fallback mapping using SqlKind in Strong.Policy for projects that define their own operators (most likely will drop that)
- Hardcode policy for some operators not defined in RexImpTable failing the assertion in SqlOperator#getNullPolicy
- Update plan/sql in JdbcAdapterTest#testUnknownColumn which changes from LEFT JOIN to INNER JOIN due FilterJoinRule and in particular RelOptUtil#simplifyJoin since the CONCAT operator is now defined as STRICT so we can infer that the filter would reject nulls and thus we are able to simplify.
This is draft, please ask for a review when you think it's ready for review.
Quality Gate passed
Issues
123 New issues
0 Accepted issues
Measures
0 Security Hotspots
78.6% Coverage on New Code
0.0% Duplication on New Code
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 90 days if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the [email protected] list. Thank you for your contributions.