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

オープン
#13,203 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
clickhouse, scala
領域
backend, data

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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).

主要言語
Scala
スター
1.6k
フォーク
685
平均マージ
4日 16時間
マージ済み PR(30日)
84

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/gluten のほかの issue

apache/gluten の issue をすべて見る

似ている issue

Scala の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。