Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CALCITE-5040] SqlTypeFactoryTest.testUnknownCreateWithNullabilityTypeConsistency fails #2744

Merged
merged 1 commit into from Mar 16, 2022

Conversation

julianhyde
Copy link
Contributor

[CALCITE-4872] added an UNKNOWN type that was implemented in some
places by class SqlTypeFactoryImpl.UnknownSqlType, but in others
by BasicSqlType. This would cause
SqlTypeFactoryTest.testUnknownCreateWithNullabilityTypeConsistency
to succeed or fail non-deterministically, depending on which of the
above had made it into the map of canonical type instances.

This commit solves the problem by removing class
SqlTypeFactoryImpl.UnknownSqlType and always using BasicSqlType.

…eConsistency fails

[CALCITE-4872] added an UNKNOWN type that was implemented in some
places by class SqlTypeFactoryImpl.UnknownSqlType, but in others
by BasicSqlType. This would cause
SqlTypeFactoryTest.testUnknownCreateWithNullabilityTypeConsistency
to succeed or fail non-deterministically, depending on which of the
above had made it into the map of canonical type instances.

This commit solves the problem by removing class
SqlTypeFactoryImpl.UnknownSqlType and always using BasicSqlType.
Copy link
Contributor

@NobiGo NobiGo left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@liyafan82 liyafan82 left a comment

Choose a reason for hiding this comment

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

LGTM. I tried it on my local computer, and it successfully fixed the problem.

@rubenada
Copy link
Contributor

LGTM

Copy link
Contributor

@zabetak zabetak left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for taking this on Julian!

@@ -93,7 +93,7 @@ public SqlTypeFactoryImpl(RelDataTypeSystem typeSystem) {
}

@Override public RelDataType createUnknownType() {
Copy link
Contributor

Choose a reason for hiding this comment

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

By adding UNKNOWN under SqlTypeName enum we are essentially making it a basic SQL type so we could consider deprecating and eventually removing the createUnknownType API. It's probably out of the scope of this PR but if it makes sense we could log a followup JIRA to tackle it later.

@liyafan82 liyafan82 merged commit 692b8f0 into apache:master Mar 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants