Giter Site home page Giter Site logo

Comments (7)

nicor88 avatar nicor88 commented on May 14, 2024

@hagai-arad hey the issue it's most likely due to this https://github.com/dbt-athena/dbt-athena/blob/main/dbt/adapters/athena/query_headers.py#L19 I will include drop statement in there too.

from dbt-athena.

nicor88 avatar nicor88 commented on May 14, 2024

@hagai-arad could you try this branch? #109 should fix your issue, I didn't fully tested, but I had something similar with vacuum in the past.

from dbt-athena.

hagai-arad avatar hagai-arad commented on May 14, 2024

@nicor88 thanks for the quick fix!
It works for drop command, but not for create command. Can you add it as well?

I don't have others in mind, but I think any supported command should be available in the pre/post-hook

from dbt-athena.

nicor88 avatar nicor88 commented on May 14, 2024

why will you run a create command in a pre/post hook? can't you use dbt models for that?

from dbt-athena.

hagai-arad avatar hagai-arad commented on May 14, 2024

A few reasons:

  • Does dbt supports all functionalities and properties I can achieve with a create table statement?
  • If I use a dbt model to create a table, the data types are defined by the data itself and not by the table definition
  • I'm pretty sure this is supported in other dbt connectors (e.g. postgres)

from dbt-athena.

nicor88 avatar nicor88 commented on May 14, 2024

Does dbt supports all functionalities and properties I can achieve with a create table statement?

it should, if not, please create other issues in order to implement

If I use a dbt model to create a table, the data types are defined by the data itself and not by the table definition

You can use explicit casting to overcome this issue, same for other dbt-adapter

I'm pretty sure this is supported in other dbt connectors (e.g. postgres)

Yes, could be, but I still feel that is wrong to use a create statement as a post hook, I mean there code be edge cases reason why we want to have that. Still I didn't have the edge case why you want to do so, so please maybe provide a your specific use cases for me/us to understand the issue, as other user might have the same, and maybe we are able to provide more elegant solutions :)

from dbt-athena.

hagai-arad avatar hagai-arad commented on May 14, 2024

I totally get your point.
I don't have such a case at the moment. I'll share if I have one :)
Thanks for the support!

from dbt-athena.

Related Issues (20)

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.