calcite icon indicating copy to clipboard operation
calcite copied to clipboard

[CALCITE-4982] NonNull field is pushed down into leaf of outer-join in 'ProjectJoinTransposeRule'

Open wojustme opened this issue 4 years ago • 4 comments

This pr is prepared for ISSUE-4982

wojustme avatar Jan 11 '22 09:01 wojustme

Hi @NobiGo Are you going on reviewing this pr?

wojustme avatar Mar 28 '22 12:03 wojustme

What's the status of this PR?

libenchao avatar Aug 21 '22 07:08 libenchao

@libenchao Thank you for reminding me, and I almost forgot this issue. I will update this pr as soon as possible.

wojustme avatar Aug 23 '22 08:08 wojustme

@libenchao This issue/pr was so long that it took me a little time to review it. Two solutions:

  1. Avoid pushing down with the operand of coalesce's operator
  2. Keep pushing down, and fix org.apache.calcite.plan.Strong#policy(org.apache.calcite.rex.RexNode)

Let's discuss in the JIRA

wojustme avatar Oct 10 '22 09:10 wojustme

Add default config: PreserveExprCondition Shouldn't push non-null field, which is wrapped by CAST's operator. Hi @libenchao Please review this pr again, thanks a lot.

wojustme avatar Oct 19 '22 08:10 wojustme

In my opinion, this case only works on in CALCITE's optimizer or validator, which some expresion only change nullable attribute. we couldn't write an sql cast(c1 as not integer), and we only write an sql cast(c1 as integer).

This pr will fix the issue with a little modification. Maybe we get a good solution from the discussion of CALCITE-5315.

wojustme avatar Oct 24 '22 12:10 wojustme

Hi @libenchao PR is ready, and could you take your time to review it again, thanks.

wojustme avatar Oct 25 '22 07:10 wojustme

fixed via https://github.com/apache/calcite/commit/43db14cf8e08230c309eeb425a568e77db964a46

libenchao avatar Nov 05 '22 08:11 libenchao