prestodb / presto

The official home of the Presto distributed SQL query engine for big data
http://prestodb.io
Apache License 2.0
16.03k stars 5.37k forks source link

presto-oracle connector fails to copy number columns with scale equals 0 #16866

Open csongfr opened 3 years ago

csongfr commented 3 years ago

When I select integer or number(x) fields from oracle db and insert into a new oracle db using"insert into db1.xxx select * from db2.xxx", the connector fails with ORA-00902: invalid datatype

After checking the debug log, it shows that presto is not able to create a tmp table with bigint field. I suppose the problem is caused by following lines :

https://github.com/prestodb/presto/blob/d31fbfd550f0f5b7eefbde05854e3a2a643b4ef3/presto-oracle/src/main/java/com/facebook/presto/plugin/oracle/OracleClient.java#L153

Setting the "oracle.number.default-scale=2" seems not helping, did I missing something ?

Thank you

ibraunegrego commented 2 years ago

Hi, can you give me a feedback about the pull request, please?