Skip to content

Commit

Permalink
Add an assert that there are less than 2^16 unique strings in a column
Browse files Browse the repository at this point in the history
  • Loading branch information
TomHodson committed Feb 26, 2024
1 parent 808c9a9 commit a20e1ee
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/odc/codec/CodecOptimizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,14 @@ int CodecOptimizer::setOptimalCodecs(core::MetaData& columns)
case api::STRING:
{
n = col.coder().numStrings();
if (n == 1 && col.coder().dataSizeDoubles() == 1)
ASSERT(n < 65536);
if (n == 1 && col.coder().dataSizeDoubles() == 1) {
codec = "constant_string";
else if(n < 256)
} else if(n < 256) {
codec = "int8_string";
else if(n < 65536)
} else {
codec = "int16_string";

}

std::unique_ptr<core::Codec> newCodec = core::CodecFactory::instance().build<ByteOrder>(codec, col.type());
if (codec == "constant_string") {
Expand Down

0 comments on commit a20e1ee

Please sign in to comment.