techindicium / dbt-oracle

A dbt adapter for oracle db backend
Other
38 stars 18 forks source link

Error on dbt debug #1

Closed dpavancini closed 3 years ago

dpavancini commented 4 years ago

When testing the connection on dbt debug, this error appears. Nevertheless, the connection is sucessful.

Oracle error: ORA-00923: FROM keyword not found where expected Connection test: ERROR

dbt was unable to connect to the specified database. The database returned the following error:

Database Error ORA-00923: FROM keyword not found where expected

fabrice-etanchaud commented 4 years ago

Hi @dpavancini , I just started using your great adapter, have not dived in the code, but it seems like a missing 'FROM DUAL' clause, as other dbs usually only need a 'SELECT something' when issuing computed only fields. I can remember mandatory 'SELECT 1' queries hidden in several parts of dbt, it could be the problem. Thank you again for the adapter !

fabrice-etanchaud commented 4 years ago

debug command issues a "select 1 as id", that should be "select 1 as id from dual" in our case. In order to make this work, this debug sql command should be dispatched in each adapter (maybe only in SQLAdapter and OracleAdapter should do the job). This has to be discussed with the dbt's team.

select 1 as id

vitoravancini commented 4 years ago

That looks bad, I was trying to find a way to overwrite this reconnect, but I havent found a solution yet. But I guess this is just for reconnect, the regular dbt debug can be fixed using you your suggestions @fabrice-etanchaud. I will try to take a look tonight. Pr's are also very wellcome!

fabrice-etanchaud commented 4 years ago

Hi @vitoravancini, of course ! I have a few lines of code to suggest, but I would like to have a better understanding of the dbt's adapter philosophy before I do a PR, I don't want to waste your time in refactoring a half packaged submission.

dpavancini commented 4 years ago

Hi @fabrice-etanchaud, was this issue addressed on your latest PR?

fabrice-etanchaud commented 4 years ago

Hi @dpavancini, on our side, this would just be a matter of writing one adapter macro. The work is mostly on dbt's side, and I am not enough skilled at the moment to propose a PR on such a great piece of software !

Best

vitoravancini commented 3 years ago

dbt debug works now, closing this