Skip to content

Re-enable comparison type match check in DomainTranslator#13561

Merged
findepi merged 4 commits intotrinodb:masterfrom
findepi:findepi/re-enable-comparison-type-match-check-in-domaintranslator-a32c44
Aug 23, 2022
Merged

Re-enable comparison type match check in DomainTranslator#13561
findepi merged 4 commits intotrinodb:masterfrom
findepi:findepi/re-enable-comparison-type-match-check-in-domaintranslator-a32c44

Conversation

@findepi
Copy link
Copy Markdown
Member

@findepi findepi commented Aug 9, 2022

It was temporarily disabled in March 2017 in commit
a103a63.

@findepi findepi added the no-release-notes This pull request does not require release notes entry label Aug 9, 2022
@cla-bot cla-bot bot added the cla-signed label Aug 9, 2022
@findepi findepi force-pushed the findepi/re-enable-comparison-type-match-check-in-domaintranslator-a32c44 branch from e815f3c to 1591d93 Compare August 9, 2022 14:02
Plan tests should take well-formed plan nodes as input. In plan nodes,
the contained expressions should have all correct types (should not
require any coercions, which are attribute of the SQL language and its
processing, do not belong to plan nodes' world).
It was temporarily disabled in March 2017 in commit
a103a63.
@findepi findepi force-pushed the findepi/re-enable-comparison-type-match-check-in-domaintranslator-a32c44 branch from 1591d93 to 025ccc2 Compare August 10, 2022 08:47
Type leftType = expressionTypes.get(NodeRef.of(comparison.getLeft()));
Type rightType = expressionTypes.get(NodeRef.of(comparison.getRight()));

// TODO: re-enable this check once we fix the type coercions in the optimizers
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when this was fixed...?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR fixes some tests. I don't know whether there were any other fixes related to this.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, but this change is not in tests, but in product

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. The check is sound. The tests say it should be fine. What else can I do?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was check disabled in the first place and what fixed it so that we can enable it again? Was it only tests?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The check was introduced by @losipiuk in 03f5942
and disabled by @erichwang in a103a63.
Eric made it clear that the check is disabled temporarily.

The check is sound and important for reasoning about optimizers, we rely on comparison's sides being same type in many places. We shouldn't be afraid of enabling the check here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, but what changed so that a103a63 is no longer relevant?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was over 5 years ago. i think it will be hard to find out.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it have potential to cause regressions?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely! (as pretty much any other change in the production code base)

@findepi findepi requested review from sopel39 and removed request for sopel39 August 11, 2022 09:37
@findepi
Copy link
Copy Markdown
Member Author

findepi commented Aug 22, 2022

@sopel39 PTAL

@findepi findepi merged commit 9888b84 into trinodb:master Aug 23, 2022
@github-actions github-actions bot added this to the 394 milestone Aug 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed no-release-notes This pull request does not require release notes entry

Development

Successfully merging this pull request may close these issues.

3 participants