Closed Vaslo closed 2 years ago
Using numeric is the expected behavior when the provided schema doesn't contain info on the maximum value of the integer property, so the target errs on the safe side and picks the biggest numeric column. See the code here.
To make the target use small int for the effective_month
column, add a maximum
property with value <= 32767.
Such an easy fix, thanks for the quick reply. I am very new to JSON so didn't quite know how to set it up even after reading the code. I didn't realize I also had to pass a maximum property but now it totally makes sense. This did the trick:
effective_year:
type: ["integer"]
maximum: 3000
effective_month:
type: ["integer"]
maximum: 12
I am running the spreadsheets-anywhere tap to pull in some CSV data. I am using the Meltano schema override to ensure that a month number is typed as an integer. When your target picks it up, it can't seem to recognize it as one of the other int types and insists on it being a numeric, which is just much too big. Because of this, it creates an extra column with the number as a numeric and leaves my original column as null. I've tried smallint, integer, and bigint types and despite your code having the ability to recognize a maximum, it refuses to do it. Any idea why?
This is one of the ways I have set my schema in the tap, for what it's worth: