Forcing Data Types (using SDL?) in Mitto - Integers vs Decimals

Hi Zuar -

How can I force a data type?

I have a table in Mitto with a column that holds a numeric value (almost always an integer, but sometimes it has decimal places). The data is correctly represented in the Postgres table that Mitto creates.

The problem arises when I send a copy of this table to Snowflake. In Snowflake, the data is showing as an INTEGER. For example, a value of 0.94 in Postgres is showing up as 1 in Snowflake.

In Mitto, to get the data from Postgres to Snowflake, I am using a query job. On the SQL tab, there is one SQL statement: select * from . On the JSON tab, the INPUT is using Postgres table and the OUTPUT is Snowflake.

I have tried adding a SDL section between the OUTPUT and STEPS section (in the JSON tab), but it isn’t working. For the type, I have tried numeric, decimal, and number(18,4) – but I get an error each time. Here is the syntax I am using:

sdl: {
columns: [
{
name: pack_quantity,
type: decimal
}
]
}

Hey @BlueFlamingo ,

If you are using a query job without a reflection, my suggestion would be to just cast the field in the Select statement (field_name::datatype) as I do not believe query jobs support SDLs.

If you are using a reflection, you will likely have to create the table in snowflake first and then reflect the data into the table.

Hope this helps!