什么格式适用于 Hive LazySimpleSerDe

What format applies to the Hive LazySimpleSerDe

Hive LazySimpleSerDe 的格式到底是什么? 像 ParquetHiveSerDe 这样的格式告诉我 Hive 将读取 parquet 格式的 HDFS 文件。

但是 LazySimpleSerDe 是什么?鉴于 LazySimpleSerDe 用于分隔文件,为什么不明确地称它为 CommaSepHiveSerDeTabSepHiveSerDe

LasySimpleSerde - 快速简单的 SerDe,它不识别引用值,虽然它可以使用不同的分隔符,不仅是逗号,默认是 TAB(\t).您可以在 table DDL 中指定 STORED AS TEXTFILE,然后将使用 LasySimpleSerDe。对于带引号的值,使用 ,它不如 LasySimpleSerDe 快,但可以正确处理带引号的值。

LasySimpleSerDe 在性能方面很简单,它也以惰性方式创建对象,以提供更好的性能,这就是为什么它在可能的情况下更可取(对于文本文件)。

查看此示例,使用竖线分隔 (|) 文件格式:

show create table 这样的 table 命令将 serde class 打印为 org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe,STORED AS TEXTFILE 是 .