Skip to content
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

Enable Multipartitioning external tables #7

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

atommych
Copy link

Given two partitioning columns like:

          partitions:
            - name: coin
              data_type: string
              path_macro: value_only
              vals: [
                 'btc',
                 'eth'
              ]
            - name: transactions
              data_type: string
              path_macro: value_only
              vals: [
                '/transactions/date=2024-09-19',
                '/transactions/date=2024-09-20'
              ]

The current result is an alter table that does not nest the partitions:

alter table dbt_athena_external_tables_example.aws_public_blockchain add if not exists 
partition (coin='btc') location 's3://aws-public-blockchain/v1.0/btc/'
partition (coin='eth') location 's3://aws-public-blockchain/v1.0/eth/'
partition (transactions='/transactions/date=2024-09-19') location 's3://aws-public-blockchain/v1.0//transactions/date=2024-09-19/'
partition (transactions='/transactions/date=2024-09-20') location 's3://aws-public-blockchain/v1.0//transactions/date=2024-09-20/'

This PR enable us to have a mult-partitions like:

alter table dbt_athena_external_tables_example.aws_public_blockchain add if not exists 
partition (coin='btc', transactions='/transactions/date=2024-09-19') location 's3://aws-public-blockchain/v1.0/btc/transactions/date=2024-09-19/'
partition (coin='btc', transactions='/transactions/date=2024-09-20') location 's3://aws-public-blockchain/v1.0/btc/transactions/date=2024-09-20/'
partition (coin='eth', transactions='/transactions/date=2024-09-19') location 's3://aws-public-blockchain/v1.0/eth/transactions/date=2024-09-19/'
partition (coin='eth', transactions='/transactions/date=2024-09-20') location 's3://aws-public-blockchain/v1.0/eth/transactions/date=2024-09-20/'

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

Successfully merging this pull request may close these issues.

1 participant