4paradigm / 4paradigm/OpenMLDB
load results are different in two load_mode
- 主要语言
- C++
- 星标
- 1.7k
- 派生
- 331
- 平均合并
- 12 天 12 小时
- 30 天内合并 PR
- 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