Open nj1973 opened 1 year ago
Hi @nj1973! I was reviewing this issue and it seems kinda related to the #990, in the sense that we need to convert TEXT, NTEXT, IMAGE columns to VARCHAR (related docs: https://learn.microsoft.com/en-us/sql/t-sql/data-types/ntext-text-and-image-transact-sql?view=sql-server-ver16).
RTRIM documentation says the arg "_must be of a data type that is implicitly convertible to varchar. Otherwise, use CAST to explicitly convert characterexpression".
Also wanted to review if we keep this issue as p1, what do you think?
It is related to the divergence of behaviour for nullable vs not-null columns mentioned in [990].
In the case of TEXT and NTEXT I think we need to divert the cast
to force_cast
, both functions are defined in ibis_addon/api.py
. The difficulty is figuring out how and when.
As far as I can tell there's no way of knowing the SQL Server data type to be able to know when a String column is actually text. It is also not clear how we would switch to force_cast
.
More research needed.
Testing row validation with --hash on a text column throws an exception as below:
Example column: