-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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-4392] The operation of checking types equal ignoring null can be more efficient #2256
Conversation
core/src/test/java/org/apache/calcite/sql/type/SqlTypeUtilTest.java
Outdated
Show resolved
Hide resolved
f68e982
to
430249f
Compare
type1.getFullTypeString(), | ||
type2.getFullTypeString(), | ||
expectedResult ? "equal" : "unequal"); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unequal
is not a valid word.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to 'not equal'. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another issue here is that both asserts have the same message, so it is hard to tell which fails.
I would suggest:
assertThat(
"SqlTypeUtil.equalSansNullability(typeFactory, " + type1 + ", " + type2 + "), comment: " + comment,
SqlTypeUtil.equalSansNullability(f.typeFactory, type1, type2), is(expectedResult));
assertThat(
"SqlTypeUtil.equalSansNullability(" + type1 + ", " + type2 + "), comment: " + comment,
SqlTypeUtil.equalSansNullability(type1, type2), is(expectedResult));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds reasonable. Revised accordingly. Thank you.
430249f
to
01f5fa0
Compare
RelDataType bigIntType1 = | ||
f.typeFactory.createTypeWithNullability(nullableBigIntType, false); | ||
|
||
// different types |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should a parameter to compareTypesIgnoringNullability
method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you mean the type factory should be a parameter? Revised accordingly. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean different types
should be a comment parameter rather than a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revised. Thanks for your clarification.
bd7b5f8
to
e20d5b7
Compare
…n be more efficient
e20d5b7
to
0600bba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
LGTM |
Please see https://issues.apache.org/jira/browse/CALCITE-4392