You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the existing issues, and I could not find an existing issue for this bug
Current Behavior
When I define model like following, and execute dbt run command, command will succeed if metadata field is really of type STRUCT, but underlying keys in the struct and their corresponding data types won't be checked.
select
id,
CAST(metadata AS STRUCT<property_3 STRING> as metadata
from {{ source('source', 'source_table') }}
I've noticed this when I tried testing and changing my data_type from STRUCT to MAP. In that case dbt run command retuned this error:
definition_type and contract_type are not taking into account values inside complex/nested structures.
Expected Behavior
I would expect for dbt to fail if contract is enforced, and complex data types like ARRAY, MAP and STRUCT are not fully described, or even better under contract configuration to have check_complex_types boolean field which can decide whether to check nested structures or not.
Steps To Reproduce
Using model configuration and similar SQL command (that contains STRUCT field) from above, execute dbt run command. Command will succeed no matter what underlying struct configuration is setup in data_type field (works with setting just STRUCT<>).
HI @amychen1776, I've installed dbt Cloud CLI locally, but based on manifest.json logs "adapter_type": "databricks", it's using dbt-databricks adapter.
Thank @zeljkostojkovic ! Could you open this issue on dbt-databricks since this is specific to that adapter? I'm going to close this issue out for now since we should triage and address on dbt-databricks. I unfortunately can't transfer your issue since it's in the Databricks org.
Is this a new bug in dbt-spark?
Current Behavior
When I define model like following, and execute
dbt run
command, command will succeed ifmetadata
field is really of typeSTRUCT
, but underlying keys in the struct and their corresponding data types won't be checked.SQL model:
I've noticed this when I tried testing and changing my data_type from
STRUCT
toMAP
. In that case dbt run command retuned this error:definition_type
andcontract_type
are not taking into account values inside complex/nested structures.Expected Behavior
I would expect for dbt to fail if
contract
is enforced, and complex data types like ARRAY, MAP and STRUCT are not fully described, or even better undercontract
configuration to havecheck_complex_types
boolean field which can decide whether to check nested structures or not.Steps To Reproduce
Using model configuration and similar SQL command (that contains
STRUCT
field) from above, executedbt run
command. Command will succeed no matter what underlying struct configuration is setup indata_type
field (works with setting justSTRUCT<>
).Relevant log output
No response
Environment
Additional Context
No response
The text was updated successfully, but these errors were encountered: