oap-project / gazelle_plugin

Native SQL Engine plugin for Spark SQL with vectorized SIMD optimizations.
Apache License 2.0
256 stars 77 forks source link

0.0/0 return 0.0 #1212

Open jackylee-ch opened 1 year ago

zhouyuan commented 1 year ago

@jackylee-ch I thought your patch (https://github.com/oap-project/arrow/pull/186) should fix this issue?

jackylee-ch commented 1 year ago

Hm, it is another problem. Here is the reproduce code.

create table test_int(a int) using parquet;
insert overwrite test_int values(0);
-- this returns null as expected.
select a / 0 from test_int;
-- this returns 0.0, which is the actual problem.
select a * 1.0 / 0 from test_int;
jackylee-ch commented 1 year ago

Hm, it is the problem for divide/mod with decimal, I didn't fix it in (https://github.com/oap-project/arrow/pull/186)