ArrowBatchReader.java org::apache::iceberg::arrow::vectorized::ArrowBatchReader org::apache::iceberg::arrow::vectorized /* *LicensedtotheApacheSoftwareFoundation(ASF)underone *ormorecontributorlicenseagreements.SeetheNOTICEfile *distributedwiththisworkforadditionalinformation *regardingcopyrightownership.TheASFlicensesthisfile *toyouundertheApacheLicense,Version2.0(the *"License");youmaynotusethisfileexceptincompliance *withtheLicense.YoumayobtainacopyoftheLicenseat * *http://www.apache.org/licenses/LICENSE-2.0 * *Unlessrequiredbyapplicablelaworagreedtoinwriting, *softwaredistributedundertheLicenseisdistributedonan *"ASIS"BASIS,WITHOUTWARRANTIESORCONDITIONSOFANY *KIND,eitherexpressorimplied.SeetheLicenseforthe *specificlanguagegoverningpermissionsandlimitations *undertheLicense. */ packageorg.apache.iceberg.arrow.vectorized; importjava.util.List; importorg.apache.iceberg.parquet.VectorizedReader; importorg.apache.iceberg.relocated.com.google.common.base.Preconditions; classArrowBatchReaderextendsBaseBatchReader<ColumnarBatch>{ ArrowBatchReader(List<VectorizedReader<?>>readers){ super(readers); } @Override publicfinalColumnarBatchread(ColumnarBatchreuse,intnumRowsToRead){ Preconditions.checkArgument( numRowsToRead>0,"Invalidnumberofrowstoread:%s",numRowsToRead); if(reuse==null){ closeVectors(); } ColumnVector[]columnVectors=newColumnVector[readers.length]; for(inti=0;i<readers.length;i+=1){ vectorHolders[i]=readers[i].read(vectorHolders[i],numRowsToRead); intnumRowsInVector=vectorHolders[i].numValues(); Preconditions.checkState( numRowsInVector==numRowsToRead, "Numberofrowsinthevector%sdidn'tmatchexpected%s", numRowsInVector, numRowsToRead); //Handlenullvectorforconstantcase columnVectors[i]=newColumnVector(vectorHolders[i]); } returnnewColumnarBatch(numRowsToRead,columnVectors); } }