Skip to content
This repository has been archived by the owner on Dec 15, 2023. It is now read-only.

Is there a way to change column type: #40

Open
hua0129 opened this issue Jun 16, 2022 · 2 comments
Open

Is there a way to change column type: #40

hua0129 opened this issue Jun 16, 2022 · 2 comments

Comments

@hua0129
Copy link

hua0129 commented Jun 16, 2022

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.

@jtcohen6
Copy link
Contributor

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

@hua0129
Copy link
Author

hua0129 commented Jun 30, 2022

Fixed. Thanks. @jtcohen6

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants