Package org.openmetadata.service.jdbi3
Class TableRepository
java.lang.Object
org.openmetadata.service.jdbi3.EntityRepository<Table>
org.openmetadata.service.jdbi3.TableRepository
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classclassHandles entity updated from PUT and POST operation.Nested classes/interfaces inherited from class org.openmetadata.service.jdbi3.EntityRepository
EntityRepository.DescriptionTaskWorkflow, EntityRepository.EntityUpdater, EntityRepository.Operation, EntityRepository.TagTaskWorkflow -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class org.openmetadata.service.jdbi3.EntityRepository
allowedFields, CACHE_WITH_ID, CACHE_WITH_NAME, dao, daoCollection, entityType, putFields, quoteFqn, renameAllowed, searchRepository, supportsDataProducts, supportsDomain, supportsExperts, supportsExtension, supportsFollower, supportsLifeCycle, supportsOwner, supportsReviewers, supportsSearch, supportsSoftDelete, supportsStyle, supportsTags, supportsVotes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddCustomMetric(UUID tableId, CustomMetric customMetric) addDataModel(UUID tableId, DataModel dataModel) addJoins(UUID tableId, TableJoins joins) addSampleData(UUID tableId, TableData tableData) addTableProfileData(UUID tableId, CreateTableProfile createTableProfile) addTableProfilerConfig(UUID tableId, TableProfilerConfig tableProfilerConfig) applySuggestion(EntityInterface entity, String columnFQN, Suggestion suggestion) voidvoidclearFields(Table table, EntityUtil.Fields fields) Set the requested fields in an entity.deleteCustomMetric(UUID tableId, String columnName, String metricName) deleteSampleData(UUID tableId) voiddeleteTableProfile(String fqn, String entityType, Long timestamp) deleteTableProfilerConfig(UUID tableId) exportToCsv(String name, String user) Override this method to support downloading CSV functionalitygetAllTags(EntityInterface entity) getColumnProfiles(String fqn, Long startTs, Long endTs) getLatestTableProfile(String fqn, boolean authorizePII) getParentEntity(Table entity, String fields) getSampleData(UUID tableId, boolean authorizePII) getSuggestionFields(Suggestion suggestion) Bring in the necessary fields required to have all the information before applying a suggestiongetSystemProfiles(String fqn, Long startTs, Long endTs) getTableProfilerConfig(Table table) getTableProfiles(String fqn, Long startTs, Long endTs) getTaskWorkflow(FeedRepository.ThreadContext threadContext) getTestSuite(Table table) getUpdater(Table original, Table updated, EntityRepository.Operation operation) importFromCsv(String name, String csv, boolean dryRun, String user) Load CSV provided for bulk uploadvoidThis method is used for validating an entity to be created during POST, PUT, and PATCH operations and prepare the entity with all the required attributes and relationships.voidrestorePatchAttributes(Table original, Table updated) PATCH operations can't overwrite certain fields, such as entity ID, fullyQualifiedNames etc.voidsetFields(Table table, EntityUtil.Fields fields) Set the requested fields in an entity.voidsetFullyQualifiedName(Table table) Set fullyQualifiedName of an entityvoidsetInheritedFields(Table table, EntityUtil.Fields fields) This method is called to set inherited fields that an entity inherits from its parent.voidstoreEntity(Table table, boolean update) An entity is stored in the backend database as JSON document.voidstoreRelationships(Table table) This method is called to store all the relationships of an entity.static voidvalidateColumn(Table table, String columnName) voidvalidateTags(Table entity) Methods inherited from class org.openmetadata.service.jdbi3.EntityRepository
addFollower, addRelationship, addRelationship, addRelationship, addServiceRelationship, applyColumnTags, applyTags, bulkAddToRelationship, bulkAssetsOperation, checkSystemEntityDeletion, cleanup, clearFieldsInternal, copy, create, createInternal, createOrUpdate, delete, deleteByName, deleteExtensionAtTimestamp, deleteExtensionBeforeTimestamp, deleteFollower, deleteFrom, deleteFromSearch, deleteInternal, deleteInternalByName, deleteRelationship, deleteTo, ensureSingleRelationship, find, findBoth, findByName, findByNameOrNull, findFrom, findFromRecords, findTo, findToRecords, get, get, getAllowedFieldsCopy, getByName, getByName, getChildren, getCommonFields, getContainer, getContainer, getCustomPropertyFQN, getCustomPropertyFQNPrefix, getDomain, getEntitiesFromSeedData, getEntitiesFromSeedData, getEntitiesFromSeedData, getExperts, getExtension, getExtensionAtTimestamp, getFields, getFields, getFollowers, getFromEntityRef, getHref, getIngestionPipelines, getLatestExtensionFromTimeSeries, getOwner, getOwner, getParent, getReference, getReferenceByName, getResultList, getResultList, getResultsFromAndToTimestamps, getResultsFromAndToTimestamps, getReviewers, getSuggestionWorkflow, getTags, getTags, getTagsByPrefix, getToEntityRef, getVersion, getVotes, inheritDomain, inheritExperts, inheritOwner, inheritReviewers, initializeEntity, initSeedDataFromResources, listAfter, listAfterWithSkipFailure, listAll, listBefore, listVersions, patch, populateOwner, postCreate, postDelete, postUpdate, preDelete, prepareInternal, removeExtension, restoreEntity, restoreFromSearch, setFieldsInternal, store, storeDataProducts, storeDomain, storeExtension, storeOwner, storeRelationshipsInternal, storeTimeSeries, update, updateOwner, updateVote, validateColumnTags, validateDataProducts, validateDomain, validateDomain, validateOwner, validateRoles, validateTags, validateTaskThread, validateUsers, withHref
-
Field Details
-
FIELD_RELATION_COLUMN_TYPE
- See Also:
-
FIELD_RELATION_TABLE_TYPE
- See Also:
-
TABLE_PROFILE_EXTENSION
- See Also:
-
SYSTEM_PROFILE_EXTENSION
- See Also:
-
TABLE_COLUMN_PROFILE_EXTENSION
- See Also:
-
TABLE_SAMPLE_DATA_EXTENSION
- See Also:
-
TABLE_PROFILER_CONFIG_EXTENSION
- See Also:
-
TABLE_COLUMN_EXTENSION
- See Also:
-
TABLE_EXTENSION
- See Also:
-
CUSTOM_METRICS_EXTENSION
- See Also:
-
TABLE_PROFILER_CONFIG
- See Also:
-
COLUMN_FIELD
- See Also:
-
CUSTOM_METRICS
- See Also:
-
-
Constructor Details
-
TableRepository
public TableRepository()
-
-
Method Details
-
setFields
Description copied from class:EntityRepositorySet the requested fields in an entity. This is used for requesting specific fields in the object during GET operations. It is also used during PUT and PATCH operations to set up fields that can be updated.- Specified by:
setFieldsin classEntityRepository<Table>
-
clearFields
Description copied from class:EntityRepositorySet the requested fields in an entity. This is used for requesting specific fields in the object during GET operations. It is also used during PUT and PATCH operations to set up fields that can be updated.- Specified by:
clearFieldsin classEntityRepository<Table>
-
setInheritedFields
Description copied from class:EntityRepositoryThis method is called to set inherited fields that an entity inherits from its parent.- Overrides:
setInheritedFieldsin classEntityRepository<Table>- See Also:
-
restorePatchAttributes
Description copied from class:EntityRepositoryPATCH operations can't overwrite certain fields, such as entity ID, fullyQualifiedNames etc. Instead of throwing an error, we take lenient approach of ignoring the user error and restore those attributes based on what is already stored in the original entity.- Overrides:
restorePatchAttributesin classEntityRepository<Table>
-
setFullyQualifiedName
Description copied from class:EntityRepositorySet fullyQualifiedName of an entity- Overrides:
setFullyQualifiedNamein classEntityRepository<Table>
-
addJoins
-
addSampleData
-
getSampleData
-
deleteSampleData
-
getTableProfilerConfig
-
getTestSuite
-
addTableProfilerConfig
-
deleteTableProfilerConfig
-
addTableProfileData
-
deleteTableProfile
-
getTableProfiles
-
getColumnProfiles
-
getSystemProfiles
-
getLatestTableProfile
-
addCustomMetric
-
deleteCustomMetric
-
addDataModel
-
prepare
Description copied from class:EntityRepositoryThis method is used for validating an entity to be created during POST, PUT, and PATCH operations and prepare the entity with all the required attributes and relationships.The implementation of this method must perform the following:
- Prepare the values for attributes that are not required in the request but can be derived on the server side. Example - >FullyQualifiedNames of an entity can be derived from the hierarchy that an entity belongs to .
- Validate all the attributes of an entity.
- Validate all the relationships of an entity. As an example - during table creation, relationships such as Tags, Owner, Databasea table belongs to are validated. During validation additional information that is not required in the create/update request are set up in the corresponding relationship fields.
- Specified by:
preparein classEntityRepository<Table>- See Also:
-
storeEntity
Description copied from class:EntityRepositoryAn entity is stored in the backend database as JSON document. The JSON includes some attributes of the entity and does not include attributes such as href. The relationship fields of an entity is never stored in the JSON document. It is always reconstructed based on relationship edges from the backend database.
As an example, when table entity is stored, the attributes such as href and the relationships such as owner, database, and tags are set to null. These attributes are restored back after the JSON document is stored to be sent as response.- Specified by:
storeEntityin classEntityRepository<Table>- See Also:
-
storeRelationships
Description copied from class:EntityRepositoryThis method is called to store all the relationships of an entity. It is expected that all relationships are already validated and completely setup before this method is called and no validation of relationships is required.- Specified by:
storeRelationshipsin classEntityRepository<Table>- See Also:
-
getUpdater
public EntityRepository<Table>.EntityUpdater getUpdater(Table original, Table updated, EntityRepository.Operation operation) - Overrides:
getUpdaterin classEntityRepository<Table>
-
applyTags
- Overrides:
applyTagsin classEntityRepository<Table>
-
getParentEntity
- Overrides:
getParentEntityin classEntityRepository<Table>
-
validateTags
- Overrides:
validateTagsin classEntityRepository<Table>
-
getAllTags
- Overrides:
getAllTagsin classEntityRepository<Table>
-
getTaskWorkflow
- Overrides:
getTaskWorkflowin classEntityRepository<Table>
-
getSuggestionFields
Description copied from class:EntityRepositoryBring in the necessary fields required to have all the information before applying a suggestion- Overrides:
getSuggestionFieldsin classEntityRepository<Table>
-
applySuggestion
- Overrides:
applySuggestionin classEntityRepository<Table>
-
exportToCsv
Description copied from class:EntityRepositoryOverride this method to support downloading CSV functionality- Overrides:
exportToCsvin classEntityRepository<Table>- Throws:
IOException
-
importFromCsv
public CsvImportResult importFromCsv(String name, String csv, boolean dryRun, String user) throws IOException Description copied from class:EntityRepositoryLoad CSV provided for bulk upload- Overrides:
importFromCsvin classEntityRepository<Table>- Throws:
IOException
-
validateColumn
-