Gabriel39 opened a new issue, #70874: URL: https://github.com/apache/doris/issues/70874
### Background Parquet Bloom filters let readers reject row groups for equality and IN predicates without reading their data pages. Doris can read these filters, but its shared Parquet output writer does not currently enable them. Dictionary filtering helps low-cardinality columns; it cannot replace Bloom filters after dictionary fallback or when dictionaries are disabled. ### Current behavior OUTFILE, writable table functions, Hive and Iceberg Parquet sinks share a writer that leaves Bloom output disabled. Existing dictionary and page-index options do not enable it. ### Expected behavior `SET enable_parquet_write_bloom_filter = true` enables standard Bloom filters in newly written Parquet files. The default remains false. Enabling the writer option must preserve all rows with both Bloom reading enabled and disabled. ### Proposed design Use one forwarded session variable, transported in an optional query-options field with a false default. Enable Arrow 24's Bloom writer by physical leaf path in the shared Parquet transformer, including nested leaves, excluding BOOLEAN and legacy INT96. BOOLEAN is rejected by the SDK; INT96 remains outside this initial scope. Reuse Arrow's standard split-block, XXHASH, uncompressed serialization and physical-type hashing. Keep dictionaries enabled unless the existing dictionary option disables them; filters must work with retained dictionaries and actual dictionary overflow. Use the existing Doris query-accounted Arrow pool, with an exception boundary around SDK writes so allocation failures return a query error. A per-sink property would duplicate policy across output paths. A custom implementation would duplicate the SDK's encoding and lifecycle handling. Always-on output would impose an unnecessary cost on existing exports. ### Impact Users exporting data for equality-heavy reads can opt in per session. The shared native writer is used by OUTFILE, writable table functions, Hive and Iceberg sinks in shared-nothing and cloud deployments. ### Reproduction or evidence Unit coverage inspects standard metadata and every inserted value's physical hash, across three switch states, three dictionary modes, two format versions and one or two row groups. SQL regression exports actual files, independently parses their Thrift metadata, compares complete ordered row IDs against an independent SQL oracle, and checks the read-side Bloom pruning counter. ### Scope and non-goals This phase adds the default-off writer capability. It does not add column selection, adaptive sizing, folding, FPP/NDV knobs, benefit estimation or a separate soft per-file budget. It does not change reader filtering semantics or ORC output. ### Acceptance criteria - Absent/false options produce no Bloom metadata; true produces readable standard filters on eligible physical leaves. - Retained dictionaries, actual overflow and disabled dictionaries preserve membership and query results. - NULLs, nested leaves, decimal physical bytes, timestamps, signed zeros, NaNs and infinities remain correct within the tested writer/reader paths. - BOOLEAN/INT96 and empty-file boundaries work, and allocation/IO failures propagate while writer-owned memory is released. - Forwarding, Thrift defaults and existing page-index behavior remain covered. ### Risks and compatibility Arrow's default expected NDV is 1,048,576 and FPP is 0.05, approximately 1 MiB per eligible leaf per row group. Buffers accumulate across row groups until file close, adding CPU, memory and output size even for all-null columns. Allocations use query memory accounting and limits; users should enable the switch selectively. Older FEs omit the optional field and keep output disabled. Older BEs ignore the unknown field and cannot honor opt-in until upgraded. Readers that ignore standard Bloom metadata can still read the files. No table metadata, image or EditLog migration is required. ### Related None. -- 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]
