s7clarke10 / tap-sybase

A Singer Tap for Sybase Databases, it should be compatible with Pipelinewise and Meltano
GNU Affero General Public License v3.0
1 stars 4 forks source link

Invalid format style code for "time" data type #27

Open aroder opened 1 week ago

aroder commented 1 week ago

Summary

The format style code 140 is for datetime data type but is not for time data type

Details The code at https://github.com/s7clarke10/tap-sybase/blob/c71c20c91ab08aa87e86ef927afeea8331cbe6f7/tap_sybase/sync_strategies/common.py#L118-L119 checks for the "time" data type, and attempts to convert it to character using format style code 140.

However, 140 is valid only for datetime, not for time image

reference Sybase docs: https://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc38151.1604/doc/html/san1278453000116.html

This is reproducible directly in Sybase image

Code 108 works just fine though image

aroder commented 1 week ago

this seems to work and be compatible with the "time(9)" data type that target-snowflake and I assume others will generate in the target table

LTRIM(RTRIM(CONVERT(CHAR, {}, 108)))

s7clarke10 commented 3 days ago

Thanks for raising this issue, I am busy with another assignment and have limited access to Sybase at the moment. I will raise this with a colleague of mine who I collaborate with on these enhancements.

s7clarke10 commented 3 days ago

It is worth mentioning that I have been working with a couple of different styles of Sybase and the particular version we were using is rather old. I had a great deal of difficulty finding codes which are suitable for old versions of Sybase.