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
{{ message }}
Repository navigation
R binds Snowflake semantic view variables without their declared type #447
R can't call a Snowflake semantic view that declares a variable, at least with Snowflake ODBC driver 4.x. snowflake_semantic_metric_sql() writes VARIABLES "MIN_TOTAL" => ? and binds the value. The driver binds it as text, and Snowflake requires a variable's value to match the declared type: Expression's derived type 'VARCHAR(1)' does not match provided data type 'NUMBER(10,2)' for variable 'MIN_TOTAL'.
CAST(? AS NUMBER(10,2)) works. Casting to the type the view declares keeps the value exact. A looser cast such as CAST(? AS NUMBER) rounds 50.5 to 51.
Found by "live Snowflake binds native semantic variables" in #431. That run used driver 4.0.0 on macOS. CI on Linux uses a different driver install, so it may not fail there, but the cast is correct with either driver.
Activity