Class DuckDBDatabaseCatalogTargetProcessor
java.lang.Object
org.odpi.openmetadata.frameworks.openmetadata.properties.RelationshipProperties
org.odpi.openmetadata.frameworks.openmetadata.properties.RelationshipBeanProperties
org.odpi.openmetadata.frameworks.openmetadata.properties.assets.processes.connectors.CatalogTargetProperties
org.odpi.openmetadata.frameworks.opengovernance.properties.CatalogTarget
org.odpi.openmetadata.frameworks.integration.properties.RequestedCatalogTarget
org.odpi.openmetadata.frameworks.integration.connectors.CatalogTargetProcessorBase
org.odpi.openmetadata.adapters.connectors.duckdb.catalog.DuckDBDatabaseCatalogTargetProcessor
DuckDBDatabaseCatalogTargetProcessor is the most novel of the DuckDB connectors. A DuckDB database is embedded
(a single ".duckdb" file, or an in-memory ":memory:" session) so there is no equivalent of the "server" catalog
target used by the other database connector suites for the connector to be pointed at - the catalog target
configured for this processor may be any convenient, already-catalogued element (for example, a FileFolder for
the directory the database file lives in, or a previous run's own DuckDB database asset); the actual identity of
the DuckDB database is always (re)computed from the
DESIGN NOTE (judgement call): CatalogTargetProcessorBase's contract assumes the catalog target element already exists, but the whole point of this processor is that it can materialise the RelationalDatabase asset for a DuckDB file the first time it is refreshed. This processor therefore always looks the database asset up by its FileClassifier-derived qualifiedName first (which will typically find the catalog target element itself, once it has been catalogued once) and only creates a brand-new self-anchored asset if no match is found - see
Once the database asset's identity is settled, this processor does two more things on every refresh:
DuckDBConfigurationProperty.DATABASE_PATH
configuration property using the files-integration-connector's FileClassifier, exactly the way
DataFilesMonitorForTarget.catalogFile() computes the identity of a data file.
DESIGN NOTE (judgement call): CatalogTargetProcessorBase's contract assumes the catalog target element already exists, but the whole point of this processor is that it can materialise the RelationalDatabase asset for a DuckDB file the first time it is refreshed. This processor therefore always looks the database asset up by its FileClassifier-derived qualifiedName first (which will typically find the catalog target element itself, once it has been catalogued once) and only creates a brand-new self-anchored asset if no match is found - see
getOrCreateDuckDBDatabaseAsset(String, Map).
Once the database asset's identity is settled, this processor does two more things on every refresh:
- hands off cataloguing of the database's native schemas/tables/columns to the "friendship" JDBC integration connector, using exactly the same catalog target hand-off mechanism as the other four vendor connector suites;
- catalogues DuckDB's federation relationships (databases ATTACH-ed to this one, and views that scan
external files/object-store resources) - see
catalogFederationRelationships(String, String, Connection). This reuses DuckDBFederationExtractor's discovery queries (its SurveyActionServiceConnector constructor parameter is unused by its query logic, so null is passed here) rather than duplicating the SQL/regex matching a second time.
-
Field Summary
Fields inherited from class org.odpi.openmetadata.frameworks.integration.connectors.CatalogTargetProcessorBase
auditLog, connectorName, metadataCollectionGUID, metadataCollectionNameFields inherited from class org.odpi.openmetadata.frameworks.integration.properties.RequestedCatalogTarget
connectorToTarget, integrationContextFields inherited from class org.odpi.openmetadata.frameworks.openmetadata.properties.RelationshipBeanProperties
typeName -
Constructor Summary
ConstructorsConstructorDescriptionDuckDBDatabaseCatalogTargetProcessor(CatalogTarget catalogTarget, CatalogTargetContext integrationContext, Connector connectorToTarget, String connectorName, AuditLog auditLog) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidFree up any resources held since the connector is no longer needed.voidrefresh()Requests that the connector does a comparison of the metadata in the third party technology and open metadata repositories.voidstart()Indicates that the connector is completely configured and can begin processing.Methods inherited from class org.odpi.openmetadata.frameworks.integration.connectors.CatalogTargetProcessorBase
getArrayConfigurationProperty, getArrayConfigurationProperty, getArrayConfigurationProperty, getBooleanConfigurationProperty, getDateConfigurationProperty, getHostIdentifier, getIntConfigurationProperty, getLongConfigurationProperty, getPortNumber, getStringConfigurationProperty, getSuppliedPlaceholderProperties, setUpMetadataSource, setUpSoftwareCapability, throwBadBeanClass, throwMissingConnectionInfo, throwMissingPropertyValue, throwWrongTypeOfCatalogTarget, throwWrongTypeOfResourceConnectorMethods inherited from class org.odpi.openmetadata.frameworks.integration.properties.RequestedCatalogTarget
equals, getConnectorToTarget, getIntegrationContext, getNetworkAddress, hashCode, toStringMethods inherited from class org.odpi.openmetadata.frameworks.opengovernance.properties.CatalogTarget
getCatalogTargetElement, getRelationshipGUID, getRelationshipVersions, setCatalogTargetElement, setRelationshipGUID, setRelationshipVersionsMethods inherited from class org.odpi.openmetadata.frameworks.openmetadata.properties.assets.processes.connectors.CatalogTargetProperties
getCatalogTargetName, getConfigurationProperties, getConnectionName, getDeleteMethod, getMetadataCollectionQualifiedName, getMetadataSourceQualifiedName, getPermittedSynchronization, getTemplates, setCatalogTargetName, setConfigurationProperties, setConnectionName, setDeleteMethod, setMetadataCollectionQualifiedName, setMetadataSourceQualifiedName, setPermittedSynchronization, setTemplatesMethods inherited from class org.odpi.openmetadata.frameworks.openmetadata.properties.RelationshipBeanProperties
getExtendedProperties, getTypeName, setExtendedProperties, setTypeNameMethods inherited from class org.odpi.openmetadata.frameworks.openmetadata.properties.RelationshipProperties
getEffectiveFrom, getEffectiveTo, setEffectiveFrom, setEffectiveTo
-
Constructor Details
-
DuckDBDatabaseCatalogTargetProcessor
public DuckDBDatabaseCatalogTargetProcessor(CatalogTarget catalogTarget, CatalogTargetContext integrationContext, Connector connectorToTarget, String connectorName, AuditLog auditLog) Constructor- Parameters:
catalogTarget- catalog target informationintegrationContext- specialized context for this catalog targetconnectorToTarget- connector to access the target resourceconnectorName- name of this integration connectorauditLog- logging destination
-
-
Method Details
-
start
Indicates that the connector is completely configured and can begin processing.- Overrides:
startin classCatalogTargetProcessorBase- Throws:
ConnectorCheckedException- the connector detected a problem.UserNotAuthorizedException- the connector was disconnected before/during start
-
refresh
Requests that the connector does a comparison of the metadata in the third party technology and open metadata repositories.- Overrides:
refreshin classCatalogTargetProcessorBase- Throws:
ConnectorCheckedException- a problem with the connector. It is not able to refresh the metadata.
-
disconnect
Free up any resources held since the connector is no longer needed.- Overrides:
disconnectin classCatalogTargetProcessorBase- Throws:
ConnectorCheckedException- the connector detected a problem.
-