How to we migrate numeric data types with length to spark sql supported data type

19 Views Asked by At

we are migrating azure sql views to delta format files to saved as table and on top of that, we are creating the unity catalog, if numeric(12,0) is in sql server, we have to similar kind of data type and length required in spark sql.

if we use numeric data type in spark sql bydefault taking decimal(12,0), please help us, how to manage to spark sql side.

enter image description here

1

There are 1 best solutions below

2
Ajay Ahuja On

you can try below 2 options :

cast(columnName As Int)

OR

split(columnName,"\\.")(0)