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

Test and fix cast from bigint to varchar #10090

Merged
merged 5 commits into from
Dec 1, 2021

Conversation

kasiafi
Copy link
Member

@kasiafi kasiafi commented Nov 28, 2021

For #552

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.
@cla-bot cla-bot bot added the cla-signed label Nov 28, 2021
@kasiafi kasiafi force-pushed the 290CastToVarchar branch 2 times, most recently from f126f15 to 85a942b Compare November 28, 2021 13:38
@@ -331,6 +332,13 @@ public void assertInvalidFunction(String projection, ErrorCodeSupplier expectedE
.hasErrorCode(expectedErrorCode);
}

public void assertInvalidFunction(String projection, Class<? extends Throwable> throwableClass, String message)
Copy link
Member

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?

Copy link
Member

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

Copy link
Member Author

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.

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.
@kasiafi
Copy link
Member Author

kasiafi commented Dec 1, 2021

@findepi ac

@kasiafi kasiafi merged commit 4874232 into trinodb:master Dec 1, 2021
@kasiafi kasiafi mentioned this pull request Dec 1, 2021
12 tasks
@github-actions github-actions bot added this to the 365 milestone Dec 1, 2021
@kasiafi kasiafi mentioned this pull request Dec 14, 2021
10 tasks
v-jizhang added a commit to v-jizhang/presto that referenced this pull request Feb 3, 2022
highker pushed a commit to prestodb/presto that referenced this pull request Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants