Question

Model View Definition: Snowflake Connection: Defines Number as string

  • 22 February 2019
  • 4 replies
  • 49 views

Database Connection Source: Snowflake

Using the DB connection, when creating the project the model views are automatically generated but attributes of type Number are defined as String

Examples:

Snowflake attribute with type Number(18.0) => string

Snowflake attribute with type Number(5.2) => string


How can this be fixed so that view defines attributes of type Number as number in view definition without manually checking and fixing the types.


Thanks,

Umesh


4 replies

Userlevel 7
Badge +1

I wonder if it has to do with the special number types— Does it do it to fields of type FLOAT or INT too?

Hi,


Checked on Snowflake FLOAT and Looker gets it as number in the view definition.


Thanks,

Umesh

Userlevel 7
Badge +1

Interesting, I guess Looker doesn’t treat certain snowflake Number types as numeric when generating LookML— For now, I’d experiment around with what works and what doesn’t, and you can always add casts to fix it manually like you said.


I’ll test and see if this is intentional or not.

Userlevel 7
Badge +1

I haven’t been able to spin up a snowflake instance and create those fields, but it looks like for now the best thing to do would be to add casts to those fields, or store them as a different datatype in the DB.


NUMBER(38,0) ought to be working fine, from my testing.

Reply