Skip to content

Bulk skip in RunLengthBitPackingHybridDecoder / DictionaryValuesReader #3772

Description

@abstractdog

Motivation

Make Hive leverage bulk skip when implementing probe decode for Parquet, similarly to https://issues.apache.org/jira/browse/HIVE-22731, which was about ORC.

Problem

ValuesReader.skip(int n) ships with a naive default:

public void skip(int n) {
  for (int i = 0; i < n; i++) skip();
}

For dictionary-encoded columns (the common case), each skip() bottoms
out in RunLengthBitPackingHybridDecoder.readInt() — a mode switch,
array-index arithmetic, and a value the caller immediately discards.

Any filter-then-skip path (column-index row ranges, hash-join probe
filtering, runtime filters) pays this cost per skipped row.

Proposal

  1. Add RunLengthBitPackingHybridDecoder.skipInts(int n) — re-use
    readNext() per run, then advance currentCount by
    min(n, currentCount) instead of walking every value through
    readInt().
  2. Override skip(int) on DictionaryValuesReader and
    RunLengthBitPackingHybridValuesReader to call decoder.skipInts(n).

Component(s)

Core

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions