Giter Club home page Giter Club logo

dbt-external-tables-athena's Introduction

dbt_external_tables_athena

Additional macros to enable Athena support in dbt_external_tables.

See dbt-labs/dbt-external-tables#133 (comment) for details.

Installation

Add to packages.yml in your project:

packages:
   - git: "https://github.com/dbt-labs/dbt-external-tables/"
     revision: 0.8.7
   - git: "https://github.com/rstml/dbt-external-tables-athena/"
     revision: 0.0.1

Add to dbt_project.yml in your project:

dispatch:
  - macro_namespace: dbt_external_tables
    search_order: [dbt_external_tables_athena, dbt_external_tables]

# Stage the external tables when dbt starts running, using https://github.com/dbt-labs/dbt-external-tables
on-run-start:
  - "{{ dbt_external_tables.stage_external_sources() }}"

Finally, here's an example for your project's models/sources.yml:

version: 2

sources:
  - name: mydbt
    loader: "s3"
    quoting:
      database: false
      schema: false
      identifier: false
      column: true
    tables:
      - name: demo_transactions
        database: awscatalog
        external:
          location: 's3://my-lakehouse-demo/demo/transactions/'
          row_format: "SERDE 'org.openx.data.jsonserde.JsonSerDe'"
        columns:
          - name: transaction_id
            data_type: int
            description: "Transaction ID (primary key)"
            tests:
              - unique
              - not_null
          - name: amount
            data_type: decimal(4, 2)
            tests:
              - not_null
          - name: currency
            data_type: varchar(3)
            tests:
              - not_null
          - name: payment_processor
            data_type: varchar(50)
          - name: timestamp
            data_type: timestamp

dbt-external-tables-athena's People

Contributors

rstml avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.