github-actions[bot] commented on code in PR #69070:
URL: https://github.com/apache/doris/pull/69070#discussion_r4270817432
##########
be/src/storage/index/zone_map/zone_map_index.h:
##########
@@ -115,14 +117,16 @@ class ZoneMapIndexWriter {
// The IndexedColumn stores serialized ZoneMapPB for each data page.
// It also create and store the segment-level zone map in the index meta so
that
// reader can prune an entire segment without reading pages.
-template <PrimitiveType Type>
+template <FieldType FT>
class TypedZoneMapIndexWriter final : public ZoneMapIndexWriter {
public:
+ // The bounds are compute-layer values, kept in the column's PrimitiveType.
+ static constexpr PrimitiveType Type =
storage_field_type_to_primitive_type(FT);
using ValType = std::conditional_t<is_string_type(Type), StringRef,
- typename
PrimitiveTypeTraits<Type>::StorageFieldType>;
+ typename
PrimitiveTypeTraits<Type>::CppType>;
Review Comment:
[P1] Materialize zone-map bounds from their compute types
`ValType` is now `DecimalV2Value` for DECIMALV2, but
`_materialize_page_minmax()` still passes it to
`Field::create_field_from_olap_value<Type>()`, whose decimal branch reads
`data.integer` and `data.fraction`. Those members belong to `decimal12_t`, so
the DECIMAL writer instantiated by `ZoneMapIndexWriter::create()` no longer
compiles. The same mismatch corrupts V1 DATE bounds: `2020-01-01` implicitly
converts to `20200101`, then `from_olap_date()` interprets it as packed OLAP
date bits, producing invalid bounds that can prune matching rows. Materialize
fixed-width bounds directly from their compute values, retaining the StringRef
conversion for strings.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]