This file contains hidden or 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
| SELECT f.SCHEMA_NAME AS SCHEMA_NAME, | |
| f.FUNCTION_NAME AS function_name, | |
| f.INPUT_PARAMETER_COUNT AS input_parameter_count, | |
| f.RETURN_VALUE_COUNT AS return_value_count, | |
| f.DEFINITION AS definition, | |
| f.IS_VALID AS is_valid, | |
| f.OWNER_NAME AS owner_name, | |
| f.CREATE_TIME AS create_time | |
| FROM SYS.FUNCTIONS f | |
| // ... Omitted to improve readability |
This file contains hidden or 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
| { | |
| "key": "functions", | |
| "type": "function", | |
| "name": "function_name", | |
| "fields": [ | |
| { | |
| "source": "schema_name", | |
| "target": { | |
| "field_name": "schema_name", | |
| "model": "tag", |
This file contains hidden or 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
| CREATE TABLE credit_tab_pii (Name varchar(20), CREDIT_CARD varchar(19)) | |
| WITH MASK (CREDIT_CARD USING credit_mask(credit_card)); |
This file contains hidden or 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
| CREATE FUNCTION credit_mask(input varchar(19)) RETURNS output VARCHAR(19) | |
| LANGUAGE SQLSCRIPT | |
| AS | |
| BEGIN | |
| output = LEFT(:input,4) || '-XXXX-XXXX-' || RIGHT(:input,4); | |
| END; |
This file contains hidden or 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
| google-datacatalog-saphana-connector \ | |
| --datacatalog-project-id $SAPHANA2DC_DATACATALOG_PROJECT_ID \ | |
| --datacatalog-location-id $SAPHANA2DC_DATACATALOG_LOCATION_ID \ | |
| --saphana-host $SAPHANA2DC_SAPHANA_SERVER \ | |
| --saphana-user $SAPHANA2DC_SAPHANA_USERNAME \ | |
| --saphana-pass $SAPHANA2DC_SAPHANA_PASSWORD \ | |
| --saphana-database $SAPHANA2DC_SAPHANA_DATABASE |
This file contains hidden or 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
| 2.2. Set environment variables | |
| Replace below values according to your environment: | |
| export SAPHANA2DC_DATACATALOG_PROJECT_ID=google_cloud_project_id | |
| export SAPHANA2DC_DATACATALOG_LOCATION_ID=google_cloud_location_id | |
| export SAPHANA2DC_SAPHANA_SERVER=saphana_server | |
| export SAPHANA2DC_SAPHANA_USERNAME=saphana_username | |
| export SAPHANA2DC_SAPHANA_PASSWORD=saphana_password | |
| export SAPHANA2DC_SAPHANA_DATABASE=saphana_database |
This file contains hidden or 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
| pip3 install google-datacatalog-saphana-connector --user | |
| export PATH=~/.local/bin:$PATH | |
| google-datacatalog-saphana-connector --help |
This file contains hidden or 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
| # Set Up the Service Account | |
| # Start by setting your project ID. Replace the placeholder to your project. | |
| gcloud config set project MY_PROJECT_PLACEHOLDER | |
| # Next load it in a environment variable. | |
| export PROJECT_ID=$(gcloud config get-value project) | |
| # Then create a Service Account. | |
| gcloud iam service-accounts create saphana2dc-workload-sa \ |
This file contains hidden or 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
| # After that, let's get Terraform started. | |
| # Run the following to pull in the providers. | |
| terraform init | |
| # With the providers downloaded and terraform variables set, | |
| # you're ready to use Terraform. Go ahead! | |
| # Plan first to validate the execution | |
| terraform plan -input=false -out=tfplan -var-file=".tfvars" |
This file contains hidden or 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
| tag_central_project_id="tag-central-project" | |
| datacatalog_analytics_projects_id=["my-analytics-project-1","my-analytics-project-2"] | |
| datacatalog_resources_sa_name="terraform-dc-resources-sa" | |
| tag_template_region="us" | |
| datacatalog_data_governor_members=["user:john_data_governor@datacompany.com", "group:data_governors@datacompany.com"] | |
| datacatalog_data_curator_members=["user:john_data_curator@datacompany.com", "group:data_curators@datacompany.com"] | |
| datacatalog_data_analyst_members=["user:john_data_analytic@datacompany.com", "group:data_analytics@datacompany.com"] |