[CH] The CSV sep option is ignored by the native text scan

Aperta
#13,203 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

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
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
clickhouse, scala
Ambito
backend, data

Direzione di ricerca

Read FileSourceScanExecTransformer.getProperties and compare its CSV option mapping with Spark's CSVExprUtils.toDelimiterStr; inspect the relevant CSVSuite alias test and how ClickHouse handles native text reader delimiters. Verify sep and escaped tab handling, and ensure multi-character or non-ASCII delimiters fall back rather than being misread; the issue notes the ClickHouse backend could not be run.

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

Descrizione

Backend

ClickHouse (only ClickHouse offloads CSV scans; Velox and Bolt fall back).

Bug description

FileSourceScanExecTransformer.getProperties builds the native text reader options from the CSV options, and it only forwards the legacy delimiter key. sep, which is Spark's canonical key and what spark.read.option("sep", ...) and OPTIONS (sep '|') set, is ignored, so the native reader splits on its default comma:

// file content: "a|1\nb|2\n"
spark.read.schema("c1 string, c2 int").option("sep", "|").csv(path).show()
// vanilla: (a, 1), (b, 2); ClickHouse native: c1 = "a|1", c2 = null

The same table read with delimiter '|' is correct. Spark's own "test aliases sep and encoding for delimiter and charset" in CSVSuite is excluded for ClickHouse.

Two related gaps in the same mapping:

  • Spark decodes the delimiter with CSVExprUtils.toDelimiterStr, so sep '\t' written as a backslash and a t is a tab. The raw string is forwarded, and the native reader splits on its first byte, the backslash.
  • The native reader only uses the first byte of the delimiter, so a multi-character delimiter such as || or a non-ASCII one is read wrongly instead of falling back.

The ClickHouse path was traced by reading the code; I could not run the ClickHouse backend.

Gluten version

main (2681cc9a3)

Spark version

Spark 3.5

This issue was written with the assistance of AI (Claude Opus).

Lingua principale
Scala
Stelle
1.6k
Fork
685
Merge medio
4g 16h
PR unite (30g)
84

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

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 apache/gluten

Tutte le issue di apache/gluten

Issue simili

Altre issue su Scala

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.