Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(SMO Relationship onboarding - HackWeek): Make initMgEntityTypeNameSet public #494

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Made the method initMgEntityTypeNameSet public to use it in GQS to dy…
…namically load the entity tables
Rakhi Agrawal committed Jan 16, 2025
commit 752a292a25c4850577bcd7786e48f715a9f5865e
Original file line number Diff line number Diff line change
@@ -260,6 +260,7 @@ protected boolean isMgEntityType(@Nonnull String entityType) {
return _mgEntityTypeNameSet.contains(StringUtils.lowerCase(entityType));
}


/**
* Extracts the table name from an entity urn for MG entities. If entityUrn is not for MG entity, return null.
* @param entityType String representing the type of entity (e.g. "dataset")
@@ -481,7 +482,7 @@ private String buildFindRelationshipSQL(
/**
* Creates a set of MG entity type names by querying the database.
*/
private void initMgEntityTypeNameSet() {
public void initMgEntityTypeNameSet() {
final String sql = "SELECT table_name FROM information_schema.tables"
+ " WHERE table_type = 'BASE TABLE' AND TABLE_SCHEMA=DATABASE() AND table_name LIKE 'metadata_entity_%'";
_mgEntityTypeNameSet = _server.createSqlQuery(sql).findList().stream()