Package org.openmetadata.service.jdbi3
Class TableRepository
- java.lang.Object
-
- org.openmetadata.service.jdbi3.EntityRepository<Table>
-
- org.openmetadata.service.jdbi3.TableRepository
-
public class TableRepository extends EntityRepository<Table>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classTableRepository.TableUpdaterHandles entity updated from PUT and POST operation.-
Nested classes/interfaces inherited from class org.openmetadata.service.jdbi3.EntityRepository
EntityRepository.EntityUpdater, EntityRepository.Operation
-
-
Field Summary
Fields Modifier and Type Field Description static StringCUSTOM_METRICS_EXTENSIONstatic StringFIELD_RELATION_COLUMN_TYPEstatic StringFIELD_RELATION_TABLE_TYPEstatic StringSYSTEM_PROFILE_EXTENSIONstatic StringTABLE_COLUMN_EXTENSIONstatic StringTABLE_COLUMN_PROFILE_EXTENSIONstatic StringTABLE_PROFILE_EXTENSIONstatic StringTABLE_PROFILER_CONFIG_EXTENSIONstatic StringTABLE_SAMPLE_DATA_EXTENSION-
Fields inherited from class org.openmetadata.service.jdbi3.EntityRepository
allowedFields, CACHE_WITH_ID, CACHE_WITH_NAME, dao, daoCollection, entityType, putFields, quoteFqn, supportsExtension, supportsFollower, supportsOwner, supportsSoftDelete, supportsTags, supportsVotes
-
-
Constructor Summary
Constructors Constructor Description TableRepository(CollectionDAO daoCollection)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TableaddCustomMetric(UUID tableId, CustomMetric customMetric)TableaddDataModel(UUID tableId, DataModel dataModel)TableaddJoins(UUID tableId, TableJoins joins)TableaddSampleData(UUID tableId, TableData tableData)TableaddTableProfileData(UUID tableId, CreateTableProfile createTableProfile)TableaddTableProfilerConfig(UUID tableId, TableProfilerConfig tableProfilerConfig)voidapplyTags(Table table)TableclearFields(Table table, EntityUtil.Fields fields)Set the requested fields in an entity.TabledeleteCustomMetric(UUID tableId, String columnName, String metricName)TabledeleteSampleData(UUID tableId)voiddeleteTableProfile(String fqn, String entityType, Long timestamp)TabledeleteTableProfilerConfig(UUID tableId)List<TagLabel>getAllTags(EntityInterface entity)ResultList<ColumnProfile>getColumnProfiles(String fqn, Long startTs, Long endTs)TablegetLatestTableProfile(String fqn, boolean authorizePII)TablegetSampleData(UUID tableId, boolean authorizePII)ResultList<SystemProfile>getSystemProfiles(String fqn, Long startTs, Long endTs)TableProfilerConfiggetTableProfilerConfig(Table table)ResultList<TableProfile>getTableProfiles(String fqn, Long startTs, Long endTs)TestSuitegetTestSuite(Table table)EntityRepository.EntityUpdatergetUpdater(Table original, Table updated, EntityRepository.Operation operation)voidprepare(Table table)This 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.TablesetFields(Table table, EntityUtil.Fields fields)Set the requested fields in an entity.voidsetFullyQualifiedName(Table table)Set fullyQualifiedName of an entityTablesetInheritedFields(Table table, EntityUtil.Fields fields)This method is called to set inherited fields that an entity inherits from its parent.voidsetInheritedProperties(Table table, UUID schemaId)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.voidupdate(TaskDetails task, MessageParser.EntityLink entityLink, String newValue, String user)Update an entity based suggested description and tags in the taskstatic voidvalidateColumn(Table table, String columnName)-
Methods inherited from class org.openmetadata.service.jdbi3.EntityRepository
addDerivedTags, addFollower, addRelationship, addRelationship, addRelationship, applyTags, bulkAddToRelationship, checkSystemEntityDeletion, cleanup, clearFieldsInternal, create, createInternal, createOrUpdate, createOrUpdateInternal, delete, deleteByName, deleteExtensionAtTimestamp, deleteExtensionBeforeTimestamp, deleteFollower, deleteFrom, deleteInternal, deleteInternalByName, deleteRelationship, deleteTo, ensureSingleRelationship, exportToCsv, find, findBoth, findByName, findByNameOrNull, findFrom, findFromRecords, findTo, findToRecords, get, get, getAllowedFieldsCopy, getByName, getByName, getChildren, getCommonFields, getContainer, getCustomPropertyFQN, getCustomPropertyFQNPrefix, getEntitiesFromSeedData, getEntitiesFromSeedData, getEntitiesFromSeedData, getExtension, getExtensionAtTimestamp, getExtensionAtTimestampWithOperation, getFields, getFields, getFollowers, getFromEntityRef, getHref, getIngestionPipelines, getLatestExtensionFromTimeseries, getOwner, getOwner, getParent, getReference, getReferenceByName, getResultList, getResultList, getResultsFromAndToTimestamps, getResultsFromAndToTimestamps, getReviewers, getTags, getTags, getToEntityRef, getVersion, getVotes, importFromCsv, initializeEntity, initSeedDataFromResources, listAfter, listAfterWithSkipFailure, listAll, listBefore, listVersions, patch, populateOwner, postCreate, postDelete, postUpdate, preDelete, prepareInternal, removeExtension, restoreEntity, setFieldsInternal, store, storeExtension, storeOwner, storeRelationshipsInternal, storeTimeSeries, storeTimeSeriesWithOperation, update, updateOwner, updateVote, validateOwner, validateRoles, validateUsers, withHref
-
-
-
-
Field Detail
-
FIELD_RELATION_COLUMN_TYPE
public static final String FIELD_RELATION_COLUMN_TYPE
- See Also:
- Constant Field Values
-
FIELD_RELATION_TABLE_TYPE
public static final String FIELD_RELATION_TABLE_TYPE
- See Also:
- Constant Field Values
-
TABLE_PROFILE_EXTENSION
public static final String TABLE_PROFILE_EXTENSION
- See Also:
- Constant Field Values
-
SYSTEM_PROFILE_EXTENSION
public static final String SYSTEM_PROFILE_EXTENSION
- See Also:
- Constant Field Values
-
TABLE_COLUMN_PROFILE_EXTENSION
public static final String TABLE_COLUMN_PROFILE_EXTENSION
- See Also:
- Constant Field Values
-
TABLE_SAMPLE_DATA_EXTENSION
public static final String TABLE_SAMPLE_DATA_EXTENSION
- See Also:
- Constant Field Values
-
TABLE_PROFILER_CONFIG_EXTENSION
public static final String TABLE_PROFILER_CONFIG_EXTENSION
- See Also:
- Constant Field Values
-
TABLE_COLUMN_EXTENSION
public static final String TABLE_COLUMN_EXTENSION
- See Also:
- Constant Field Values
-
CUSTOM_METRICS_EXTENSION
public static final String CUSTOM_METRICS_EXTENSION
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TableRepository
public TableRepository(CollectionDAO daoCollection)
-
-
Method Detail
-
setFields
public Table setFields(Table table, EntityUtil.Fields fields)
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
public Table clearFields(Table table, EntityUtil.Fields fields)
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
public Table setInheritedFields(Table table, EntityUtil.Fields fields)
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:
for an example implementation
-
restorePatchAttributes
public void restorePatchAttributes(Table original, Table updated)
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
public void setFullyQualifiedName(Table table)
Description copied from class:EntityRepositorySet fullyQualifiedName of an entity- Overrides:
setFullyQualifiedNamein classEntityRepository<Table>
-
addJoins
public Table addJoins(UUID tableId, TableJoins joins)
-
getTableProfilerConfig
public TableProfilerConfig getTableProfilerConfig(Table table)
-
addTableProfilerConfig
public Table addTableProfilerConfig(UUID tableId, TableProfilerConfig tableProfilerConfig)
-
addTableProfileData
public Table addTableProfileData(UUID tableId, CreateTableProfile createTableProfile)
-
getTableProfiles
public ResultList<TableProfile> getTableProfiles(String fqn, Long startTs, Long endTs)
-
getColumnProfiles
public ResultList<ColumnProfile> getColumnProfiles(String fqn, Long startTs, Long endTs)
-
getSystemProfiles
public ResultList<SystemProfile> getSystemProfiles(String fqn, Long startTs, Long endTs)
-
addCustomMetric
public Table addCustomMetric(UUID tableId, CustomMetric customMetric)
-
deleteCustomMetric
public Table deleteCustomMetric(UUID tableId, String columnName, String metricName)
-
prepare
public void prepare(Table table)
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:
for an example implementation
-
storeEntity
public void storeEntity(Table table, boolean update)
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:
for an example implementation
-
storeRelationships
public void storeRelationships(Table table)
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:
for an example implementation
-
getUpdater
public EntityRepository.EntityUpdater getUpdater(Table original, Table updated, EntityRepository.Operation operation)
- Overrides:
getUpdaterin classEntityRepository<Table>
-
applyTags
public void applyTags(Table table)
- Overrides:
applyTagsin classEntityRepository<Table>
-
getAllTags
public List<TagLabel> getAllTags(EntityInterface entity)
- Overrides:
getAllTagsin classEntityRepository<Table>
-
update
public void update(TaskDetails task, MessageParser.EntityLink entityLink, String newValue, String user)
Description copied from class:EntityRepositoryUpdate an entity based suggested description and tags in the task- Overrides:
updatein classEntityRepository<Table>
-
-