Class ParquetFileStoreConnector
java.lang.Object
org.odpi.openmetadata.frameworks.connectors.Connector
org.odpi.openmetadata.frameworks.connectors.ConnectorBase
org.odpi.openmetadata.adapters.connectors.datastore.basicfile.BasicFileStoreConnector
org.odpi.openmetadata.adapters.connectors.datastore.parquetfile.ParquetFileStoreConnector
- All Implemented Interfaces:
BasicFileStore,ParquetFileStore,SecureConnectorExtension,ReadableTabularDataSource,VirtualConnectorExtension
ParquetFileStoreConnector works with Apache Parquet files to retrieve the description of the data they hold,
and the data itself.
The description comes from the file's footer, which the connector decodes itself. The data is read using DuckDB and is only available if the DuckDB JDBC driver is on the class path.
The description comes from the file's footer, which the connector decodes itself. The data is read using DuckDB and is only available if the DuckDB JDBC driver is on the class path.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
ConnectorBase.ProtectedConnection -
Field Summary
Fields inherited from class org.odpi.openmetadata.adapters.connectors.datastore.basicfile.BasicFileStoreConnector
fileStoreNameFields inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
auditLog, connectionBean, connectorInstanceId, embeddedConnectors, messageFormatter, secretsStoreConnectorMap -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidFree up any resources held since the connector is no longer needed.Return the description of each of the top-level columns in the file.Return the list of top-level column names in the file.intgetColumnNumber(String columnName) Return the number of the column with the requested name.Return the description of the file's contents from its footer.longReturn the number of rows in the file.Return the description for this data source.Return the table name for this data source.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 class org.odpi.openmetadata.adapters.connectors.datastore.basicfile.BasicFileStoreConnector
getCreationDate, getFile, getFile, getFileLength, getFileName, getLastAccessDate, getLastUpdateDate, setFileStoreName, start, touchFileMethods inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
combineConfigurationProperties, disconnectConnectors, equals, fromCamelToCanonicalCase, fromCanonicalToCamelCase, fromCanonicalToKebabCase, fromCanonicalToSnakeCase, fromKebabToCanonicalCase, fromSnakeToCanonicalCase, getArrayConfigurationProperty, getArrayConfigurationProperty, getArrayConfigurationProperty, getArrayValue, getBooleanConfigurationProperty, getConnection, getConnectorInstanceId, getDateConfigurationProperty, getIntConfigurationProperty, getLongConfigurationProperty, getSecretsCollectionName, getSecretsLocation, getSecretsProvider, getStringConfigurationProperty, getStringConfigurationProperty, getSuppliedPlaceholderProperties, hashCode, initialize, initializeEmbeddedConnectors, initializeSecretsStoreConnector, isActive, logExceptionRecord, logExceptionRecord, logRecord, logRecord, throwMissingConfigurationProperty, throwMissingElement, throwMissingEndpointAddress, throwMissingResource, throwNoAsset, throwWrongTypeOfAsset, throwWrongTypeOfResource, throwWrongTypeOfRootSchema, toStringMethods inherited from class org.odpi.openmetadata.frameworks.connectors.Connector
clearStatisticProperty, clearStatisticTimestamp, getConnectorStatistics, getStatisticCounter, getStatisticProperty, getStatisticTimestamp, incrementStatisticCounter, initializeStatisticCounter, refreshStatistics, setStatisticProperty, setStatisticTimestampMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.odpi.openmetadata.adapters.connectors.datastore.basicfile.BasicFileStore
getCreationDate, getFile, getFileLength, getFileName, getLastAccessDate, getLastUpdateDate
-
Constructor Details
-
ParquetFileStoreConnector
public ParquetFileStoreConnector()Default constructor.
-
-
Method Details
-
getFileMetadata
Return the description of the file's contents from its footer.- Specified by:
getFileMetadatain interfaceParquetFileStore- 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 interfaceParquetFileStore- 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.- Specified by:
getColumnNamesin interfaceParquetFileStore- 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
public 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.- Specified by:
isDataAccessAvailablein interfaceParquetFileStore- Returns:
- boolean
-
readRecord
Return the requested row of data. The first row is row 0.- Specified by:
readRecordin interfaceParquetFileStore- 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
public 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.- Specified by:
getValueCountsin interfaceParquetFileStore- 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
-
getTableName
Return the table name for this data source. This is the name of the file without its file extension.- Specified by:
getTableNamein interfaceReadableTabularDataSource- Returns:
- string
- Throws:
FileException- a problem accessing the file
-
getTableDescription
Return the description for this data source.- Specified by:
getTableDescriptionin interfaceReadableTabularDataSource- Returns:
- string
- Throws:
FileException- a problem accessing the fileFileReadException- unable to read the file, or it is not a Parquet file that the connector can describe
-
getColumnDescriptions
public List<TabularColumnDescription> getColumnDescriptions() throws FileException, FileReadExceptionReturn the description of each of the top-level columns in the file.- Specified by:
getColumnDescriptionsin interfaceReadableTabularDataSource- Returns:
- a list of column descriptions
- Throws:
FileException- a problem accessing the fileFileReadException- unable to read the file, or it is not a Parquet file that the connector can describe
-
getColumnNumber
Return the number of the column with the requested name. The first column is column 0.- Specified by:
getColumnNumberin interfaceReadableTabularDataSource- Parameters:
columnName- name of the column- Returns:
- column number, or -1 if there is no column with this name
- Throws:
FileException- a problem accessing the fileFileReadException- unable to read the file, or it is not a Parquet file that the connector can describe
-
disconnect
public void disconnect()Free up any resources held since the connector is no longer needed.- Overrides:
disconnectin classBasicFileStoreConnector
-