[Bug] range-bitmap file index: IS NULL returns only the first and last row when a column is entirely NULL in a file
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 88/100
Línea de trabajo
Comienza en org.apache.paimon.fileindex.rangebitmap.RangeBitmap#isNull e inspecciona la rama cardinality <= 0. Ejecuta la reproducción proporcionada de la Java API con cinco valores completamente NULL; se considera terminado cuando c IS NULL devuelve las cinco filas, con cobertura de regresión para el caso de range-bitmap.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Search before asking
- I searched in the issues and found nothing similar.
Paimon version
2.0.0 (paimon-bundle-2.0.0)
Compute Engine
None — reproduced with the Java API (ReadBuilder.withFilter), local filesystem catalog, Java 21.
Minimal reproduce step
Create an append table with a range-bitmap file index on c, write 5 rows where c is NULL in every row, then read with c IS NULL:
Identifier id = Identifier.create("db", "t_isnull");
catalog.createTable(
id,
Schema.newBuilder()
.column("id", DataTypes.INT())
.column("c", DataTypes.INT())
.option("file-index.range-bitmap.columns", "c")
.build(),
false);
Table table = catalog.getTable(id);
List<GenericRow> rows = new ArrayList<>();
for (int i = 0; i < 5; i++) {
rows.add(GenericRow.of(i, null));
}
write(table, rows);
Predicate isNull = new PredicateBuilder(table.rowType()).isNull(1);
System.out.println(count(table, isNull)); // prints 2
System.out.println(count(table, null)); // prints 5
Helper methods:
static void write(Table table, List<GenericRow> rows) throws Exception {
BatchWriteBuilder builder = table.newBatchWriteBuilder();
try (BatchTableWrite write = builder.newWrite();
BatchTableCommit commit = builder.newCommit()) {
for (GenericRow row : rows) write.write(row);
commit.commit(write.prepareCommit());
}
}
static long count(Table table, Predicate filter) throws Exception {
ReadBuilder builder = table.newReadBuilder();
if (filter != null) builder = builder.withFilter(filter);
long[] count = new long[1];
try (RecordReader<InternalRow> reader =
builder.newRead().createReader(builder.newScan().plan())) {
reader.forEachRemaining(row -> count[0]++);
}
return count[0];
}
The same table with file-index.bitmap.columns or file-index.bsi.columns instead of range-bitmap returns 5.
What doesn't meet your expectations?
c IS NULL returns 2 rows; all 5 rows match. The rows returned are the first and the last row of the file; every row in between is dropped.
The same table with file-index.bitmap.columns or file-index.bsi.columns instead of range-bitmap returns 5.
Anything else?
Root cause is in org.apache.paimon.fileindex.rangebitmap.RangeBitmap#isNull. When the column has no non-null value in the file (cardinality <= 0), it returns:
RoaringBitmap32.bitmapOf(0, rid - 1)
bitmapOf(int...) takes a list of positions, so this is the two-element set {0, rid - 1}, not the range [0, rid). Any file with three or more rows where the indexed column is entirely NULL loses its middle rows for IS NULL.
Suggested fix: return the full range, e.g. RoaringBitmap32.bitmapOfRange(0, rid). isNotNull on the same reader is correct (it returns an empty bitmap for such a file), so the complement of isNotNull over [0, rid) gives the right answer too.
Are you willing to submit a PR?
- I'm willing to submit a PR!
- Lenguaje dominante
- Java
- Estrellas
- 3.4k
- Forks
- 1.4k
- Merge medio
- 1 d 10 h
- PR fusionados (30 d)
- 478
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/paimon
-
[Bug] [Hive] IndexOutOfBoundsException when converting an unavailable dynamic BETWEEN predicateQuizá libre de nuevo @zhang-arvin la tomó hace 42 días y no hay ningún pull request abierto. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
apache/paimon#9440 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
[Bug] Hive query on Paimon table fails with 'Proxy user is not supported' when Kerberos proxy user is usedPosiblemente ocupada @sohurdc la tomó hace 52 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
apache/paimon#9006 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[Bug] FileIndexFormat.Reader leaks input stream when construction fails with a runtime exceptionQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
[Bug] Bitmap benchmarks do not close seekable input streamsQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
Todos los issues de apache/paimon
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
apache/rocketmq-dashboard#6331 ·
Los mantenedores suelen responder en 5 días
-
Upgrade to Commons Codec 1.23.0Abiertostatus: team-only type: dependency-upgrade
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
spring-projects/spring-boot#52143 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
area/frontend good first issue kind/cooldown
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
kestra-io/kestra#20704 · 1 comentario ·
Los mantenedores suelen responder en 1 día