Allow empty row in parquet file
- Ngôn ngữ chính
- Java
- Star
- 3.1k
- Fork
- 1.6k
- Merge trung bình
- 3 ngày 12 giờ
- Pull request đã merge (30 ngày)
- 33
Mô tả
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.*
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Bắt đầu bằng cách chạy các bài kiểm thử đã nêu, bao gồm TestParquetWriterEmptyFiles.testWriteEmptyFile và testWriteEmptyFileWithSchema, cùng với các bài kiểm thử metastore của Drill. Theo dõi đường đi của quá trình ghi tệp rỗng và so sánh hành vi với hồi quy PARQUET-1851 được liệt kê. Công việc được xem là hoàn tất khi các tệp Parquet rỗng vẫn giữ siêu dữ liệu schema có thể sử dụng và tất cả các bài kiểm thử đã liệt kê đều vượt qua mà không làm hỏng khả năng tương thích với các công cụ khác.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- java
- Lĩnh vực
- data-engineering
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100