Skip to content

Commit

Permalink
Merge pull request #8432 from mandy-chessell/oak2024
Browse files Browse the repository at this point in the history
Extend Unity Catalog Beans
  • Loading branch information
mandy-chessell authored Oct 6, 2024
2 parents 599fb43 + 08d2e9d commit e05690e
Show file tree
Hide file tree
Showing 70 changed files with 1,906 additions and 564 deletions.
2 changes: 1 addition & 1 deletion EgeriaContentPacksGUIDMap.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content-packs/APIsContentPack.omarchive

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content-packs/ApacheAtlasContentPack.omarchive

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content-packs/ApacheKafkaContentPack.omarchive

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content-packs/CoreContentPack.omarchive

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content-packs/ObservabilityContentPack.omarchive

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content-packs/PostgresContentPack.omarchive

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content-packs/UnityCatalogContentPack.omarchive

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@ Content-Type: application/json
> {% client.global.set("token", response.body); %}


###


###
# @name Load open metadata archive file
# Load a file that contains open metadata types and instances.
POST {{baseURL}}/open-metadata/server-operations/users/garygeeke/servers/active-metadata-store/instance/open-metadata-archives/file
Content-Type: text/plain

content-packs/UnityCatalogContentPack.omarchive

###

@ucServerTemplateGUID=dcca9788-b30f-4007-b1ac-ec634aff6879
Expand Down Expand Up @@ -49,7 +60,7 @@ Content-Type: application/json
# @name createElementFromTemplate (Unity Catalog Server 1)
# Create a new element from a template.
# Further Information: https://egeria-project.org/features/templated-cataloguing/overview/
POST {{baseURL}}/servers/{{viewServer}}/api/open-metadata/automated-curation/catalog-templates/new-element
POST {{baseURL}}/servers/{{viewServer}}/api/open-metadata/automated-curation/catalog-templates/get-element
Authorization: Bearer {{token}}
Content-Type: application/json

Expand Down Expand Up @@ -92,7 +103,7 @@ Content-Type: application/json

###

@server1GUID=5d133ab0-efaf-4c39-aece-0a3f63bb8e63
@server1GUID=4d0fd1df-74d4-4b7f-b1d2-381b9e0c0f3e


###
Expand Down Expand Up @@ -131,7 +142,7 @@ Content-Type: application/json

###

@ucServerSurveyName=AssetSurvey:survey-unity-catalog-server
@ucServerSurveyName=UnityCatalogSurveys:survey-unity-catalog-server

###
# @name initiateGovernanceActionType
Expand All @@ -152,6 +163,27 @@ Content-Type: application/json
}


###
# @name initiateGovernanceActionProcess
# Using the named governance action process as a template, initiate a chain of engine actions.

POST {{baseURL}}/servers/{{viewServer}}/api/open-metadata/automated-curation/governance-action-processes/initiate
Authorization: Bearer {{token}}
Content-Type: application/json

{
"processQualifiedName": "UnityCatalogServer:CreateAndSurveyGovernanceActionProcess",
"requestParameters" : {
"hostURL" : "http://localhost",
"portNumber" : "8080",
"serverName" : "Unity Catalog 1",
"versionIdentifier" : "V1.0",
"description" : "First instance of the Unity Catalog (UC) Server.",
"serverUserId" : "uc1"
}
}



###
# =====================================================================================================================
Expand All @@ -175,13 +207,6 @@ Content-Type: application/json

{
"catalogTargetName" : "uc1",
"templateProperties" : {
"Unity Catalog Catalog" : "{{ucCatalogTemplateGUID}}",
"Unity Catalog Schema" : "{{ucSchemaTemplateGUID}}",
"Unity Catalog Volume" : "{{ucVolumeTemplateGUID}}",
"Unity Catalog Table" : "{{ucTableTemplateGUID}}",
"Unity Catalog Function" : "{{ucFunctionTemplateGUID}}"
},
"configurationProperties" : {
"UnityCatalogFriendshipGUID" : "74dde22f-2249-4ea3-af2b-b39e73f79b81"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import org.odpi.openmetadata.frameworks.openmetadata.controls.PlaceholderProperty;
import org.odpi.openmetadata.frameworks.openmetadata.controls.PlaceholderPropertyType;
import org.odpi.openmetadata.frameworks.openmetadata.types.DataType;

import java.util.ArrayList;
import java.util.List;
Expand All @@ -19,47 +20,82 @@ public enum UnityCatalogPlaceholderProperty
/**
* The name of the catalog being described.
*/
CATALOG_NAME ("ucCatalogName", "The name of a catalog within Unity Catalog (UC).", "string", "my_catalog"),
CATALOG_NAME ("ucCatalogName", "The name of a catalog within Unity Catalog (UC).", DataType.STRING.getName(), "my_catalog"),

/**
* The name of a schema within a catalog in Unity Catalog (UC).
*/
SCHEMA_NAME ("ucSchemaName", "The name of a schema within a catalog in Unity Catalog (UC). This value is combined with the name of the catalog to get the full name.", "string", "my_schema"),
SCHEMA_NAME ("ucSchemaName", "The name of a schema within a catalog in Unity Catalog (UC). This value is combined with the name of the catalog to get the full name.", DataType.STRING.getName(), "my_schema"),

/**
* The identifier of the owner of this element
*/
OWNER ("ucOwner", "The identifier of the owner of this element", DataType.STRING.getName(), null),

/**
* GUID for the associated Hive Metadata Store.
*/
METASTORE_ID("ucMetaStoreId", "GUID for the associated Hive Metadata Store.", DataType.STRING.getName(), null),

/**
* Type of element to secure.
*/
SECURABLE_TYPE("ucSecurableType", "Type of element to secure.", DataType.STRING.getName(), null),

/**
* Kind of security got this element.
*/
SECURABLE_KIND("ucSecurableKind", "Kind of security got this element.", DataType.STRING.getName(), null),

/**
* Can this be updated?
*/
BROWSE_ONLY("ucBrowseOnly", "Can this be updated?", DataType.BOOLEAN.getName(), null),

/**
* Isolation mode, such as OPEN.
*/
ISOLATION_MODE("ucIsolationMode", "Isolation mode, such as OPEN.", DataType.STRING.getName(), null),

/**
* Access mode.
*/
ACCESSIBLE_IN_CURRENT_WORKSPACE("ucAccessibleInCurrentWorkspace", "Access mode.", DataType.BOOLEAN.getName(), null),

/**
* The location where the data associated with this element in Unity Catalog is stored.
*/
STORAGE_LOCATION ("ucStorageLocation", "The location where the data associated with this element in Unity Catalog is stored.", "string", "a/b/c"),
STORAGE_LOCATION ("ucStorageLocation", "The location where the data associated with this element in Unity Catalog is stored.", DataType.STRING.getName(), "a/b/c"),

/**
* The name of a table within a schema and catalog in Unity Catalog (UC).
*/
TABLE_NAME ("ucTableName", "The name of a table within a schema and catalog in Unity Catalog (UC). This value is combined with the name of the schema and catalog to get the full name.", "string", "my_table"),
TABLE_NAME ("ucTableName", "The name of a table within a schema and catalog in Unity Catalog (UC). This value is combined with the name of the schema and catalog to get the full name.", DataType.STRING.getName(), "my_table"),

/**
* The type a table: MANAGED or EXTERNAL.
*/
TABLE_TYPE ("ucTableType", "The type of a table: MANAGED or EXTERNAL.", "string", "MANAGED"),
TABLE_TYPE ("ucTableType", "The type of a table: MANAGED or EXTERNAL.", DataType.STRING.getName(), "MANAGED"),

/**
* The format of the data source: DELTA, CSV, JSON, AVRO, PARQUET, ORC, TEXT.
*/
DATA_SOURCE_FORMAT ("ucDataSourceFormat", "The format of the data source: DELTA, CSV, JSON, AVRO, PARQUET, ORC, TEXT.", "string", "CSV"),
DATA_SOURCE_FORMAT ("ucDataSourceFormat", "The format of the data source: DELTA, CSV, JSON, AVRO, PARQUET, ORC, TEXT.", DataType.STRING.getName(), "CSV"),

/**
* The name of a volume within a schema and catalog in Unity Catalog (UC).
*/
VOLUME_NAME ("ucVolumeName", "The name of a volume within a schema and catalog in Unity Catalog (UC). This value is combined with the name of the schema and catalog to get the full name.", "string", "my_volume"),
VOLUME_NAME ("ucVolumeName", "The name of a volume within a schema and catalog in Unity Catalog (UC). This value is combined with the name of the schema and catalog to get the full name.", DataType.STRING.getName(), "my_volume"),

/**
* The type of volume: MANAGED or EXTERNAL.
*/
VOLUME_TYPE ("ucVolumeType", "The type of a volume: MANAGED or EXTERNAL.", "string", "MANAGED"),
VOLUME_TYPE ("ucVolumeType", "The type of a volume: MANAGED or EXTERNAL.", DataType.STRING.getName(), "MANAGED"),

/**
* The name of a function within a schema and catalog in Unity Catalog (UC).
*/
FUNCTION_NAME ("ucFunctionName", "The name of a function within a schema and catalog in Unity Catalog (UC). This value is combined with the name of the schema and catalog to get the full name.", "string", "my_function"),
FUNCTION_NAME ("ucFunctionName", "The name of a function within a schema and catalog in Unity Catalog (UC). This value is combined with the name of the schema and catalog to get the full name.", DataType.STRING.getName(), "my_function"),

;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,18 @@
import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY;

/**
* Common properties of an element stored in Unity catalog.
* Common properties of an element (Catalog, Schema, Volume, Table, Function) stored in Unity catalog.
*/
@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE)
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown=true)
public class BasicElementProperties
public class BasicElementProperties extends BasicProperties
{
private String name = null;
private String comment = null;

/*
* This property is being remove temporarily since there are inconsistencies in the API over whether this is a
* String or a map. Once this has been resolved, it will be reinstated.
*/
// private Map<String, String> properties = null;
private String metastore_id = null;
private String securable_type = null;
private String securable_kind = null;
private String owner = null;
private boolean browse_only = false;


/**
Expand All @@ -38,63 +35,113 @@ public BasicElementProperties()
}

/**
* Return the unique name of the element within its name space.
* Return the guid is the associated hive metastore.
*
* @return string
* @return guid
*/
public String getName()
public String getMetastore_id()
{
return name;
return metastore_id;
}


/**
* Set up the unique name of the element within its name space.
* Set up the guid is the associated hive metastore.
*
* @param name string name
* @param metastore_id string guid
*/
public void setName(String name)
public void setMetastore_id(String metastore_id)
{
this.name = name;
this.metastore_id = metastore_id;
}


/**
* Return a comment describing the element within its name space.
* Return the type of securable element - eg SCHEMA.
*
* @return text
* @return string name
*/
public String getComment()
public String getSecurable_type()
{
return comment;
return securable_type;
}


/**
* Set up a comment describing the element within its name space.
* Set up the type of securable element - eg SCHEMA.
*
* @param comment text
* @param securable_type string name
*/
public void setComment(String comment)
public void setSecurable_type(String securable_type)
{
this.comment = comment;
this.securable_type = securable_type;
}


/*
* Return arbitrary name-value property pairs.
/**
* Return the kind of securable element eg SCHEMA_STANDARD.
*
* @return property string map
* @return string name
*/
//public Map<String, String> getProperties() {return properties;}
public String getSecurable_kind()
{
return securable_kind;
}


/*
* Set up arbitrary name-value property pairs.
/**
* Set up the kind of securable element eg SCHEMA_STANDARD.
*
* @param properties property string map
* @param securable_kind string name
*/
//public void setProperties(Map<String, String> properties) {this.properties = properties;}
public void setSecurable_kind(String securable_kind)
{
this.securable_kind = securable_kind;
}


/**
* Return the owner of the element.
*
* @return string name
*/
public String getOwner()
{
return owner;
}


/**
* Set up the owner of the element.
*
* @param owner string name
*/
public void setOwner(String owner)
{
this.owner = owner;
}


/**
* Return whether this element is read only or not.
*
* @return boolean flag
*/
public boolean isBrowse_only()
{
return browse_only;
}


/**
* Set up whether this element is read only or not.
*
* @param browse_only boolean flag
*/
public void setBrowse_only(boolean browse_only)
{
this.browse_only = browse_only;
}


/**
Expand All @@ -106,10 +153,12 @@ public void setComment(String comment)
public String toString()
{
return "BasicElementProperties{" +
"name='" + name + '\'' +
", comment='" + comment + '\'' +
// ", properties=" + properties +
'}';
"metastore_id='" + metastore_id + '\'' +
", securable_type='" + securable_type + '\'' +
", securable_kind='" + securable_kind + '\'' +
", owner='" + owner + '\'' +
", browse_only=" + browse_only +
"} " + super.toString();
}


Expand All @@ -124,12 +173,15 @@ public boolean equals(Object objectToCompare)
{
if (this == objectToCompare) return true;
if (objectToCompare == null || getClass() != objectToCompare.getClass()) return false;
if (!super.equals(objectToCompare)) return false;
BasicElementProperties that = (BasicElementProperties) objectToCompare;
return Objects.equals(name, that.name) && Objects.equals(comment, that.comment);
//&& Objects.equals(properties, that.properties);
return browse_only == that.browse_only &&
Objects.equals(metastore_id, that.metastore_id) &&
Objects.equals(securable_type, that.securable_type) &&
Objects.equals(securable_kind, that.securable_kind) &&
Objects.equals(owner, that.owner);
}


/**
* Return hash code based on properties.
*
Expand All @@ -138,6 +190,6 @@ public boolean equals(Object objectToCompare)
@Override
public int hashCode()
{
return Objects.hash(name, comment ); //, properties);
return Objects.hash(metastore_id, securable_type, securable_kind, owner, browse_only);
}
}
Loading

0 comments on commit e05690e

Please sign in to comment.