I’m trying to add support for time/date to the mss...
# troubleshooting
j
I’m trying to add support for time/date to the mssql target. The catalog from the snowflake source indicates that some fields are time(6), but when I run my pipeline the singer sdk issues some alter table commands to change the type to
VARCHAR
. Can I get a pointer on where to get started /code/doc sample/etc? I see in the target code where types are assigned, but not sure if that’s the right place (vs say adding a mapper)
h
You might try to bump the sdk version, just as an initial step.
j
Thanks @Henning Holgersen… I might try that but I am realizing I think I have a different problem. The connector on it’s own does what I want when I dump my table to json and invoke it
Copy code
poetry run target-mssql --input table2.json --config config.json
This will write the json data into my table without trying to
alter table
to update the types. When I run it using
run
e.g.
Copy code
meltano --environment dev invoke tap-snowflake--cd  cd_field_map target-mssql
(the
cd_field_map
field map does some field renaming) I am passing in (via yml config) a catalog with the correct data types. The target connector then tries to change the column data types and fails (only because of embedded spaces in column names). So somehow the types is sees are not compatible now but they were before? What I guess I want is the OOB singer behavior and to skip whatever meltano is adding. Is there an easy way to skip this casting?
h
But as I understand you, the table2.json file does not include spaces? Have you tried to use the original tap to see if it works if you let the columns be renamed? Alternatively, I have a different version that tries to preserve column names: https://github.com/radbrt/target-mssql/tree/orig-colnames.
(I haven’t actually gotten around to looking at dates, I see now my CI tests just writes varchar all over…)
j
Sorry I realize I’m not totally clear. The space issue is working ok in my fork of the mssql-target for loading data. The
alter
statement that fails because of spaces I could fix but I actually do not want the target table to be altered. In this case, I have a
time
field in snowflake that I’d like to load as a
time
field in mssql. When I invoke the mssql-target with a json file, this is the behavior I get. When I do
meltano run
I get addition behavior (the
alter table
). because the field types are somehow being flagged as incompatible. I’m not sure why…
h
Hmm… It would be interesting to see the actual singer records, there might be a devilish detail there. Have you tried to run both with log-level=debug and fish out the singer records and schema?
j
Have you tried to run both with log-level=debug and fish out the singer records and schema?
Yes to both. Let me do some scrubbing and I can post an example…