Skip to content
This repository was archived by the owner on May 9, 2024. It is now read-only.

Remove implicit cast to size_t #634

Merged
merged 2 commits into from
Aug 17, 2023
Merged

Remove implicit cast to size_t #634

merged 2 commits into from
Aug 17, 2023

Conversation

kurapov-peter
Copy link
Contributor

No description provided.

@ienkovich
Copy link
Contributor

Looks like this reveals a bug of get_bit_width usage with varlen array types.

@@ -116,7 +116,7 @@ int64_t get_agg_initial_val(hdk::ir::AggType agg,
CHECK(!(type->isString() || type->isExtDictionary()) ||
(agg == hdk::ir::AggType::kSingleValue || agg == hdk::ir::AggType::kSample));
const auto byte_width =
enable_compaction
enable_compaction && type->size() > 0
Copy link
Contributor

Choose a reason for hiding this comment

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

I am surprised this didn't cause errors earlier - is it possible for enable_compaction to ever be true here?

Copy link
Contributor

Choose a reason for hiding this comment

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

Varlen aggregate type is used for TopK aggregate only. And in the code below we simply don't use byte_width for the TopK case.

Copy link
Contributor

Choose a reason for hiding this comment

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

Varlen aggregate should also work for SAMPLE(varlen_type), though in that case the aggregation was a hack (we would just place the rowid of the chosen row in the aggregate slot)

@kurapov-peter kurapov-peter merged commit d64d4f6 into main Aug 17, 2023
@kurapov-peter kurapov-peter deleted the kurapov-peter-patch-1 branch August 17, 2023 09:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants