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

Reuse short Char and Varchar type instances #14911

Merged
merged 3 commits into from
Nov 9, 2022

Conversation

findepi
Copy link
Member

@findepi findepi commented Nov 4, 2022

Share ("cache") instances for short char and varchar types.

@cla-bot cla-bot bot added the cla-signed label Nov 4, 2022
@findepi findepi added the no-release-notes This pull request does not require release notes entry label Nov 4, 2022
Copy link
Member

@ebyhr ebyhr left a comment

Choose a reason for hiding this comment

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

Looks good except for CI failure.

Error:    TestStringFunctions.testCharConcat:959->AbstractTestFunctions.assertInvalidFunction:124 
Expecting:
 <TYPE_NOT_FOUND:43>
to be in:
 <[INVALID_FUNCTION_ARGUMENT:7]>

@findepi
Copy link
Member Author

findepi commented Nov 7, 2022

Hopefully fixed

@findepi
Copy link
Member Author

findepi commented Nov 9, 2022

CI #14248

`TrinoException` is not appropriate there. It's higher level code's
responsibility to raise the proper `TrinoException`.
Replace `createCharType(long)` with `createCharType(int)`. `int` is very
well sufficient and also this is compatible with
`VarcharType.createVarcharType(int)`.
Share ("cache") instances for short `char` and `varchar` types.
- type instantiation can be expensive (see
  96a009e)
- it allows caching things further, like in `getRange()`.
@findepi
Copy link
Member Author

findepi commented Nov 9, 2022

(just rebased to resolve conflicts)

@findepi findepi merged commit b3aace5 into trinodb:master Nov 9, 2022
@findepi findepi deleted the findepi/cachcar branch November 9, 2022 14:13
@github-actions github-actions bot added this to the 403 milestone Nov 9, 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