Skip to main content

Glue

Module glue

Certified

Important Capabilities

CapabilityStatusNotes
DomainsSupported via the domain config field
Platform InstanceEnabled by default

Note: if you also have files in S3 that you'd like to ingest, we recommend you use Glue's built-in data catalog. See here for a quick guide on how to set up a crawler on Glue and ingest the outputs with DataHub.

This plugin extracts the following:

  • Tables in the Glue catalog
  • Column types associated with each table
  • Table metadata, such as owner, description and parameters
  • Jobs and their component transformations, data sources, and data sinks

IAM permissions

For ingesting datasets, the following IAM permissions are required:

{
"Effect": "Allow",
"Action": [
"glue:GetDatabases",
"glue:GetTables"
],
"Resource": [
"arn:aws:glue:$region-id:$account-id:catalog",
"arn:aws:glue:$region-id:$account-id:database/*",
"arn:aws:glue:$region-id:$account-id:table/*"
]
}

For ingesting jobs (extract_transforms: True), the following additional permissions are required:

{
"Effect": "Allow",
"Action": [
"glue:GetDataflowGraph",
"glue:GetJobs",
],
"Resource": "*"
}

plus s3:GetObject for the job script locations.

Install the Plugin

pip install 'acryl-datahub[glue]'

Quickstart Recipe

Check out the following recipe to get started with ingestion! See below for full configuration options.

For general pointers on writing and running a recipe, see our main recipe guide

source:
type: glue
config:
# Coordinates
aws_region: "my-aws-region"

sink:
# sink configs

Config Details

Note that a . is used to denote nested fields in the YAML recipe.

View All Configuration Options
FieldRequiredTypeDescriptionDefault
row_countstringThe parameter name for row count in glue table.None
column_countstringThe parameter name for column count in glue table.None
unique_countstringThe parameter name for the count of unique value in a column.None
unique_proportionstringThe parameter name for the proportion of unique values in a column.None
null_countintegerThe parameter name for the count of null values in a column.None
null_proportionstringThe parameter name for the proportion of null values in a column.None
minstringThe parameter name for the min value of a column.None
maxstringThe parameter name for the max value of a column.None
meanstringThe parameter name for the mean value of a column.None
medianstringThe parameter name for the median value of a column.None
stdevstringThe parameter name for the standard deviation of a column.None
platformstringThe platform that this source connects toNone
platform_instancestringThe instance of the platform that all assets produced by this recipe belong toNone
aws_access_key_idstringAutodetected. See https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.htmlNone
aws_secret_access_keystringAutodetected. See https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.htmlNone
aws_session_tokenstringAutodetected. See https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.htmlNone
aws_roleGeneric dictAutodetected. See https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.htmlNone
aws_profilestringNamed AWS profile to use, if not set the default will be usedNone
aws_regionstringAWS region code.None
aws_endpoint_urlstringAutodetected. See https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.htmlNone
aws_proxyDict[str,string]Autodetected. See https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html
envstringThe environment that all assets produced by this connector belong toPROD
extract_ownersbooleanWhen enabled, extracts ownership from Glue directly and overwrites existing owners. When disabled, ownership is left empty for datasets.True
extract_transformsbooleanWhether to extract Glue transform jobs.True
underlying_platformstring@deprecated(Use platform) Override for platform name. Allowed values - glue, athenaNone
ignore_unsupported_connectorsbooleanWhether to ignore unsupported connectors. If disabled, an error will be raised.True
emit_s3_lineagebooleanWhether to emit S3-to-Glue lineage.False
glue_s3_lineage_directionstringIf upstream, S3 is upstream to Glue. If downstream S3 is downstream to Glue.upstream
catalog_idstringThe aws account id where the target glue catalog lives. If None, datahub will ingest glue in aws caller's account.None
use_s3_bucket_tagsbooleanIf an S3 Buckets Tags should be created for the Tables ingested by Glue. Please Note that this will not apply tags to any folders ingested, only the files.False
use_s3_object_tagsbooleanIf an S3 Objects Tags should be created for the Tables ingested by Glue.False
partition_patternsAllowDenyPattern (see below for fields)Regex patterns for filtering partitions for profile. The pattern should be a string like: "{'key':'value'}".{'allow': ['.*'], 'deny': [], 'ignoreCase': True, 'alphabet': '[A-Za-z0-9 _.-]'}
partition_patterns.allowArray of stringList of regex patterns for process groups to include in ingestion['.*']
partition_patterns.denyArray of stringList of regex patterns for process groups to exclude from ingestion.[]
partition_patterns.ignoreCasebooleanWhether to ignore case sensitivity during pattern matching.True
partition_patterns.alphabetstringAllowed alphabets pattern[A-Za-z0-9 _.-]
database_patternAllowDenyPattern (see below for fields)regex patterns for databases to filter in ingestion.{'allow': ['.*'], 'deny': [], 'ignoreCase': True, 'alphabet': '[A-Za-z0-9 _.-]'}
database_pattern.allowArray of stringList of regex patterns for process groups to include in ingestion['.*']
database_pattern.denyArray of stringList of regex patterns for process groups to exclude from ingestion.[]
database_pattern.ignoreCasebooleanWhether to ignore case sensitivity during pattern matching.True
database_pattern.alphabetstringAllowed alphabets pattern[A-Za-z0-9 _.-]
table_patternAllowDenyPattern (see below for fields)regex patterns for tables to filter in ingestion.{'allow': ['.*'], 'deny': [], 'ignoreCase': True, 'alphabet': '[A-Za-z0-9 _.-]'}
table_pattern.allowArray of stringList of regex patterns for process groups to include in ingestion['.*']
table_pattern.denyArray of stringList of regex patterns for process groups to exclude from ingestion.[]
table_pattern.ignoreCasebooleanWhether to ignore case sensitivity during pattern matching.True
table_pattern.alphabetstringAllowed alphabets pattern[A-Za-z0-9 _.-]
domainDict[str, AllowDenyPattern]regex patterns for tables to filter to assign domain_key.{}
domain.key.allowArray of stringList of regex patterns for process groups to include in ingestion['.*']
domain.key.denyArray of stringList of regex patterns for process groups to exclude from ingestion.[]
domain.key.ignoreCasebooleanWhether to ignore case sensitivity during pattern matching.True
domain.key.alphabetstringAllowed alphabets pattern[A-Za-z0-9 _.-]
profilingGlueProfilingConfig (see below for fields)Configs to ingest data profiles from glue table
profiling.row_countstringThe parameter name for row count in glue table.None
profiling.column_countstringThe parameter name for column count in glue table.None
profiling.unique_countstringThe parameter name for the count of unique value in a column.None
profiling.unique_proportionstringThe parameter name for the proportion of unique values in a column.None
profiling.null_countintegerThe parameter name for the count of null values in a column.None
profiling.null_proportionstringThe parameter name for the proportion of null values in a column.None
profiling.minstringThe parameter name for the min value of a column.None
profiling.maxstringThe parameter name for the max value of a column.None
profiling.meanstringThe parameter name for the mean value of a column.None
profiling.medianstringThe parameter name for the median value of a column.None
profiling.stdevstringThe parameter name for the standard deviation of a column.None
profiling.partition_patternsAllowDenyPattern (see below for fields)Regex patterns for filtering partitions for profile. The pattern should be a string like: "{'key':'value'}".{'allow': ['.*'], 'deny': [], 'ignoreCase': True, 'alphabet': '[A-Za-z0-9 _.-]'}
profiling.partition_patterns.allowArray of stringList of regex patterns for process groups to include in ingestion['.*']
profiling.partition_patterns.denyArray of stringList of regex patterns for process groups to exclude from ingestion.[]
profiling.partition_patterns.ignoreCasebooleanWhether to ignore case sensitivity during pattern matching.True
profiling.partition_patterns.alphabetstringAllowed alphabets pattern[A-Za-z0-9 _.-]

Compatibility

To capture lineage across Glue jobs and databases, a requirements must be met – otherwise the AWS API is unable to report any lineage. The job must be created in Glue Studio with the "Generate classic script" option turned on (this option can be accessed in the "Script" tab). Any custom scripts that do not have the proper annotations will not have reported lineage.

Code Coordinates

  • Class Name: datahub.ingestion.source.aws.glue.GlueSource
  • Browse on GitHub

Questions

If you've got any questions on configuring ingestion for Glue, feel free to ping us on our Slack