You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In MS SQL Server, there is a funny type called rowversion and has an alias timestamp. It has nothing in common with timestamp types in other databases. It's basically an binary(8) type which stores an incrementing number
Sqlglot does not seem to recognize this type. It would be nice if sqlglot would transpile it correctly to binary types.
importsqlglot.expressionsaseximportsqlglotprint( # transpiled type timestamp as is, should be binarysqlglot.parse_one("create table a (b timestamp)", dialect="tsql").sql("databricks")
)
print( # prints ROWVERSION instead of BINARYsqlglot.parse_one("create table a (b rowversion)", dialect="tsql").sql("databricks")
)
print( # good, this works! databricks timestamp is datetime2 in ms sqlsqlglot.parse_one("create table a (b timestamp)", dialect="databricks").sql("tsql")
)
The text was updated successfully, but these errors were encountered:
In MS SQL Server, there is a funny type called
rowversion
and has an aliastimestamp
. It has nothing in common with timestamp types in other databases. It's basically anbinary(8)
type which stores an incrementing numberhttps://learn.microsoft.com/en-us/sql/t-sql/data-types/rowversion-transact-sql?view=sql-server-ver16
Sqlglot does not seem to recognize this type. It would be nice if sqlglot would transpile it correctly to binary types.
The text was updated successfully, but these errors were encountered: