Skip to content

[python] Fix/scalar global index search mode default#8844

Draft
XiaoHongbo-Hope wants to merge 2 commits into
apache:masterfrom
XiaoHongbo-Hope:fix/scalar-global-index-search-mode-default
Draft

[python] Fix/scalar global index search mode default#8844
XiaoHongbo-Hope wants to merge 2 commits into
apache:masterfrom
XiaoHongbo-Hope:fix/scalar-global-index-search-mode-default

Conversation

@XiaoHongbo-Hope

Copy link
Copy Markdown
Contributor

Purpose

Tests

@XiaoHongbo-Hope
XiaoHongbo-Hope force-pushed the fix/scalar-global-index-search-mode-default branch 4 times, most recently from d0b4849 to 4eefdda Compare July 24, 2026 11:28
…nt row loss

Scalar (sorted/bitmap) global-index queries used the vector/full-text
`global-index.search-mode` = fast, which returns no unindexed ranges, so rows
committed but not yet covered by the index were pruned before being read and
`WHERE <indexed_col> = X` silently returned incomplete results.

- Add `scalar-index.search-mode` (default `full`). Resolution priority:
  explicit `scalar-index.search-mode` -> an explicit `global-index.search-mode`
  (inherited) -> default `full`.
- Thread an optional `search_mode` through DataEvolutionGlobalIndexCoverage
  and DataEvolutionGlobalIndexScanner.unindexed_rows.
- Only the pure scalar scan (file_scanner) passes the scalar mode. Vector /
  full-text callers leave it unset and keep the fast default, so a vector scan
  with a scalar filter is not widened into a full-table brute-force scan.
…rrowNotImplementedError

Reading a projected VARIANT column (struct<value, metadata>) from a Parquet file
with multiple row groups failed with "Nested data conversions not implemented
for chunked array outputs": a single dataset scanner assembles the nested column
across row groups (and pages) into one ChunkedArray, which is unimplemented.

For a multi-row-group Parquet file with a projected VARIANT column,
FormatPyArrowReader reads row groups via ParquetFile (which avoids that
assembly), keeping:
- column pruning: reads only projected columns plus filter-only columns, which
  are threaded from SplitRead and dropped from the result after filtering;
- row-group pruning: excludes row groups by statistics via fragment metadata;
- predicate: applied per row group through an in-memory dataset scanner, not
  Table.filter(Expression) (rejected by older PyArrow).

The ParquetFile is opened via the filesystem's file handle rather than the
`filesystem=` kwarg (unsupported on PyArrow 6.0.1). Scalar-only / single-row-group
reads keep the original whole-file scanner. Verified on PyArrow 19.0.1 against a
real 140 MB / 2-row-group table.
@XiaoHongbo-Hope
XiaoHongbo-Hope force-pushed the fix/scalar-global-index-search-mode-default branch from 4eefdda to fb38ba0 Compare July 24, 2026 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants