File tree Expand file tree Collapse file tree
integ-test/src/yamlRestTest/resources/rest-api-spec/test/issues
opensearch/src/main/java/org/opensearch/sql/opensearch/request Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ setup :
2+ - do :
3+ query.settings :
4+ body :
5+ transient :
6+ plugins.calcite.enabled : true
7+ plugins.calcite.fallback.allowed : false
8+
9+ ---
10+ teardown :
11+ - do :
12+ query.settings :
13+ body :
14+ transient :
15+ plugins.calcite.enabled : false
16+ plugins.calcite.fallback.allowed : true
17+
18+ ---
19+ " Decimal literal should convert to double in pushdown " :
20+ - skip :
21+ features :
22+ - headers
23+ - do :
24+ bulk :
25+ index : test
26+ refresh : true
27+ body :
28+ - ' {"index": {}}'
29+ - ' {"balance": 1000.0}'
30+ - do :
31+ headers :
32+ Content-Type : ' application/json'
33+ ppl :
34+ body :
35+ query : ' source=test | where balance >= 1000.0 | stats avg(balance)'
36+ - match : {"total": 1}
37+ - match : {"schema": [{"name": "avg(balance)", "type": "double"}]}
38+ - match : {"datarows": [[1000.0]]}
Original file line number Diff line number Diff line change @@ -1057,7 +1057,7 @@ Object value() {
10571057 return sargValue ();
10581058 } else if (isIntegral ()) {
10591059 return longValue ();
1060- } else if (isFloatingPoint ()) {
1060+ } else if (isFractional ()) {
10611061 return doubleValue ();
10621062 } else if (isBoolean ()) {
10631063 return booleanValue ();
@@ -1072,8 +1072,8 @@ boolean isIntegral() {
10721072 return SqlTypeName .INT_TYPES .contains (literal .getType ().getSqlTypeName ());
10731073 }
10741074
1075- boolean isFloatingPoint () {
1076- return SqlTypeName .APPROX_TYPES .contains (literal .getType ().getSqlTypeName ());
1075+ boolean isFractional () {
1076+ return SqlTypeName .FRACTIONAL_TYPES .contains (literal .getType ().getSqlTypeName ());
10771077 }
10781078
10791079 boolean isBoolean () {
You can’t perform that action at this time.
0 commit comments