Cassandra
Important Capabilities
Capability | Status | Notes |
---|---|---|
Asset Containers | ✅ | Enabled by default |
Detect Deleted Entities | ✅ | Optionally enabled via stateful_ingestion.remove_stale_metadata |
Platform Instance | ✅ | Enabled by default |
Schema Metadata | ✅ | Enabled by default |
This plugin extracts the following:
- Metadata for tables
- Column types associated with each table column
- The keyspace each table belongs to
CLI based Ingestion
Install the Plugin
The cassandra
source works out of the box with acryl-datahub
.
Starter 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: "cassandra"
config:
# Coordinates
contact_point: "localhost"
port: 9042
# Credentials
username: "admin"
password: "password"
#cloud astra db
#cloud_config:
# secure_connect_bundle: "Path to Secure Connect Bundle (.zip)"
# token: "Application Token"
# Options
keyspace_pattern:
allow: [".*"]
sink:
# config sinks
Config Details
- Options
- Schema
Note that a .
is used to denote nested fields in the YAML recipe.
Field | Description |
---|---|
contact_point string | Domain or IP address of the Cassandra instance (excluding port). Default: localhost |
password string | Password credential associated with the specified username. |
platform_instance string | The instance of the platform that all assets produced by this recipe belong to. This should be unique within the platform. See https://datahubproject.io/docs/platform-instances/ for more details. |
port integer | Port number to connect to the Cassandra instance. Default: 9042 |
username string | Username credential with read access to the system_schema keyspace. |
env string | The environment that all assets produced by this connector belong to Default: PROD |
cloud_config CassandraCloudConfig | Configuration for cloud-based Cassandra, such as DataStax Astra DB. |
cloud_config.connect_timeout integer | Timeout in seconds for establishing new connections to Cassandra. Default: 60 |
cloud_config.request_timeout integer | Timeout in seconds for individual Cassandra requests. Default: 60 |
cloud_config.secure_connect_bundle string | File path to the Secure Connect Bundle (.zip) used for a secure connection to DataStax Astra DB. Default: |
cloud_config.token string | The Astra DB application token used for authentication. Default: |
keyspace_pattern AllowDenyPattern | Regex patterns to filter keyspaces for ingestion. Default: {'allow': ['.*'], 'deny': [], 'ignoreCase': True} |
keyspace_pattern.ignoreCase boolean | Whether to ignore case sensitivity during pattern matching. Default: True |
keyspace_pattern.allow array | List of regex patterns to include in ingestion Default: ['.*'] |
keyspace_pattern.allow.string string | |
keyspace_pattern.deny array | List of regex patterns to exclude from ingestion. Default: [] |
keyspace_pattern.deny.string string | |
table_pattern AllowDenyPattern | Regex patterns to filter keyspaces.tables for ingestion. Default: {'allow': ['.*'], 'deny': [], 'ignoreCase': True} |
table_pattern.ignoreCase boolean | Whether to ignore case sensitivity during pattern matching. Default: True |
table_pattern.allow array | List of regex patterns to include in ingestion Default: ['.*'] |
table_pattern.allow.string string | |
table_pattern.deny array | List of regex patterns to exclude from ingestion. Default: [] |
table_pattern.deny.string string | |
stateful_ingestion StatefulStaleMetadataRemovalConfig | Configuration for stateful ingestion and stale metadata removal. |
stateful_ingestion.enabled boolean | Whether or not to enable stateful ingest. Default: True if a pipeline_name is set and either a datahub-rest sink or datahub_api is specified, otherwise False Default: False |
stateful_ingestion.remove_stale_metadata boolean | Soft-deletes the entities present in the last successful run but missing in the current run with stateful_ingestion enabled. Default: True |
The JSONSchema for this configuration is inlined below.
{
"title": "CassandraSourceConfig",
"description": "Configuration for connecting to a Cassandra or DataStax Astra DB source.",
"type": "object",
"properties": {
"env": {
"title": "Env",
"description": "The environment that all assets produced by this connector belong to",
"default": "PROD",
"type": "string"
},
"stateful_ingestion": {
"title": "Stateful Ingestion",
"description": "Configuration for stateful ingestion and stale metadata removal.",
"allOf": [
{
"$ref": "#/definitions/StatefulStaleMetadataRemovalConfig"
}
]
},
"platform_instance": {
"title": "Platform Instance",
"description": "The instance of the platform that all assets produced by this recipe belong to. This should be unique within the platform. See https://datahubproject.io/docs/platform-instances/ for more details.",
"type": "string"
},
"contact_point": {
"title": "Contact Point",
"description": "Domain or IP address of the Cassandra instance (excluding port).",
"default": "localhost",
"type": "string"
},
"port": {
"title": "Port",
"description": "Port number to connect to the Cassandra instance.",
"default": 9042,
"type": "integer"
},
"username": {
"title": "Username",
"description": "Username credential with read access to the system_schema keyspace.",
"type": "string"
},
"password": {
"title": "Password",
"description": "Password credential associated with the specified username.",
"type": "string"
},
"cloud_config": {
"title": "Cloud Config",
"description": "Configuration for cloud-based Cassandra, such as DataStax Astra DB.",
"allOf": [
{
"$ref": "#/definitions/CassandraCloudConfig"
}
]
},
"keyspace_pattern": {
"title": "Keyspace Pattern",
"description": "Regex patterns to filter keyspaces for ingestion.",
"default": {
"allow": [
".*"
],
"deny": [],
"ignoreCase": true
},
"allOf": [
{
"$ref": "#/definitions/AllowDenyPattern"
}
]
},
"table_pattern": {
"title": "Table Pattern",
"description": "Regex patterns to filter keyspaces.tables for ingestion.",
"default": {
"allow": [
".*"
],
"deny": [],
"ignoreCase": true
},
"allOf": [
{
"$ref": "#/definitions/AllowDenyPattern"
}
]
}
},
"additionalProperties": false,
"definitions": {
"DynamicTypedStateProviderConfig": {
"title": "DynamicTypedStateProviderConfig",
"type": "object",
"properties": {
"type": {
"title": "Type",
"description": "The type of the state provider to use. For DataHub use `datahub`",
"type": "string"
},
"config": {
"title": "Config",
"description": "The configuration required for initializing the state provider. Default: The datahub_api config if set at pipeline level. Otherwise, the default DatahubClientConfig. See the defaults (https://github.com/datahub-project/datahub/blob/master/metadata-ingestion/src/datahub/ingestion/graph/client.py#L19).",
"default": {},
"type": "object"
}
},
"required": [
"type"
],
"additionalProperties": false
},
"StatefulStaleMetadataRemovalConfig": {
"title": "StatefulStaleMetadataRemovalConfig",
"description": "Base specialized config for Stateful Ingestion with stale metadata removal capability.",
"type": "object",
"properties": {
"enabled": {
"title": "Enabled",
"description": "Whether or not to enable stateful ingest. Default: True if a pipeline_name is set and either a datahub-rest sink or `datahub_api` is specified, otherwise False",
"default": false,
"type": "boolean"
},
"remove_stale_metadata": {
"title": "Remove Stale Metadata",
"description": "Soft-deletes the entities present in the last successful run but missing in the current run with stateful_ingestion enabled.",
"default": true,
"type": "boolean"
}
},
"additionalProperties": false
},
"CassandraCloudConfig": {
"title": "CassandraCloudConfig",
"description": "Configuration for connecting to DataStax Astra DB in the cloud.",
"type": "object",
"properties": {
"token": {
"title": "Token",
"description": "The Astra DB application token used for authentication.",
"default": "",
"type": "string"
},
"secure_connect_bundle": {
"title": "Secure Connect Bundle",
"description": "File path to the Secure Connect Bundle (.zip) used for a secure connection to DataStax Astra DB.",
"default": "",
"type": "string"
},
"connect_timeout": {
"title": "Connect Timeout",
"description": "Timeout in seconds for establishing new connections to Cassandra.",
"default": 60,
"type": "integer"
},
"request_timeout": {
"title": "Request Timeout",
"description": "Timeout in seconds for individual Cassandra requests.",
"default": 60,
"type": "integer"
}
},
"additionalProperties": false
},
"AllowDenyPattern": {
"title": "AllowDenyPattern",
"description": "A class to store allow deny regexes",
"type": "object",
"properties": {
"allow": {
"title": "Allow",
"description": "List of regex patterns to include in ingestion",
"default": [
".*"
],
"type": "array",
"items": {
"type": "string"
}
},
"deny": {
"title": "Deny",
"description": "List of regex patterns to exclude from ingestion.",
"default": [],
"type": "array",
"items": {
"type": "string"
}
},
"ignoreCase": {
"title": "Ignorecase",
"description": "Whether to ignore case sensitivity during pattern matching.",
"default": true,
"type": "boolean"
}
},
"additionalProperties": false
}
}
}
Code Coordinates
- Class Name:
datahub.ingestion.source.cassandra.cassandra.CassandraSource
- Browse on GitHub
Questions
If you've got any questions on configuring ingestion for Cassandra, feel free to ping us on our Slack.
Is this page helpful?