dbt-labs/dbt-adapter-tests

Is there a way to change column type:

Opened this issue · 2 comments

This is the ddl of "Create table" when testing squence base:
create table dbt_test_220616055423285597304654.base ("id" integer,"name" text,"some_date" timestamp)

  create table dbt_test_220616070911922739318488.base ("id" integer,"name" text,"some_date" timestamp) 
ERROR 42X94: TYPE 'TEXT' does not exist.     

The type of name is text, how to change this type into varchar? thanks.

Hey @hua0129, it sounds like you want to reimplement the convert_text_type method in your adapter plugin. That's what dbt uses when loading CSV files (dbt seed), and translating inferred types into database types. By default (for "SQL" adapters), it returns text, and you want it to return varchar.

One thing worth noting: We've developed a new testing suite to replace the one in this repository. For documentation and details: https://docs.getdbt.com/docs/contributing/testing-a-new-adapter

Fixed. Thanks. @jtcohen6