Skip to content

Commit

Permalink
fix(query): fix incorrect function name of decimal, neq --> noteq (#1โ€ฆ
Browse files Browse the repository at this point in the history
โ€ฆ4001)

* fix(query): fix incorrect function name of decimal, neg --> noteq

* fix(query): fix incorrect function name of decimal, neg --> noteq
  • Loading branch information
sundy-li authored Dec 13, 2023
1 parent a639b33 commit c810ca3
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 30 deletions.
2 changes: 1 addition & 1 deletion src/query/functions/src/scalars/decimal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ pub(crate) fn register_decimal_compare_op(registry: &mut FunctionRegistry) {
register_decimal_compare_op!(registry, "gt", is_gt, domain_gt);
register_decimal_compare_op!(registry, "lte", is_le, domain_lte);
register_decimal_compare_op!(registry, "gte", is_ge, domain_gte);
register_decimal_compare_op!(registry, "ne", is_ne, domain_noteq);
register_decimal_compare_op!(registry, "noteq", is_ne, domain_noteq);
}

pub(crate) fn register_decimal_arithmetic(registry: &mut FunctionRegistry) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ output : true

ast : 1.1!=1.1
raw expr : noteq(1.1, 1.1)
checked expr : noteq<Float32, Float32>(to_float32<Decimal(2, 1)>(1.1_d128(2,1)), to_float32<Decimal(2, 1)>(1.1_d128(2,1)))
checked expr : noteq<Decimal(2, 1), Decimal(2, 1)>(1.1_d128(2,1), 1.1_d128(2,1))
optimized expr : false
output type : Boolean
output domain : {FALSE}
Expand Down
24 changes: 12 additions & 12 deletions src/query/functions/tests/it/scalars/testdata/function_list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2719,7 +2719,6 @@ Functions overloads:
198 multiply(Float64 NULL, Float32 NULL) :: Float64 NULL
199 multiply(Float64, Float64) :: Float64
200 multiply(Float64 NULL, Float64 NULL) :: Float64 NULL
0 ne FACTORY
0 not(Boolean) :: Boolean
1 not(Boolean NULL) :: Boolean NULL
0 noteq(Variant, Variant) :: Boolean
Expand All @@ -2746,17 +2745,18 @@ Functions overloads:
21 noteq(UInt64 NULL, UInt64 NULL) :: Boolean NULL
22 noteq(Int64, Int64) :: Boolean
23 noteq(Int64 NULL, Int64 NULL) :: Boolean NULL
24 noteq(Float32, Float32) :: Boolean
25 noteq(Float32 NULL, Float32 NULL) :: Boolean NULL
26 noteq(Float64, Float64) :: Boolean
27 noteq(Float64 NULL, Float64 NULL) :: Boolean NULL
28 noteq(Boolean, Boolean) :: Boolean
29 noteq(Boolean NULL, Boolean NULL) :: Boolean NULL
30 noteq(Array(Nothing), Array(Nothing)) :: Boolean
31 noteq(Array(Nothing) NULL, Array(Nothing) NULL) :: Boolean NULL
32 noteq(Array(T0), Array(T0)) :: Boolean
33 noteq(Array(T0) NULL, Array(T0) NULL) :: Boolean NULL
34 noteq FACTORY
24 noteq FACTORY
25 noteq(Float32, Float32) :: Boolean
26 noteq(Float32 NULL, Float32 NULL) :: Boolean NULL
27 noteq(Float64, Float64) :: Boolean
28 noteq(Float64 NULL, Float64 NULL) :: Boolean NULL
29 noteq(Boolean, Boolean) :: Boolean
30 noteq(Boolean NULL, Boolean NULL) :: Boolean NULL
31 noteq(Array(Nothing), Array(Nothing)) :: Boolean
32 noteq(Array(Nothing) NULL, Array(Nothing) NULL) :: Boolean NULL
33 noteq(Array(T0), Array(T0)) :: Boolean
34 noteq(Array(T0) NULL, Array(T0) NULL) :: Boolean NULL
35 noteq FACTORY
0 now() :: Timestamp
0 oct(Int64) :: String
1 oct(Int64 NULL) :: String NULL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,44 +365,49 @@ DECIMAL(41, 3) DECIMAL(41, 3) DECIMAL(76, 5) DECIMAL(48, 8)
## compare

query IIIII
select a > b, a < b, a = b, a <= b, a >= b from (select 3::Decimal(13,2) a , 3.1::Decimal(8,2) b);
select a > b, a < b, a = b, a != b, a <= b, a >= b from (select 3::Decimal(13,2) a , 3.1::Decimal(8,2) b);
----
0 1 0 1 0
0 1 0 1 1 0

query IIIII
select a > b, a < b, a = b, a <= b, a >= b from (select 3::Decimal(76,2) a , 3.1::Decimal(76,2) b);
select a > b, a < b, a = b, a != b, a <= b, a >= b from (select 3::Decimal(76,2) a , 3.1::Decimal(76,2) b);
----
0 1 0 1 0
0 1 0 1 1 0

query IIIII
select a > b, a < b, a = b, a <= b, a >= b from (select 3::Decimal(13,2) a , 3 b);
select a > b, a < b, a = b, a != b, a <= b, a >= b from (select 3::Decimal(13,2) a , 3 b);
----
0 0 1 1 1
0 0 1 0 1 1

query IIIII
select a > b, a < b, a = b, a <= b, a >= b from (select 3::Decimal(76,2) a , 3 b);
select a > b, a < b, a = b, a != b, a <= b, a >= b from (select 3::Decimal(76,2) a , 3 b);
----
0 0 1 1 1
0 0 1 0 1 1

query IIIII
select a > b, a < b, a = b, a <= b, a >= b from (select 3::Decimal(13,2) a , 3.1 b);
select a > b, a < b, a = b, a != b, a <= b, a >= b from (select 3::Decimal(13,2) a , 3.1 b);
----
0 1 0 1 0
0 1 0 1 1 0

query IIIII
select a > b, a < b, a = b, a <= b, a >= b from (select 3::Decimal(76,2) a , 3.1 b);
select a > b, a < b, a = b, a != b, a <= b, a >= b from (select 3::Decimal(76,2) a , 3.1 b);
----
0 1 0 1 0
0 1 0 1 1 0

query IIIII
select a > b, a < b, a = b, a <= b, a >= b from (select 3::Decimal(13,2) a , 2.9 b);
select a > b, a < b, a = b, a != b, a <= b, a >= b from (select 3::Decimal(13,2) a , 2.9 b);
----
1 0 0 0 1
1 0 0 1 0 1

query IIIII
select a > b, a < b, a = b, a <= b, a >= b from (select 3::Decimal(76,3) a , 2.9 b);
select a > b, a < b, a = b, a != b, a <= b, a >= b from (select 3::Decimal(76,3) a , 2.9 b);
----
1 0 0 0 1
1 0 0 1 0 1

query II
select a > b, a < b, a = b, a != b, a <= b, a >= b from (values( '5497.0000000000000000'::DECIMAL(20, 15) , '5497.0000000000000000'::DECIMAL(60, 30) )) t(a,b);
----
0 0 1 0 1 1

query T
select typeof(a = b) from (select 3::Decimal(13,2) a , 2.9 b);
Expand Down

0 comments on commit c810ca3

Please sign in to comment.