Arrow w/ arrow_output_version produces errors with VARINT, GEOMETRY and ENUMs

Aperta
#517 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
python, sql
Ambito
data

Direzione di ricerca

Inizia eseguendo il riproduttore Python incluso nell’issue con DuckDB 1.5.4 e PyArrow, quindi traccia i percorsi di conversione Arrow utilizzati da VARINT, GEOMETRY ed ENUM con arrow_output_version abilitato. Il lavoro è completato quando tutte e tre le conversioni producono tabelle PyArrow senza l’errore “Expected 3 buffers”, mentre il comportamento predefinito segnalato rimane invariato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

needs triage
What happens?

When using arrow_output_version (documented here: https://duckdb.org/docs/current/configuration/overview), certain data types fail with a "Expected 3 buffers" error.

See below reproducer.

Output:

duckdb 1.5.4 | pyarrow 24.0.0

VARINT defaults (sv=false, aov=1.0) : OK
VARINT aov=1.4 : FAIL -> Expected 3 buffers for imported type extension<arrow.opaque[storage_type=binary, type_name=bignum, vendor_name=DuckDB]>, ArrowArray struct has 4
GEOMETRY aov=1.5 : FAIL -> Expected 3 buffers for imported type binary, ArrowArray struct has 4
ENUM sv=true + aov=1.5 : FAIL -> Expected 3 buffers for imported type string, ArrowArray struct has 4

To Reproduce
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "duckdb==1.5.4",
# "pyarrow>=22",
# ]
# ///

import duckdb
import pyarrow as pa

print(f"duckdb {duckdb.__version__} | pyarrow {pa.__version__}\n")


# VARINT/BIGNUM: defaults are fine
con = duckdb.connect()
pa.table(con.sql("SELECT (2**100)::VARINT AS v"))
print("VARINT defaults (sv=false, aov=1.0): OK")


# VARINT/BIGNUM: arrow_output_version >= 1.4 -> FAIL
con = duckdb.connect()
con.execute("SET arrow_output_version='1.4'")
try:
 pa.table(con.sql("SELECT (2**100)::VARINT AS v"))
 print("VARINT aov=1.4: OK (unexpected)")
except Exception as e:
 print(f"VARINT aov=1.4: FAIL -> {e}")


# --- GEOMETRY: arrow_output_version = 1.5 -> FAIL
con = duckdb.connect()
con.execute("INSTALL spatial")
con.execute("LOAD spatial")
con.execute("SET arrow_output_version='1.5'")
try:
 pa.table(con.sql("SELECT ST_Point(1, 2) AS g"))
 print("GEOMETRY aov=1.5: OK (unexpected)")
except Exception as e:
 print(f"GEOMETRY aov=1.5: FAIL -> {e}")


# --- ENUM: needs BOTH produce_arrow_string_view=true AND aov>=1.5 -----------
con = duckdb.connect()
con.execute("SET produce_arrow_string_view=true")
con.execute("SET arrow_output_version='1.5'")
try:
 pa.table(con.sql("SELECT 'happy'::ENUM('happy', 'sad') AS v"))
 print("ENUM sv=true + aov=1.5: OK (unexpected)")
except Exception as e:
 print(f"ENUM sv=true + aov=1.5: FAIL -> {e}")

OS:

Linux

DuckDB Package Version:

1.5.4

Python Version:

3.14

Full Name:

paultiq

Affiliation:

Iqmo

What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.

I have tested with a stable release

Did you include all relevant data sets for reproducing the issue?

Yes

Did you include all code required to reproduce the issue?
  • Yes, I have
Did you include all relevant configuration to reproduce the issue?
  • Yes, I have
Lingua principale
Python
Stelle
186
Fork
113
Merge medio
20h 58m
PR unite (30g)
11

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di duckdb/duckdb-python

Tutte le issue di duckdb/duckdb-python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.