Coder Social home page Coder Social logo

Comments (7)

fivetran-joemarkiewicz avatar fivetran-joemarkiewicz commented on June 16, 2024

Hi @jordstew thanks for opening this Question! I am sorry to hear you have run into an error on the zendesk__ticket_backlog model.

This package is intended to run without variable configuration (apart from possibly disabling models if you do not have the table), which is strange to see you are running into an error like this. I just tested this quickly on my end to ensure my models would succeed without variable config and it succeeded with a full refresh run. Have you tried running your package with dbt run --full-refresh as this may do the trick?

from dbt_zendesk.

jordstew avatar jordstew commented on June 16, 2024

Hey @fivetran-joemarkiewicz , that does not work, still same error:

Completed with 1 error and 0 warnings:

Database Error in model zendesk__ticket_backlog (models/zendesk__ticket_backlog.sql)
000904 (42000): SQL compilation error: error line 644 at position 35
invalid identifier 'TICKET_FIELD_HISTORY.ASSIGNEE_ID'
compiled SQL at target/run/zendesk/models/zendesk__ticket_backlog.sql

When I look at the compiled code, like I described in my first post, it is clear why this is erroring and not working. I have no custom variables in my dbt_project.yml file besides this:

vars:
  zendesk_schema: ZENDESK_SUPPORT_SECURE
  zendesk_database: RAW
  zendesk_source:
    using_schedules: false
    group: "{{ source('zendesk', 'group_') }}"        # Disable if you do not have the schedule and ticket_schedule tables, or if you do not want metrics reported in business hours    # Disable if you are not using SLAs 
  zendesk:
    using_schedules: false

reason for the group in the zendesk_source variable is because we have to recreate it as GROUP_ because group is a reserved word in snowflake and it does not work when have a table simply named group, as it thinks we are doing a group by.

Any other ideas, Joe?

from dbt_zendesk.

fivetran-joemarkiewicz avatar fivetran-joemarkiewicz commented on June 16, 2024

Hmm my variable config looks very similar to yours, but I am unable to replicate the error. Would you be able to clarify which version of the package you are using?

Looking at your past comments I noticed the models are CTE's, whereas for me they are materializing as tables. I also see your error line for the backlog model is at line 644, while my backlog model target only contains ~70 lines?

from dbt_zendesk.

jordstew avatar jordstew commented on June 16, 2024

Would it help if I sent you the compiled query for reference? I am using version 0.4.1

from dbt_zendesk.

fivetran-joemarkiewicz avatar fivetran-joemarkiewicz commented on June 16, 2024

As it seems the compiled query is extremely long, I feel it would probably be best if we would be able to debug this live.

You can schedule some time to chat with myself and members of our team on our Calendly link for Thursday so we can debug live and hopefully get the package running successfully for you! Let me know if you have any questions.

from dbt_zendesk.

jordstew avatar jordstew commented on June 16, 2024

Hey Joe I figured it out. So for the first version of zendesk hub and zendesk source hub, we did the following in our dbt_project.yml:

  zendesk:
    #+database: EDW
    #+schema: ZENDESK_SECURE
    +database: DE_SANDBOX
    +schema: JSTEW
    +materialized: ephemeral
    zendesk_sla_breach:
      +materialized: table
    zendesk_ticket_enriched:
      +materialized: table
    zendesk_ticket_field_history:
      +materialized: table
    zendesk_ticket_metrics:
      +materialized: table
    zendesk__ticket_summary:
      +materialized: table
    zendesk__ticket_backlog:
      +materialized: table
    
  zendesk_source:
    #+database: EDW
    #+schema: ZENDESK_STG_SECURE
    +database: DE_SANDBOX
    +schema: JSTEW
    +materialized: table

we did this because we want the models to be materialized as tables instead of views. this worked for the first version of the zendesk hub, but now having this line about all other materializations being ephemeral seemed to break it:

  zendesk:
    #+database: EDW
    #+schema: ZENDESK_SECURE
    +database: DE_SANDBOX
    +schema: JSTEW
    **+materialized: ephemeral**

having this works:

  zendesk:
    #+database: EDW
    #+schema: ZENDESK_SECURE
    +database: DE_SANDBOX
    +schema: JSTEW
    #+materialized: ephemeral
    zendesk_sla_breach:
      +materialized: table
    zendesk_ticket_enriched:
      +materialized: table
    zendesk_ticket_field_history:
      +materialized: table
    zendesk_ticket_metrics:
      +materialized: table
    zendesk__ticket_summary:
      +materialized: table
    zendesk__ticket_backlog:
      +materialized: table

Thanks for the help, Joe. You can close this and cancel our working session, and I will also decline it.

from dbt_zendesk.

fivetran-joemarkiewicz avatar fivetran-joemarkiewicz commented on June 16, 2024

That's great to hear you were able to get the package to work with the materialization update to the some of those intermediate models.

That also explains the large compile code length. Thanks again for opening this issue and for letting us know you were able to come to a resolution, as such I will close this issue.

from dbt_zendesk.

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.