Casting in mapd


how to cast high precison values in mapd
i am using pymapd how to cast decimal(38,18) to decimal(19,9) in query

mapdql> insert into example_mapd values(13.9999,234.444,cast(150.675857 as DECIMAL(19,9)));
Syntax error at: cast


is there any way in mapd can somone reply soon


I guess you can’t use cast function on the legacy processor.

What’s the problem? Is the legacy-processor casting your values as a float/double before inserting them, so you are having wrong numbers?


yes in postgres it has DECIMAL(38,18) when i load that to mapd i kept defalut as DECIMAL(19,9) for all columns
but in mapd it is having wrong values


I guess it’s a bug because the values in insert looks converted into a float/double before to be inserted into database.

Casting works only in calcite, bit it doesnt work in Legacy processor.


is there any other way to convert column in postgres as DECIMAL(38,19) to mapd as DECIMAL(19,9) in mapd without chaning values in it


I would try dumping postgres values in a cavallo then loading with copy Command, or doing something in python.

Have you tried the Java utility to copy data from a database to another? It’s called slqimporter.

Here is a reference to the utility