Allow empty row in parquet file
- 主要语言
- Java
- 星标
- 3.1k
- 派生
- 1.6k
- 平均合并
- 3 天 12 小时
- 30 天内合并 PR
- 33
描述
PARQUET-1851 starts abandon to write parquet files with schema (meta information), but with 0 rows, aka empty files.
In result it prevent to store empty tables in DRILL by using parquet files, for example:
```java
CREATE TABLE dfs.tmp.%s AS SELECT * FROM cp.`employee.json` WHERE 1=0
```
```java
CREATE TABLE dfs.tmp.%s AS select * from dfs.`parquet/alltypes_required.parquet` where `col_int` = 0
```
```java
create table dfs.tmp.%s as select * from dfs.`parquet/empty/complex/empty_complex.parquet`
```
So PARQUET-1851 breaks the following test cases:
```java
TestUntypedNull.testParquetTableCreation TestParquetWriterEmptyFiles.testComplexEmptyFileSchema TestParquetWriterEmptyFiles.testWriteEmptyFile TestParquetWriterEmptyFiles.testWriteEmptyFileWithSchema TestParquetWriterEmptyFiles.testWriteEmptySchemaChange TestMetastoreCommands.testAnalyzeEmptyRequiredParquetTable TestMetastoreCommands.testSelectEmptyRequiredParquetTable
```
I suggest to use warning in the process of creating empty parquet files or create alternative _endBlock_ for backward compatibility with other tools:

**Reporter**: [Vitalii Diravka](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=vitalii) / @vdiravka
#### Related issues:
- [Error: SYSTEM ERROR: RuntimeException: Unknown logical type ](https://issues.apache.org/jira/browse/DRILL-7825) (Is contained by)
- [Replace ParquetFileWriter in Drill with parquet version](https://issues.apache.org/jira/browse/DRILL-7907) (Is contained by)
- [ParquetMetadataConveter throws NPE in an Iceberg unit test](https://github.com/apache/parquet-java/issues/2487) (is broken by)
- [Error: SYSTEM ERROR: RuntimeException: Unknown logical type ](https://issues.apache.org/jira/browse/DRILL-7825) (is required by)
#### Original Issue Attachments:
- [Screenshot from 2021-04-13 08-52-56.png](https://issues.apache.org/jira/secure/attachment/13023747/Screenshot+from+2021-04-13+08-52-56.png)
**Note**: *This issue was originally created as [PARQUET-2026](https://issues.apache.org/jira/browse/PARQUET-2026). Please see the [migration documentation](https://issues.apache.org/jira/browse/PARQUET-2502) for further details.*
贡献指南
这个仓库没有索引到贡献指南
调研方向
首先运行列出的测试,包括 TestParquetWriterEmptyFiles.testWriteEmptyFile 和 testWriteEmptyFileWithSchema,以及 Drill metastore 测试。跟踪空文件写入路径,并将其行为与列出的 PARQUET-1851 回归进行比较。当空 Parquet 文件保留可用的 schema 元数据,并且所有列出的测试都通过且不破坏与其他工具的兼容性时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java
- 领域
- data-engineering
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100