Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/paimon/file_index/file_index_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ namespace paimon {
/// `std::shared_ptr<FileIndexResult>` objects. It reads pre-built file-level index data
/// (e.g., bitmap, bsi or bloom filters) from index file and evaluates
/// whether a given data file may contain rows matching a specific predicate.
/// @note Callers of `Visit*` for DECIMAL fields must ensure each literal's scale matches the scale
/// of the indexed data; otherwise, index filtering results may be incorrect.
class PAIMON_EXPORT FileIndexReader : public FunctionVisitor<std::shared_ptr<FileIndexResult>> {
public:
Result<std::shared_ptr<FileIndexResult>> VisitIsNotNull() override;
Expand Down
2 changes: 2 additions & 0 deletions include/paimon/global_index/global_index_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ namespace paimon {
/// Derived classes are expected to implement the visitor methods (e.g., `VisitEqual`,
/// `VisitIsNull`, etc.) to return index-based results that indicate which
/// rows satisfy the given predicate.
/// @note Callers of `Visit*` for DECIMAL fields must ensure each literal's scale matches the scale
/// of the indexed data; otherwise, index filtering results may be incorrect.
class PAIMON_EXPORT GlobalIndexReader : public FunctionVisitor<std::shared_ptr<GlobalIndexResult>> {
public:
/// VisitVectorSearch performs approximate vector similarity search.
Expand Down
1 change: 1 addition & 0 deletions src/paimon/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,7 @@ if(PAIMON_BUILD_TESTS)
common/file_index/rangebitmap/dictionary/chunked_dictionary_test.cpp
common/file_index/rangebitmap/range_bitmap_file_index_test.cpp
common/file_index/rangebitmap/range_bitmap_io_test.cpp
common/file_index/rangebitmap/range_bitmap_type_adapter_test.cpp
common/file_index/bloomfilter/bloom_filter_file_index_test.cpp
common/file_index/bloomfilter/fast_hash_test.cpp
common/global_index/complete_index_score_batch_reader_test.cpp
Expand Down
4 changes: 3 additions & 1 deletion src/paimon/common/file_index/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@ set(PAIMON_FILE_INDEX_SRC
rangebitmap/dictionary/chunked_dictionary.cpp
rangebitmap/dictionary/fixed_length_chunk.cpp
rangebitmap/dictionary/key_factory.cpp
rangebitmap/dictionary/variable_length_chunk.cpp
rangebitmap/utils/literal_serialization_utils.cpp
rangebitmap/bit_slice_index_bitmap.cpp
rangebitmap/range_bitmap.cpp
rangebitmap/range_bitmap_file_index.cpp
rangebitmap/range_bitmap_file_index_factory.cpp)
rangebitmap/range_bitmap_file_index_factory.cpp
rangebitmap/range_bitmap_type_adapter.cpp)

add_paimon_lib(paimon_file_index
SOURCES
Expand Down
32 changes: 32 additions & 0 deletions src/paimon/common/file_index/bitmap/bitmap_file_index_meta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@

#include "paimon/common/file_index/bitmap/bitmap_file_index_meta.h"

#include <cstdint>
#include <string>
#include <utility>

#include "fmt/format.h"
#include "paimon/common/utils/field_type_utils.h"
#include "paimon/common/utils/math.h"
#include "paimon/defs.h"
#include "paimon/io/data_input_stream.h"
#include "paimon/memory/bytes.h"
Expand Down Expand Up @@ -80,6 +82,18 @@ Result<std::function<void(const Literal&)>> BitmapFileIndexMeta::GetValueWriter(
[output_stream](const Literal& literal) -> void {
output_stream->WriteValue<int64_t>(literal.GetValue<int64_t>());
});
case FieldType::FLOAT:
return std::function<void(const Literal&)>(
[output_stream](const Literal& literal) -> void {
const float value = CanonicalizeFloatingPoint(literal.GetValue<float>());
output_stream->WriteValue<float>(value);
});
case FieldType::DOUBLE:
return std::function<void(const Literal&)>(
[output_stream](const Literal& literal) -> void {
const double value = CanonicalizeFloatingPoint(literal.GetValue<double>());
output_stream->WriteValue<double>(value);
});
case FieldType::STRING:
return std::function<void(const Literal&)>(
[output_stream](const Literal& literal) -> void {
Expand Down Expand Up @@ -155,6 +169,24 @@ Result<std::function<Result<Literal>()>> BitmapFileIndexMeta::GetValueReader(
};
return func;
}
case FieldType::FLOAT: {
std::function<Result<Literal>()> func = [&in, move_body_start,
this]() -> Result<Literal> {
PAIMON_ASSIGN_OR_RAISE(float value,
ReadAndMoveBodyStart<float>(in, move_body_start));
return Literal(value);
};
return func;
}
case FieldType::DOUBLE: {
std::function<Result<Literal>()> func = [&in, move_body_start,
this]() -> Result<Literal> {
PAIMON_ASSIGN_OR_RAISE(double value,
ReadAndMoveBodyStart<double>(in, move_body_start));
return Literal(value);
};
return func;
}
case FieldType::DATE: {
std::function<Result<Literal>()> func = [&in, move_body_start,
this]() -> Result<Literal> {
Expand Down
Loading
Loading