apache / apache/arrow-java

[Java][C] sliced RecordBatch offset info is lost when imported from c-data

Abierto
#88 6 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Java
Estrellas
94
Forks
152
Merge medio
3 d 16 h
PR fusionados (30 d)
11

Descripción

### Describe the bug, including details regarding any error messages, version, and platform.

Reproduced on latest arrow release (16.0)

When importing a sliced RecordBatch from c to java

On c side:
```
auto sliced_record_batch = original_record_batch->Slice(/*offset=*/8, /*length=*/2);
arrow::ExportRecordBatch(sliced_record_batch, arrow_array_ptr);
```

On java side:
```
ArrowArray arrowArray = ArrowArray.allocateNew(allocator);
Data.importIntoVectorSchemaRoot(allocator, arrowArray, vectorSchemaRoot, null);
```

The imported vectorSchemaRoot maintains the correct length(which is 2), but the offset info (which is 8) is not respected, hence the content of the imported vectorSchemaRoot points to the first 2 rows of the original_record_batch, while the desired content is sliced_record_batch.

I'm not familiar with arrow code, but it seems that the offset info is actually present in org.apache.arrow.c.ArrowArray.Snapshot, but org.apache.arrow.c.ArrayImporter ignores the offset in org.apache.arrow.c.ArrayImporter.doImport(ArrowArray.Snapshot)

### Component(s)

Java

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza leyendo org.apache.arrow.c.ArrayImporter.doImport(ArrowArray.Snapshot) y la información de offset en org.apache.arrow.c.ArrowArray.Snapshot. Reproduce la importación de Java con el RecordBatch segmentado del lado de C y, a continuación, verifica que el vectorSchemaRoot importado contenga las filas a partir del offset del slice, en lugar de las primeras filas del batch original.

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

Evaluación

Stack tecnológico
c, java
Área
data-engineering
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bien especificado
Aptitud para principiantes
45/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.