Class ParquetTabularDataSetConnector
java.lang.Object
org.odpi.openmetadata.frameworks.connectors.Connector
org.odpi.openmetadata.frameworks.connectors.ConnectorBase
org.odpi.openmetadata.adapters.connectors.datastore.parquetfile.ParquetTabularDataSetConnector
- All Implemented Interfaces:
SecureConnectorExtension,ReadableTabularDataSource,VirtualConnectorExtension
- Direct Known Subclasses:
ParquetTabularDataSetCollectionConnector
public class ParquetTabularDataSetConnector
extends ConnectorBase
implements ReadableTabularDataSource
ParquetTabularDataSetConnector provides read access to an Apache Parquet file as a tabular data set.
The file is located from the directoryPathName and tableName configuration properties
(directoryPathName/tableName.parquet) and the work of reading it is delegated to an embedded
ParquetFileStoreConnector. Parquet files are immutable once written, so this connector is read-only.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
ConnectorBase.ProtectedConnection -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ParquetFileStoreConnectorprotected Stringprotected StringFields inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
auditLog, connectionBean, connectorInstanceId, embeddedConnectors, messageFormatter, secretsStoreConnectorMap -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn the list of column descriptions associated with this data source.intgetColumnNumber(String columnName) Locate the named column.longReturn the number of records in the table.Return the description for this data source.Return the table name for this data source.Return the names of the tables that have a Parquet file in the directory.booleanReturn whether the rows of data can be read.readRecord(long rowNumber) Return the requested data record.protected voidsetFileStoreName(String tableName) Set up the file name to use for this tabular data set.voidstart()Indicates that the connector is completely configured and can begin processing.Methods inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
combineConfigurationProperties, disconnect, 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, setStatisticTimestamp
-
Field Details
-
tableName
-
tableDescription
-
fileStoreConnector
-
-
Constructor Details
-
ParquetTabularDataSetConnector
public ParquetTabularDataSetConnector()
-
-
Method Details
-
start
Indicates that the connector is completely configured and can begin processing.- Overrides:
startin classConnectorBase- Throws:
ConnectorCheckedException- the connector detected a problem.UserNotAuthorizedException- the connector was disconnected before/during start
-
setFileStoreName
Set up the file name to use for this tabular data set.- Parameters:
tableName- name of table- Throws:
ConnectorCheckedException- problem using the name as a file name.
-
getTableNamesInDirectory
Return the names of the tables that have a Parquet file in the directory. Each is the name of a file without its file extension.- Returns:
- sorted list of table names - empty if there are no Parquet files, or the directory does not exist
-
isDataAccessAvailable
public boolean isDataAccessAvailable()Return whether the rows of data can be read. This needs the DuckDB JDBC driver to be on the class path. The description of the table (its name, columns and number of records) is available without it.- Returns:
- boolean
-
getRecordCount
Return the number of records in the table. This comes from the footer of the file.- Specified by:
getRecordCountin interfaceReadableTabularDataSource- Returns:
- count
- Throws:
ConnectorCheckedException- problem reading the file
-
getTableName
Return the table name for this data source.- Specified by:
getTableNamein interfaceReadableTabularDataSource- Returns:
- string
-
getTableDescription
Return the description for this data source. It is the description supplied in the configuration properties, or a description derived from the file if none was configured.- Specified by:
getTableDescriptionin interfaceReadableTabularDataSource- Returns:
- string
- Throws:
ConnectorCheckedException- problem reading the file
-
getColumnDescriptions
Return the list of column descriptions associated with this data source. There is one for each top-level column in the file.- Specified by:
getColumnDescriptionsin interfaceReadableTabularDataSource- Returns:
- a list of column descriptions
- Throws:
ConnectorCheckedException- problem reading the file
-
getColumnNumber
Locate the named column. A negative number means the column is not present.- Specified by:
getColumnNumberin interfaceReadableTabularDataSource- Parameters:
columnName- name of the column to return- Returns:
- column number (starting at 0)
- Throws:
ConnectorCheckedException- problem reading the file
-
readRecord
Return the requested data record. The first record is record 0.- Specified by:
readRecordin interfaceReadableTabularDataSource- Parameters:
rowNumber- long- Returns:
- list of values (as strings) where each string is the value from a column. The order is the same as the columns
- Throws:
ConnectorCheckedException- the row is not in the file, or the data can not be read
-