apache / apache/parquet-java

Add merge blocks command to parquet-tools

Open
#2,214 4 comments 0 reactions 0 assignees View on GitHub
Component: Java Component: Parquet Priority: Major Type: enhancement
Dominant language
Java
Stars
3.1k
Forks
1.6k
Avg merge
3d 12h
Merged PRs (30d)
33

Description

Current implementation of merge command in parquet-tools doesn't merge row groups, just places one after the other. Add API and command option to be able to merge small blocks into larger ones up to specified size limit.
###### Implementation details:

Blocks are not reordered not to break possible initial predicate pushdown optimizations.
Blocks are not divided to fit upper bound perfectly.
This is an intentional performance optimization.
This gives an opportunity to form new blocks by coping full content of smaller blocks by column, not by row.
###### Examples:
1. Input files with blocks sizes:
```java

[128 | 35], [128 | 40], [120]
```
Expected output file blocks sizes:
`merge `
```java

[128 | 35 | 128 | 40 | 120]
```
`merge -b`
```java

[128 | 35 | 128 | 40 | 120]
```
`merge -b -l 256 `
```java

[163 | 168 | 120]
```

1. Input files with blocks sizes:
```java

[128 | 35], [40], [120], [6] 
```
Expected output file blocks sizes:
`merge`
```java

[128 | 35 | 40 | 120 | 6] 
```
`merge -b`
```java

[128 | 75 | 126] 
```
`merge -b -l 256`
```java

[203 | 126]
```

**Reporter**: [Ekaterina Galieva](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=Katya) / @kgalieva
**Assignee**: [Ekaterina Galieva](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=Katya) / @kgalieva
#### PRs and other links:
- [GitHub Pull Request #512](https://github.com/apache/parquet-mr/pull/512)
- [GitHub Pull Request #621](https://github.com/apache/parquet-mr/pull/621)
- [GitHub Pull Request #775](https://github.com/apache/parquet-mr/pull/775)
- [GitHub Pull Request #512](https://github.com/apache/parquet-mr/pull/512)

**Note**: *This issue was originally created as [PARQUET-1381](https://issues.apache.org/jira/browse/PARQUET-1381). Please see the [migration documentation](https://issues.apache.org/jira/browse/PARQUET-2502) for further details.*

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the existing merge command in parquet-tools and the API used by that command. Review the linked pull requests for prior implementation context, then verify the block-size examples and command options described here; done means merge -b forms larger blocks without reordering or splitting them past the specified limit.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
cli, data-engineering
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.