Interface ParquetFileStore
- All Superinterfaces:
BasicFileStore,ReadableTabularDataSource
- All Known Implementing Classes:
ParquetFileStoreConnector
ParquetFileStore defines the specific connector api for working with Apache Parquet files. A Parquet file
holds a table of data organized by column. It ends with a footer that describes the schema of the table,
the number of rows, how the values are stored and statistics about the values in each column.
This interface provides access to the information in the footer.
It also provides access to the rows of data in the file, both through its own methods and by extending the standard interface for a tabular data source. Reading the data relies on the DuckDB JDBC driver being available at runtime - see isDataAccessAvailable(). The methods that return information from the footer do not need it.
It also provides access to the rows of data in the file, both through its own methods and by extending the standard interface for a tabular data source. Reading the data relies on the DuckDB JDBC driver being available at runtime - see isDataAccessAvailable(). The methods that return information from the footer do not need it.
-
Method Summary
Modifier and TypeMethodDescriptionReturn the list of top-level column names in the file.Return the description of the file's contents from its footer.longReturn the number of rows in the file.getValueCounts(String columnName, int maxDistinctValues) Return how many times each value occurs in a top-level column, with the most frequent value first.booleanReturn whether the rows of data in the file can be read.readRecord(long rowNumber) Return the requested row of data.Methods inherited from interface org.odpi.openmetadata.adapters.connectors.datastore.basicfile.BasicFileStore
getCreationDate, getFile, getFileLength, getFileName, getLastAccessDate, getLastUpdateDateMethods inherited from interface org.odpi.openmetadata.frameworks.connectors.tabulardatasets.ReadableTabularDataSource
getColumnDescriptions, getColumnNumber, getTableDescription, getTableName
-
Method Details
-
getFileMetadata
Return the description of the file's contents from its footer.- Returns:
- file metadata
- Throws:
FileException- a problem accessing the fileFileReadException- unable to read the file, or it is not a Parquet file that the connector can describe
-
getRecordCount
Return the number of rows in the file. This value comes from the footer, so the size of the file makes no difference to how long it takes.- Specified by:
getRecordCountin interfaceReadableTabularDataSource- Returns:
- count
- Throws:
FileException- a problem accessing the fileFileReadException- unable to read the file, or it is not a Parquet file that the connector can describe
-
getColumnNames
Return the list of top-level column names in the file.- Returns:
- a list of column names
- Throws:
FileException- a problem accessing the fileFileReadException- unable to read the file, or it is not a Parquet file that the connector can describe
-
isDataAccessAvailable
boolean isDataAccessAvailable()Return whether the rows of data in the file can be read. This is true when the DuckDB JDBC driver is on the class path.- Returns:
- boolean
-
readRecord
Return the requested row of data. The first row is row 0.- Specified by:
readRecordin interfaceReadableTabularDataSource- Parameters:
rowNumber- long- Returns:
- list of strings, each string is the value from a top-level column. A null value is returned as null. The value of a column that holds nested data is formatted as a string.
- Throws:
FileException- a problem accessing the fileFileReadException- unable to read the data, or the file does not include the requested row.
-
getValueCounts
Map<String,Long> getValueCounts(String columnName, int maxDistinctValues) throws FileException, FileReadException Return how many times each value occurs in a top-level column, with the most frequent value first. Nulls are not included. This reads all the values in the column.- Parameters:
columnName- the name of a top-level columnmaxDistinctValues- the largest number of different values to return- Returns:
- map of value to the number of times it occurs, or null if the column has more than the maximum number of different values
- Throws:
FileException- a problem accessing the fileFileReadException- unable to read the data
-