Allow empty row in parquet file
- Vorherrschende Sprache
- Java
- Sterne
- 3.1k
- Forks
- 1.6k
- Ø Merge
- 3 T. 12 Std.
- Gemergte PRs (30 T.)
- 33
Beschreibung
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.*
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Beginne damit, die genannten Tests auszuführen, einschließlich TestParquetWriterEmptyFiles.testWriteEmptyFile und testWriteEmptyFileWithSchema sowie der Drill-metastore-Tests. Verfolge den Pfad zum Schreiben leerer Dateien und vergleiche das Verhalten mit der aufgeführten Regression PARQUET-1851. Als abgeschlossen gilt die Aufgabe, wenn leere Parquet-Dateien weiterhin nutzbare Schema-Metadaten enthalten und alle aufgeführten Tests bestehen, ohne die Kompatibilität mit anderen Tools zu beeinträchtigen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java
- Bereich
- data-engineering
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100