apache / apache/parquet-java

Statistic and Filter need a mechanism to get customized comparator from high layer user

Ouverte
#1,810 6 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Component: Parquet Priority: Major Type: enhancement
Langage dominant
Java
Étoiles
3.1k
Forks
1.6k
Merge moyen
3 j 12 h
PR mergées (30 j)
33

Description

As discussed in HIVE-10254, we might need a customized comparator from high layer user for generating statistic when writing and applying filter when reading.

The problem is that (use Decimal type in Hive as an example):
Decimal in Hive is mapped to Binary in Parquet. When using predicate and statistic to filter values, comparing Binary values in Parquet cannot reflect the correct relationship of Decimal values in Hive. This type mapping causes 2 problems:
1. When writing Decimal column, Binary.compareTo() is used to judge and set the column statistic (min, max). The generated statistic value is not correct from a Decimal perspective.
2. When reading with Predicate (also Filter), in which the expected Decimal value is converted to Binary type, Binary.compareTo() is used to compare the expected value and column statistic value. They are Binary perspective, and also the result is not right.

We could add an interface for customized comparator, and high level user like Hive provides the comparator to Parquet, since Hive knows how to decode the binary to Decimal and compare. Then Parquet could switch between customized and original comparison method.

**Reporter**: [Dong Chen](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=dongc) / @dongc
**Assignee**: [Dong Chen](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=dongc) / @dongc
#### Related issues:
- [Parquet PPD support DECIMAL](https://issues.apache.org/jira/browse/HIVE-10254) (blocks)

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

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

Commencez par suivre le chemin de génération des statistiques pour les écritures et le chemin de comparaison des prédicats/filtres pour les lectures décrits dans l’issue, en utilisant HIVE-10254 pour le comportement de Decimal. Déterminez où un comparateur de haut niveau pourrait être fourni sans modifier le comportement de comparaison existant. Le travail est considéré comme terminé lorsque la comparaison personnalisée ordonne correctement les valeurs Decimal à la fois dans les statistiques et lors du filtrage.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
java
Domaine
data-engineering
Type d'issue
Fonctionnalité
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
25/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.