4paradigm / 4paradigm/OpenMLDB

load results are different in two load_mode

オープン
#3,015 コメント 0 件 リアクション 0 件 担当者 1 名 @vagetablechicken が担当を希望しています GitHub で見る
batch-engine bug high-priority storage-engine
主要言語
C++
スター
1.7k
フォーク
331
平均マージ
12日 12時間
マージ済み PR(30日)
1

説明

version v0.7.1

The root cause is the way we read csv. cluster load_mode is spark, local load_mode is self-determined in https://github.com/4paradigm/OpenMLDB/blob/09540fe7f7efe36b0a0f515aa6f530e82220bb31/src/sdk/sql_cluster_router.cc#L2968

### blank value
src csv:
```
c1,c2
,
```
cluster load(online&offline) result is two `null`, local load result is two empty strings.

- [ ] local mode should be fixed later.

### quote
src csv:
```
c1,c2
,
"",""
```
load data to online in cluster load_mode, select * result is:
```
------ ------
c1 c2
------ ------
NULL NULL
------ ------

2 rows in set
```
It has an empty row, but unclear. Anyway, the first row `,` is `null, null`, and the second row `"",""` is empty string.

load data to online in local load_mode, select * result is:
```
---- ----
c1 c2
---- ----
"" ""
---- ----

2 rows in set
```
The first row `,` is empty string, and the second row is 2 double quotation marks `"",""`.

- [x] In spark 3.2.1, csv default quote is `"`, https://spark.apache.org/docs/3.2.1/sql-data-sources-csv.html. It's changed, so we should let default quote is `\0` or set local load_mode default quote to `"`(local load_mode can't do escape now).
Default quote is `"`.

- [ ] local mode can't be consistent with cluster mode, document it, fix later.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

The issue is in sql_cluster_router.cc line 2968 where load_mode is determined. Examine the CSV reading logic for cluster (spark) vs local modes, focusing on handling of blank values and quote characters. Test with the provided CSV examples to see the differing outputs. The fix involves aligning local mode's quote handling with Spark's defaults or documenting the inconsistency.

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

評価

技術スタック
spark
領域
data-engineering, databases
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

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

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