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

Improve conversion to domain #7754

Merged
merged 4 commits into from
Apr 27, 2021
Merged

Conversation

findepi
Copy link
Member

@findepi findepi commented Apr 26, 2021

No description provided.

For example when providing values to a `BIGINT`-based `ValueSet`, one
should be able to pass a `List<Long>` as values.
@findepi findepi requested review from losipiuk and aalbu April 26, 2021 20:44
@cla-bot cla-bot bot added the cla-signed label Apr 26, 2021
@findepi

This comment has been minimized.

@findepi
Copy link
Member Author

findepi commented Apr 26, 2021

CI #7755

@@ -308,56 +308,51 @@ public static Domain getDomain(Type type, DictionaryDescriptor dictionaryDescrip

int dictionarySize = dictionaryPage.get().getDictionarySize();
if (type.equals(BIGINT) && columnDescriptor.getPrimitiveType().getPrimitiveTypeName() == PrimitiveTypeName.INT64) {
List<Domain> domains = new ArrayList<>();
List<Long> values = new ArrayList<>();
Copy link
Member

Choose a reason for hiding this comment

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

If this is the bottleneck then maybe long[] will be faster.

Copy link
Member Author

Choose a reason for hiding this comment

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

ValueSet constructor currently does accept primitive arrays.

however, i will at least preallocate the list to the required size, since it's well known.

This fixes a performance regression introduced by
82e8f93.
Copy link
Member

@aalbu aalbu left a comment

Choose a reason for hiding this comment

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

Nice

@findepi findepi merged commit d39da66 into trinodb:master Apr 27, 2021
@findepi findepi deleted the findepi/parpred branch April 27, 2021 13:57
@findepi findepi added this to the 356 milestone Apr 27, 2021
@findepi findepi mentioned this pull request Apr 27, 2021
9 tasks
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.

4 participants