Skip to content

Conversation

@zabetak
Copy link
Member

@zabetak zabetak commented Nov 13, 2025

  1. Deprecate Strong.Policy in favor of NullPolicy
  2. Add NullPolicy.NEVER for describing operators that never return null
  3. 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.
  4. Deprecate APIs using/returning Strong.Policy
  5. Use NullPolicy mapping from RexImpTable as the primary source of truth
  6. Modify NullPolicy for IsXx, NOT, and CAST operators in RexImpTable to be aligned with desired behavior
  7. Define fallback mapping using SqlKind in Strong.Policy for projects that define their own operators (most likely will drop that)
  8. Hardcode policy for some operators not defined in RexImpTable failing the assertion in SqlOperator#getNullPolicy
  9. 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.

1. Deprecate Strong.Policy in favor of NullPolicy
2. Add NullPolicy.NEVER for describing operators that never return null
3. 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.
4. Deprecate APIs using/returning Strong.Policy
5. Use NullPolicy mapping from RexImpTable as the primary source of truth
6. Modify NullPolicy for IsXx, NOT, and CAST operators in RexImpTable to be aligned with desired behavior
7. Define fallback mapping using SqlKind in Strong.Policy for projects that define their own operators (most likely will drop that)
8. Hardcode policy for some operators not defined in RexImpTable failing the assertion in SqlOperator#getNullPolicy
9. 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.
@mihaibudiu
Copy link
Contributor

This is draft, please ask for a review when you think it's ready for review.

@sonarqubecloud
Copy link

@github-actions
Copy link

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 dev@calcite.apache.org list. Thank you for your contributions.

@github-actions github-actions bot added the stale label Dec 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants