You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "vinayvenk (via GitHub)" <gi...@apache.org> on 2024/05/30 18:46:48 UTC
[I] Exception when trying to load next batch while reading a parquet file [arrow]
vinayvenk opened a new issue, #41893:
URL: https://github.com/apache/arrow/issues/41893
### Describe the bug, including details regarding any error messages, version, and platform.
Getting this exception when trying to load next batch while reading a parquet file.
The parsing works if the batch size is big enough to process all the parquet contents in one shot. But if I try to give a smaller batch size , the code breaks giving the below exception
java.lang.IllegalArgumentException: should have as many children as in the schema: found 0 expected 8
at org.apache.arrow.util.Preconditions.checkArgument(Preconditions.java:282)
at org.apache.arrow.vector.VectorLoader.loadBuffers(VectorLoader.java:127)
at org.apache.arrow.vector.VectorLoader.load(VectorLoader.java:84)
at org.apache.arrow.c.Data.importIntoVectorSchemaRoot(Data.java:334)
at org.apache.arrow.dataset.jni.NativeScanner$NativeReader.loadNextBatch(NativeScanner.java:151)
### Component(s)
Java
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Java] Exception when trying to load next batch while reading a parquet file [arrow]
Posted by "vinayvenk (via GitHub)" <gi...@apache.org>.
vinayvenk commented on issue #41893:
URL: https://github.com/apache/arrow/issues/41893#issuecomment-2142175816
GM @amoeba it is pretty much standard code that i got from the example and I tried using 16.0.1, 16.0.0 and 15.0.1
String uri = parquetFile.toURI().toString();
ScanOptions options = new ScanOptions(/* batchSize */ 32768);
try (BufferAllocator allocator = new RootAllocator();
DatasetFactory datasetFactory = new FileSystemDatasetFactory(allocator, NativeMemoryPool.getDefault(),
FileFormat.PARQUET, uri);
Dataset dataset = datasetFactory.finish();
Scanner scanner = dataset.newScan(options);
ArrowReader reader = scanner.scanBatches()) {
int batchCount = 0;
while (reader.loadNextBatch()) {
try (VectorSchemaRoot root = reader.getVectorSchemaRoot()) {
//function to create csv data
createCSV()
}
it fails when it tries to load the second batch.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Java] Exception when trying to load next batch while reading a parquet file [arrow]
Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on issue #41893:
URL: https://github.com/apache/arrow/issues/41893#issuecomment-2141018103
Hi @vinayvenk, what Arrow Java version are you on? Can you share the code you ran, ideally with code that can generate the data causing this?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org