You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Account for null rows in Parquet dictionary-cache profitability #12115
The dictionary-cache profitability check added in #11982 calls:
use_dictionary_cache(dictionary, values.len())
values.len() includes null rows, but write_gather only encodes the gathered dictionary indices. For a highly nullable dictionary array, a new cache with one slot per dictionary value can therefore pass the gate even when very few, or no, non-null values will use it. This can allocate approximately 8 * dictionary.len() bytes without enough encoded rows to amortize the cache.
Expected behavior
The profitability decision for a new dictionary cache should account for the rows that can actually use the cache, while preserving reuse of an existing cache for the same dictionary values.
The exact policy still needs design. Possible inputs include the gathered indices and dictionary-key validity, without adding an expensive scan that erases the optimization's benefit.
Activity
Use non-null value counts for Parquet dictionary caches (apache#12122)