Skip to content

Commit

Permalink
add support for ColumnConfig skipValueRangeIndexScale and skipValueRa…
Browse files Browse the repository at this point in the history
…ngeIndexScale to traditional string columns
  • Loading branch information
clintropolis committed Dec 13, 2023
1 parent 4ec9a0a commit c321d1c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -319,12 +319,27 @@ public void read(ByteBuffer buffer, ColumnBuilder builder, ColumnConfig columnCo
final WritableSupplier<ColumnarInts> rSingleValuedColumn;
final WritableSupplier<ColumnarMultiInts> rMultiValuedColumn;

final int numRows;
if (hasMultipleValues) {
rMultiValuedColumn = readMultiValuedColumn(rVersion, buffer, rFlags);
rSingleValuedColumn = null;
// wtb: better way to have number of rows in segment, maybe just passed into all the read methods
try (ColumnarMultiInts throwAway = rMultiValuedColumn.get()) {
numRows = throwAway.size();
}
catch (IOException e) {
throw new RuntimeException(e);
}
} else {
rSingleValuedColumn = readSingleValuedColumn(rVersion, buffer);
rMultiValuedColumn = null;
// wtb: better way to have number of rows in segment, maybe just passed into all the read methods
try (ColumnarInts throwAway = rSingleValuedColumn.get()) {
numRows = throwAway.size();
}
catch (IOException e) {
throw new RuntimeException(e);
}
}

final boolean hasNulls = dictionarySupplier.get().get(0) == null;
Expand Down Expand Up @@ -360,7 +375,9 @@ public void read(ByteBuffer buffer, ColumnBuilder builder, ColumnConfig columnCo
bitmapSerdeFactory.getBitmapFactory(),
dictionarySupplier,
rBitmaps,
rSpatialIndex
rSpatialIndex,
columnConfig,
numRows
),
rBitmaps != null,
rSpatialIndex != null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ public class StringUtf8ColumnIndexSupplier<TIndexed extends Indexed<ByteBuffer>>
private final ColumnConfig columnConfig;
private final int numRows;

/**
* Legacy constructor which always uses bitmap indexes, sparing no expense (ignores the configurable range and
* predicate indexes thresholds on {@link ColumnConfig}, in favor of using {@link ColumnConfig#ALWAYS_USE_INDEXES}).
*/
public StringUtf8ColumnIndexSupplier(
BitmapFactory bitmapFactory,
Supplier<TIndexed> utf8Dictionary,
Expand All @@ -77,7 +81,7 @@ public StringUtf8ColumnIndexSupplier(
Supplier<TIndexed> utf8Dictionary,
@Nullable GenericIndexed<ImmutableBitmap> bitmaps,
@Nullable ImmutableRTree indexedTree,
@Nullable ColumnConfig columnConfig,
ColumnConfig columnConfig,
int numRows
)
{
Expand Down

0 comments on commit c321d1c

Please sign in to comment.