[Java][C] sliced RecordBatch offset info is lost when imported from c-data
- Linguagem predominante
- Java
- Estrelas
- 94
- Forks
- 152
- Merge médio
- 3d 16h
- PRs com merge (30d)
- 11
Descrição
### 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
Guia de contribuição
Direção de pesquisa
Comece lendo org.apache.arrow.c.ArrayImporter.doImport(ArrowArray.Snapshot) e as informações de offset em org.apache.arrow.c.ArrowArray.Snapshot. Reproduza a importação Java com o RecordBatch segmentado no lado C e, em seguida, verifique se o vectorSchemaRoot importado contém as linhas a partir do offset do slice, em vez das primeiras linhas do batch original.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- c, java
- Domínio
- data-engineering
- Tipo de issue
- Bug
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Estagnada
- Clareza
- Claramente especificada
- Facilidade para iniciantes
- 45/100