public class LanceFileReader extends Object implements AutoCloseable
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the LanceFileReader
|
long |
numRows()
Get the number of rows in the Lance file
|
static LanceFileReader |
open(String path,
org.apache.arrow.memory.BufferAllocator allocator)
Open a LanceFileReader from a file URI
|
static LanceFileReader |
open(String path,
Map<String,String> storageOptions,
org.apache.arrow.memory.BufferAllocator allocator)
Open a LanceFileReader from a file URI
|
org.apache.arrow.vector.ipc.ArrowReader |
readAll(List<String> projectedNames,
List<Range> ranges,
int batchSize)
Read all rows from the Lance file
|
org.apache.arrow.vector.types.pojo.Schema |
schema()
Get the schema of the Lance file
|
public static LanceFileReader open(String path, org.apache.arrow.memory.BufferAllocator allocator) throws IOException
path - the URI to the Lance fileallocator - the Arrow BufferAllocator to use for the readerIOExceptionpublic static LanceFileReader open(String path, Map<String,String> storageOptions, org.apache.arrow.memory.BufferAllocator allocator) throws IOException
path - the URI to the Lance filestorageOptions - optional storage options for the Lance fileallocator - the Arrow BufferAllocator to use for the readerIOExceptionpublic void close()
throws Exception
This method must be called to release resources when the reader is no longer needed.
close in interface AutoCloseableExceptionpublic long numRows()
throws IOException
IOExceptionpublic org.apache.arrow.vector.types.pojo.Schema schema()
public org.apache.arrow.vector.ipc.ArrowReader readAll(@Nullable List<String> projectedNames, @Nullable List<Range> ranges, int batchSize) throws IOException
batchSize - the maximum number of rows to read in a single batchprojectedNames - optional list of column names to project; if null, all columns are readranges - optional array of ranges to read; if null, all rows are read.IOExceptionCopyright © 2025. All rights reserved.