I'm building a dbt model and when using dbt run --models model_name
, I get a database error saying there is an invalid identifier.
Now, the identifier was actually valid (I can query it from database) and even after I removed it, just to understand what was happening, dbt keeps throwing the same error, even referencing the line number in my model code before I removed it. I also checked the compiled code in the target folder and the identifier throwing error is not there (as expected since I removed it). Would you know why dbt would keep giving this error?
Fixed the issued by removing the "invalid" field from all the models, not just from the core model. Also, the error "invalid field" was due to dbt trying to parse the field, which was a json blob, while I needed it as string. Casting the field as varchar made everything work.