FasterXML / FasterXML/jackson-dataformats-text

CSV: Support for Map and Nested fields

未关闭
#211 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
csv to-evaluate
主要语言
Java
星标
455
派生
164
平均合并
6 天 10 小时
30 天内合并 PR
2

描述

Use Case: reading/writing 'complex' CSV files interoperable with Athena / Presto / Hive

Example: a 'serde' for CSV from Hive (or athena or presto ) can support the following attributes

```
row format delimited
fields terminated by ','
collection items terminated by '|'
map keys terminated by '#'

```
In addition to the above is a built in (not customizable) support for nested collections which are deliminated by 'level' with a different delimiter per level -- enabling representing [ 1 , [2,3, { "a": [ 4 ] ]

Currently the array element separator provides part of this
A useful addition would a 'map' seperator that would work like the arrays but create json Objects.

example:
```
FIELDS=,
ARRAY=|
MAP=#

1,2|3|4,key#value|key2#value2|key3#value3,four

could map to the java class

class Complex {
int col1;
int col2[];
innerclass col3 ;
String col4;
}

class innerclass {
String key ;
String key2;
String key3;
}

```

Nested requires 'levels' of both array and map separators.

Hive Reference
https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-CreateTableCreate/Drop/TruncateTable

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。