-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Test and fix cast from bigint to varchar #10090
Conversation
The used values 37 and 0 were interpreted as Integer, and so the operators for the Integer type were used instead of the operators for the Bigint type.
f126f15
to
85a942b
Compare
@@ -331,6 +332,13 @@ public void assertInvalidFunction(String projection, ErrorCodeSupplier expectedE | |||
.hasErrorCode(expectedErrorCode); | |||
} | |||
|
|||
public void assertInvalidFunction(String projection, Class<? extends Throwable> throwableClass, String message) |
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.
It's never legitimate that a function throws something else than TrinoException, isn't it?
I understand why this is useful for interim state when fixing things, but i wonder how we can convey that intention to future users of this assert. assertFunctionThrowsIncorrectly
? Mark @deprecated
?
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.
add @Language("SQL")
on projection
and @Language("RegExp")
on message
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 decided on renaming both methods to assertFunctionThrowsIncorrectly
.
The initial idea was to remove them altogether after casts to varchar are fixed, but we might actually consider keeping them for future use.
core/trino-main/src/test/java/io/trino/operator/scalar/AbstractTestFunctions.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/test/java/io/trino/sql/TestExpressionInterpreter.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/type/BigintOperators.java
Outdated
Show resolved
Hide resolved
Enable testing functions which throw an exception other than TrinoException.
Fail if the resulting string does not fit in the bounded length of the varchar type.
85a942b
to
f9aba95
Compare
@findepi ac |
Cherry-pick of trinodb/trino#10090 Co-authored-by: kasiafi <[email protected]>
Cherry-pick of trinodb/trino#10090 Co-authored-by: kasiafi <[email protected]>
For #552