OpenSearch/x-pack
Andras Palinkas a7301065d7
SQL: Fix the return type in the sign function (#64845) (#64968)
Fixes the inconsistency between the type of the object returned by the
`SIGN()/SIGNUM()` SQL functions and the specified `DataType`.

In the Class Sign, DataType is DataTypes.INTEGER. The source code is as
follows:

```
    public DataType dataType() {
        return DataTypes.INTEGER;
    }
```

But In the Class MathProcessor, the source code of SIGN((Object l),
Parameter and return value types are the same. Therefore, when using
double or float parameters to test, there is a little problem, the test
method is like the following curl :

```
curl -XPOST 127.0.0.1:9200/_sql -d "{\"query\":\"select  SIGN(1.0) \"}" \
  -H 'Content-Type: application/json'
```

The result is:

```
{"columns":[{"name":"SIGN(1.0)","type":"integer"}],"rows":[[1.0]]}
```

The result value is `1.0`, but the type is `integer`.

Signed-off-by: mantuliu <240951888@qq.com>
Co-authored-by: Marios Trivyzas <matriv@gmail.com>
(cherry picked from commits aa78301e71f, ced3c1281c7, 40e5b9b)
2020-11-11 17:07:17 -05:00
..
dev-tools
docs Remove typo (#64760) (#64810) 2020-11-09 12:34:48 -05:00
license-tools Replace immediate task creations by using task avoidance api (#60071) (#60504) 2020-07-31 13:09:04 +02:00
plugin SQL: Fix the return type in the sign function (#64845) (#64968) 2020-11-11 17:07:17 -05:00
qa [7.10] Add DiscoveryNodeRole compatibility role for bwc tier serialization (#63581) (#63613) 2020-10-13 09:17:15 -06:00
snapshot-tool Fix Broken Exception Handling in Snapshot Cleanup Tool (#63243) 2020-10-05 16:50:47 +02:00
test Disable composePull task on idp-fixture project due to error (#62510) 2020-09-17 08:55:47 -07:00
transport-client Replace compile configuration usage with api (7.x backport) (#58721) 2020-06-30 15:57:41 +02:00
NOTICE.txt
README.md
build.gradle Replace immediate task creations by using task avoidance api (#60071) (#60504) 2020-07-31 13:09:04 +02:00

README.md

Elastic License Functionality

This directory tree contains files subject to the Elastic License. The files subject to the Elastic License are grouped in this directory to clearly separate them from files licensed under the Apache License 2.0.