Skip to content

Commit 93851b3

Browse files
committed
fix math
1 parent 8587282 commit 93851b3

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/query/expression/src/display.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ impl<'a> Debug for ScalarRef<'a> {
105105
fields.iter().map(ScalarRef::to_string).join(", ")
106106
)
107107
}
108-
ScalarRef::Variant(s) => write!(f, "{:X?}", s),
108+
ScalarRef::Variant(s) => write!(f, "0x{}", &hex::encode(s)),
109109
}
110110
}
111111
}

src/query/expression/src/types/variant.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use crate::values::Column;
2626
use crate::values::Scalar;
2727
use crate::values::ScalarRef;
2828

29-
// BSON bytes representation of `{v: null}`.
29+
/// BSON bytes representation of `{v: null}`.
3030
pub const DEFAULT_BSON: &[u8] = &[0x08, 0x00, 0x00, 0x00, 0x0A, 0x76, 0x00, 0x00];
3131

3232
#[derive(Debug, Clone, PartialEq, Eq)]

src/query/functions-v2/tests/it/scalars/testdata/math.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,28 +117,28 @@ output : 0.5403023058681398
117117
ast : tan(1)
118118
raw expr : tan(1_u8)
119119
checked expr : tan<Float64>(CAST(1_u8 AS Float64))
120-
optimized expr : 1.557407724654902_f64
120+
optimized expr : 1.5574077246549023_f64
121121
output type : Float64
122122
output domain : Unknown
123-
output : 1.557407724654902
123+
output : 1.5574077246549023
124124

125125

126126
ast : atan(0.5)
127127
raw expr : atan(0.5_f64)
128128
checked expr : atan<Float64>(0.5_f64)
129-
optimized expr : 0.46364760900080615_f64
129+
optimized expr : 0.4636476090008061_f64
130130
output type : Float64
131131
output domain : {-1.5707963267948966..=1.5707963267948966}
132-
output : 0.46364760900080615
132+
output : 0.4636476090008061
133133

134134

135135
ast : cot(-1.0)
136136
raw expr : cot(minus(1_f64))
137137
checked expr : cot<Float64>(minus<Float64>(1.0_f64))
138-
optimized expr : -0.6420926159343308_f64
138+
optimized expr : -0.6420926159343306_f64
139139
output type : Float64
140140
output domain : Unknown
141-
output : -0.6420926159343308
141+
output : -0.6420926159343306
142142

143143

144144
ast : asin(1)

src/query/functions-v2/tests/it/scalars/testdata/variant.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ error:
1818
ast : parse_json('null')
1919
raw expr : parse_json("null")
2020
checked expr : parse_json<String>("null")
21-
optimized expr : [8, 0, 0, 0, A, 76, 0, 0]
21+
optimized expr : 0x080000000a760000
2222
output type : Variant
2323
output domain : Unknown
2424
output : null
@@ -27,7 +27,7 @@ output : null
2727
ast : parse_json(' ')
2828
raw expr : parse_json(" \t")
2929
checked expr : parse_json<String>(" \t")
30-
optimized expr : [8, 0, 0, 0, A, 76, 0, 0]
30+
optimized expr : 0x080000000a760000
3131
output type : Variant
3232
output domain : Unknown
3333
output : null

0 commit comments

Comments
 (0)