starburstdata/dbt-trino

Add query_id, query executed and rows_effected to adapter responses

Closed this issue · 2 comments

Describe the feature

Do you all think it make sense to store the compiled query as well?
I use DBT test and will like to store the compiled query for reference, especially tests that are failing.

Good to have similar to how snowflake adapter is doing.
rows_affected, code, query_id and _message if we want it.

I think query_id and _message is already covered in #186

return SnowflakeAdapterResponse(
      _message="{} {}".format(code, cursor.rowcount),
      rows_affected=cursor.rowcount,
      code=code,
      query_id=cursor.sfqid,
  )  # type: ignore

Describe alternatives you've considered

I think its hard to get the compiled query considering DBT uses templating heavily.
We can scrap from the compiled sql file generated, but its abit disorganized.

Query id is very important to trace back the issue especially for DBT test or building a model i guess.

Who will benefit?

People who write DBT test and also creating model, since they will have better visibility.

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

for rows_affected it needs to be first implemented in trino-python-client see trinodb/trino-python-client#319

for code I think it's also not implented in trino-python-client

cc @mdesmet

Sure, let me see what is available.