Skip to content

Add tp_index field to partition - this may specify a column name or transform used to populate the tp_index column #414

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
kaidaguerre opened this issue May 15, 2025 · 0 comments
Assignees

Comments

@kaidaguerre
Copy link
Contributor

kaidaguerre commented May 15, 2025

A user may optionally choose to use a column as an index on a per-partition basis, eg:

 partition "aws_cloudtrail_log" "s3_bucket_us_east_1" {
    source "aws_s3_bucket" {
      connection  = connection.aws.account_a
      bucket      = "aws-cloudtrail-logs-account-a"
      file_layout = `AWSLogs/(%{DATA:org_id}/)?%{NUMBER:account_id}/CloudTrail/us-east-1/%{DATA}.json.gz`   
    }
    tp_index = "account_id"
  }

The user may create a "composite index" by using a function instead. The syntax should be the same as for the transform column argument:

  partition "aws_cloudtrail_log" "s3_bucket_us_east_1" {
    source "aws_s3_bucket" {
      connection  = connection.aws.account_a
      bucket      = "aws-cloudtrail-logs-account-a"
      file_layout = `AWSLogs/(%{DATA:org_id}/)?%{NUMBER:account_id}/CloudTrail/us-east-1/%{DATA}.json.gz`   
    }
    tp_index = "concat(account_id, '_', region)"
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant