apache / apache/parquet-java

Add filter null check for ColumnIndex

Abierto
#2,517 6 comentarios 0 reacciones 0 asignados Ver en GitHub
Component: Java Component: Parquet Priority: Major Type: bug
Lenguaje dominante
Java
Estrellas
3.1k
Forks
1.6k
Merge medio
3 d 12 h
PR fusionados (30 d)
33

Descripción

This Jira is opened for discussion that should we add null checking for the filter when ColumnIndex is enabled.

In the ColumnIndexFilter#calculateRowRanges() method, the input parameter 'filter' is assumed to be non-null without checking. It throws NPE when ColumnIndex is enabled(by default) but there is no filter set in the ParquetReadOptions. The call stack is as below.
java.lang.NullPointerException
at org.apache.parquet.internal.filter2.columnindex.ColumnIndexFilter.calculateRowRanges(ColumnIndexFilter.java:81)
at org.apache.parquet.hadoop.ParquetFileReader.getRowRanges(ParquetFileReader.java:961)
at org.apache.parquet.hadoop.ParquetFileReader.readNextFilteredRowGroup(ParquetFileReader.java:891)

If we don't add, the user might need to choose to call readNextRowGroup() or readFilteredNextRowGroup() accordingly based on filter existence.

Thoughts?

**Reporter**: [Xinli Shang](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=shangx@uber.com) / @shangxinli
**Assignee**: [Xinli Shang](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=shangx@uber.com) / @shangxinli

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

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Comienza por org.apache.parquet.internal.filter2.columnindex.ColumnIndexFilter.calculateRowRanges() en ColumnIndexFilter.java:81 y luego sigue las llamadas desde ParquetFileReader.getRowRanges() y readNextFilteredRowGroup(). Reproduce el caso sin filtro con ColumnIndex habilitado y verifica que el manejo de un filtro ausente ya no provoque la NullPointerException reportada.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
java
Área
data-engineering
Tipo de issue
Error
Dificultad
2/5
Tiempo estimado
1-3 horas
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.