The problem I’m having is
Ability to create empty tables and external tables (Redshift Spectrum) with dbt core
The context of why I’m trying to do this -
We are datawarehousing team that ingests data from various sources. Currently, when onboarding a new service team, we create the schema and tables for the service team manually in Redshift cluster. We want to automate this process using dbt core. However all the examples that I have seen so far have select statement when creating a table and create a table from a source. In my case there is no source. This is the first time data will be loaded to the data warehouse.
Example statements that I am running manually
create external schema ocs_ext
from data catalog
database 'orgs'
iam_role 'arn:aws:iam::xxxx:role/GlueJobTransformRole'
region 'us-east-1';
create schema dbt
CREATE TABLE "dbt"."data"(startdate date NOT NULL,
enddate date NOT NULL,
endtime timestamp NOT NULL,
starttime timestamp NOT NULL,
operation VARCHAR(32) NOT NULL,
orgmasteraccountid VARCHAR(64),
invokedby VARCHAR(64),
counters VARCHAR(65535),
metrics VARCHAR(65535),
parenttype VARCHAR(32),
targettype VARCHAR(32)
)distkey(startdate);