-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
49 changed files
with
1,517 additions
and
598 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
-- update service type to UnityCatalog - update database entity | ||
UPDATE database_entity de | ||
SET de.json = JSON_INSERT( | ||
JSON_REMOVE(de.json, '$.serviceType'), | ||
'$.serviceType', | ||
'UnityCatalog' | ||
) | ||
where id in ( | ||
select toId from entity_relationship er | ||
where | ||
fromEntity = 'databaseService' | ||
and toEntity = 'database' | ||
and fromId in ( | ||
select id from dbservice_entity dbe | ||
where | ||
serviceType = 'Databricks' | ||
and JSON_EXTRACT( | ||
dbe.json, '$.connection.config.useUnityCatalog' | ||
) = true | ||
)); | ||
|
||
|
||
-- update service type to UnityCatalog - update database schema entity | ||
UPDATE database_schema_entity dse | ||
SET dse.json = JSON_INSERT( | ||
JSON_REMOVE(dse.json, '$.serviceType'), | ||
'$.serviceType', | ||
'UnityCatalog' | ||
) | ||
where JSON_EXTRACT(dse.json, '$.database.id') in ( | ||
select toId from entity_relationship er | ||
where | ||
fromEntity = 'databaseService' | ||
and toEntity = 'database' | ||
and fromId in ( | ||
select id from dbservice_entity dbe | ||
where | ||
serviceType = 'Databricks' | ||
and JSON_EXTRACT( | ||
dbe.json, '$.connection.config.useUnityCatalog' | ||
) = true | ||
)); | ||
|
||
|
||
-- update service type to UnityCatalog - update table entity | ||
UPDATE table_entity te | ||
SET te.json = JSON_INSERT( | ||
JSON_REMOVE(te.json, '$.serviceType'), | ||
'$.serviceType', | ||
'UnityCatalog' | ||
) | ||
where JSON_EXTRACT(te.json, '$.database.id') in ( | ||
select toId from entity_relationship er | ||
where | ||
fromEntity = 'databaseService' | ||
and toEntity = 'database' | ||
and fromId in ( | ||
select id from dbservice_entity dbe | ||
where | ||
serviceType = 'Databricks' | ||
and JSON_EXTRACT( | ||
dbe.json, '$.connection.config.useUnityCatalog' | ||
) = true | ||
)); | ||
|
||
|
||
-- update service type to UnityCatalog - update db service entity | ||
UPDATE dbservice_entity de | ||
SET de.json = JSON_INSERT( | ||
JSON_REMOVE(de.json, '$.connection.config.type'), | ||
'$.connection.config.type', | ||
'UnityCatalog' | ||
),de.json = JSON_INSERT( | ||
JSON_REMOVE(de.json, '$.serviceType'), | ||
'$.serviceType', | ||
'UnityCatalog' | ||
) | ||
WHERE de.serviceType = 'Databricks' | ||
AND JSON_EXTRACT(de.json, '$.connection.config.useUnityCatalog') = True | ||
; | ||
|
||
-- remove `useUnityCatalog` flag from service connection details of databricks | ||
UPDATE dbservice_entity de | ||
SET de.json = JSON_REMOVE(de.json, '$.connection.config.useUnityCatalog') | ||
WHERE de.serviceType IN ('Databricks','UnityCatalog'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
ingestion/src/metadata/examples/workflows/unity_catalog.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
source: | ||
type: unitycatalog | ||
serviceName: local_unitycatalog | ||
serviceConnection: | ||
config: | ||
type: UnityCatalog | ||
catalog: hive_metastore | ||
databaseSchema: default | ||
token: <databricks token> | ||
hostPort: localhost:443 | ||
connectionTimeout: 120 | ||
connectionArguments: | ||
http_path: <http path of databricks cluster> | ||
|
||
sourceConfig: | ||
config: | ||
type: DatabaseMetadata | ||
sink: | ||
type: metadata-rest | ||
config: {} | ||
workflowConfig: | ||
loggerLevel: DEBUG | ||
openMetadataServerConfig: | ||
hostPort: http://localhost:8585/api | ||
authProvider: openmetadata | ||
securityConfig: | ||
jwtToken: "eyJraWQiOiJHYjM4OWEtOWY3Ni1nZGpzLWE5MmotMDI0MmJrOTQzNTYiLCJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJhZG1pbiIsImlzQm90IjpmYWxzZSwiaXNzIjoib3Blbi1tZXRhZGF0YS5vcmciLCJpYXQiOjE2NjM5Mzg0NjIsImVtYWlsIjoiYWRtaW5Ab3Blbm1ldGFkYXRhLm9yZyJ9.tS8um_5DKu7HgzGBzS1VTA5uUjKWOCU0B_j08WXBiEC0mr0zNREkqVfwFDD-d24HlNEbrqioLsBuFRiwIWKc1m_ZlVQbG7P36RUxhuv2vbSp80FKyNM-Tj93FDzq91jsyNmsQhyNv_fNr3TXfzzSPjHt8Go0FMMP66weoKMgW2PbXlhVKwEuXUHyakLLzewm9UMeQaEiRzhiTMU3UkLXcKbYEJJvfNFcLwSl9W8JCO_l0Yj3ud-qt_nQYEZwqW6u5nfdQllN133iikV4fM5QZsMCnm8Rq1mvLR0y9bmJiD7fwM1tmJ791TUWqmKaTnP49U493VanKpUAfzIiOiIbhg" |
18 changes: 18 additions & 0 deletions
18
ingestion/src/metadata/examples/workflows/unity_catalog_lineage.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
source: | ||
type: unitycatalog-lineage | ||
serviceName: local_unitycatalog | ||
sourceConfig: | ||
config: | ||
type: DatabaseLineage | ||
queryLogDuration: 1 | ||
resultLimit: 10000 | ||
sink: | ||
type: metadata-rest | ||
config: {} | ||
workflowConfig: | ||
loggerLevel: DEBUG | ||
openMetadataServerConfig: | ||
hostPort: http://localhost:8585/api | ||
authProvider: openmetadata | ||
securityConfig: | ||
jwtToken: "eyJraWQiOiJHYjM4OWEtOWY3Ni1nZGpzLWE5MmotMDI0MmJrOTQzNTYiLCJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJhZG1pbiIsImlzQm90IjpmYWxzZSwiaXNzIjoib3Blbi1tZXRhZGF0YS5vcmciLCJpYXQiOjE2NjM5Mzg0NjIsImVtYWlsIjoiYWRtaW5Ab3Blbm1ldGFkYXRhLm9yZyJ9.tS8um_5DKu7HgzGBzS1VTA5uUjKWOCU0B_j08WXBiEC0mr0zNREkqVfwFDD-d24HlNEbrqioLsBuFRiwIWKc1m_ZlVQbG7P36RUxhuv2vbSp80FKyNM-Tj93FDzq91jsyNmsQhyNv_fNr3TXfzzSPjHt8Go0FMMP66weoKMgW2PbXlhVKwEuXUHyakLLzewm9UMeQaEiRzhiTMU3UkLXcKbYEJJvfNFcLwSl9W8JCO_l0Yj3ud-qt_nQYEZwqW6u5nfdQllN133iikV4fM5QZsMCnm8Rq1mvLR0y9bmJiD7fwM1tmJ791TUWqmKaTnP49U493VanKpUAfzIiOiIbhg" |
35 changes: 35 additions & 0 deletions
35
ingestion/src/metadata/examples/workflows/unity_catalog_usage.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
source: | ||
type: unitycatalog-usage | ||
serviceName: local_unitycatalog | ||
serviceConnection: | ||
config: | ||
type: UnityCatalog | ||
catalog: hive_metastore | ||
databaseSchema: default | ||
token: <databricks token> | ||
hostPort: localhost:443 | ||
connectionTimeout: 120 | ||
connectionArguments: | ||
http_path: <http path of databricks cluster> | ||
sourceConfig: | ||
config: | ||
type: DatabaseUsage | ||
queryLogDuration: 10 | ||
processor: | ||
type: query-parser | ||
config: {} | ||
stage: | ||
type: table-usage | ||
config: | ||
filename: /tmp/databricks_usage | ||
bulkSink: | ||
type: metadata-usage | ||
config: | ||
filename: /tmp/databricks_usage | ||
workflowConfig: | ||
loggerLevel: DEBUG | ||
openMetadataServerConfig: | ||
hostPort: http://localhost:8585/api | ||
authProvider: openmetadata | ||
securityConfig: | ||
jwtToken: "eyJraWQiOiJHYjM4OWEtOWY3Ni1nZGpzLWE5MmotMDI0MmJrOTQzNTYiLCJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJhZG1pbiIsImlzQm90IjpmYWxzZSwiaXNzIjoib3Blbi1tZXRhZGF0YS5vcmciLCJpYXQiOjE2NjM5Mzg0NjIsImVtYWlsIjoiYWRtaW5Ab3Blbm1ldGFkYXRhLm9yZyJ9.tS8um_5DKu7HgzGBzS1VTA5uUjKWOCU0B_j08WXBiEC0mr0zNREkqVfwFDD-d24HlNEbrqioLsBuFRiwIWKc1m_ZlVQbG7P36RUxhuv2vbSp80FKyNM-Tj93FDzq91jsyNmsQhyNv_fNr3TXfzzSPjHt8Go0FMMP66weoKMgW2PbXlhVKwEuXUHyakLLzewm9UMeQaEiRzhiTMU3UkLXcKbYEJJvfNFcLwSl9W8JCO_l0Yj3ud-qt_nQYEZwqW6u5nfdQllN133iikV4fM5QZsMCnm8Rq1mvLR0y9bmJiD7fwM1tmJ791TUWqmKaTnP49U493VanKpUAfzIiOiIbhg" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.