Skip to content
This repository was archived by the owner on Aug 2, 2022. It is now read-only.

Commit 35e37a3

Browse files
authored
Merge develop to master for ODFE 1.9.0.1 release (#633)
Merge develop to master for ODFE 1.9.0.1 release
2 parents af74293 + baac103 commit 35e37a3

File tree

274 files changed

+12716
-2071
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

274 files changed

+12716
-2071
lines changed
+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# The overall template of the release notes
2+
template: |
3+
Open Distro for Elasticsearch Version $RESOLVED_VERSION
4+
$CHANGES
5+
6+
# Setting the formatting and sorting for the release notes body
7+
name-template: Version $RESOLVED_VERSION
8+
change-template: "- $TITLE (PR [#$NUMBER](https://github.com/opendistro-for-elasticsearch/sql/pull/$NUMBER))"
9+
sort-by: merged_at
10+
sort-direction: ascending
11+
12+
# Organizing the tagged PRs into categories
13+
categories:
14+
- title: "Version Upgrades"
15+
labels:
16+
- "version compatibility"
17+
- title: "SQL and PPL"
18+
labels:
19+
- "SQL"
20+
- "PPL"
21+
- title: "SQL CLI"
22+
labels:
23+
- "CLI"
24+
- title: "SQL JDBC"
25+
labels:
26+
- "JDBC"
27+
- title: "SQL ODBC"
28+
labels:
29+
- "ODBC"
30+
- title: "SQL Workbench"
31+
labels:
32+
- "Workbench"
33+
- title: "Enhancements"
34+
labels:
35+
- "enhancement"
36+
- "maintenance"
37+
- title: "Bug Fixes"
38+
labels:
39+
- "bug"
40+
- title: "Documentation"
41+
labels:
42+
- "documentation"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Release Drafter
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
update_release_draft:
10+
name: Update draft release notes
11+
runs-on: ubuntu-latest
12+
steps:
13+
# Drafts your next Release notes as Pull Requests are merged into "master"
14+
- name: Update draft release notes
15+
uses: release-drafter/release-drafter@v5
16+
with:
17+
config-name: draft-release-notes-config.yml
18+
tag: (None)
19+
version: 1.9.0.1
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/sql-odbc-main.yml

+4-14
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,16 @@ jobs:
2626
brew install curl
2727
brew install cmake
2828
brew install libiodbc
29-
- name: aws-sdk-cpp-setup
30-
run: |
31-
sh aws_sdk_cpp_setup.sh
32-
- name: configure
33-
run: |
34-
prefix_path=$(pwd)
35-
mkdir cmake-build
36-
cd cmake-build
37-
cmake ../src -DCMAKE_INSTALL_PREFIX=$prefix_path/AWSSDK/ -DCMAKE_BUILD_TYPE=Release -DBUILD_ONLY="core" -DCUSTOM_MEMORY_MANAGEMENT="OFF" -DENABLE_RTTI="OFF" -DENABLE_TESTING="OFF"
38-
cd ..
39-
- name: build-driver
29+
- name: configure-and-build-driver
4030
run: |
41-
cmake --build cmake-build
31+
./build_mac_release64.sh
4232
#- name: test
4333
# run: |
4434
# bash ./run_test_runner.sh
4535
- name: build-installer
4636
if: success()
4737
run: |
48-
cd cmake-build
38+
cd cmake-build64
4939
cmake ../src
5040
make
5141
cpack .
@@ -59,7 +49,7 @@ jobs:
5949
cp ./lib64/*.dylib build
6050
cp ./lib64/*.a build
6151
cp $(ls -d bin64/* | grep -v "\.") build
62-
cp ./cmake-build/*.pkg installer
52+
cp ./cmake-build64/*.pkg installer
6353
# cp ./bin64/*.html test-output
6454
# cp ./bin64/*.log test-output
6555
- name: upload-build

README.md

+11
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@
88

99
Open Distro for Elasticsearch enables you to extract insights out of Elasticsearch using the familiar SQL query syntax. Use aggregations, group by, and where clauses to investigate your data. Read your data as JSON documents or CSV tables so you have the flexibility to use the format that works best for you.
1010

11+
12+
## SQL Related Projects
13+
14+
The following projects have been merged into this repository as separate folders as of July 9, 2020. Please refer to links below for details. This document will focus on the SQL plugin for Elasticsearch.
15+
16+
* [SQL CLI](https://github.com/opendistro-for-elasticsearch/sql/tree/master/sql-cli)
17+
* [SQL JDBC](https://github.com/opendistro-for-elasticsearch/sql/tree/master/sql-jdbc)
18+
* [SQL ODBC](https://github.com/opendistro-for-elasticsearch/sql/tree/master/sql-odbc)
19+
* [SQL Workbench](https://github.com/opendistro-for-elasticsearch/sql/tree/master/sql-workbench)
20+
21+
1122
## Documentation
1223

1324
Please refer to the [reference manual](./docs/user/index.rst) and [technical documentation](https://opendistro.github.io/for-elasticsearch-docs) for detailed information on installing and configuring opendistro-elasticsearch-sql plugin. Looking to contribute? Read the instructions on [Development Guide](./docs/developing.rst) and then submit a patch!

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ ext {
4848
}
4949

5050
allprojects {
51-
version = "${opendistroVersion}.0"
51+
version = "${opendistroVersion}.1"
5252

5353
plugins.withId('java') {
5454
sourceCompatibility = targetCompatibility = "1.8"

common/build.gradle

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ repositories {
99

1010
dependencies {
1111
compile "org.antlr:antlr4-runtime:4.7.1"
12-
compile group: 'com.google.guava', name: 'guava', version: '23.0'
12+
// https://github.com/google/guava/wiki/CVE-2018-10237
13+
compile group: 'com.google.guava', name: 'guava', version: '29.0-jre'
1314

1415
testCompile group: 'junit', name: 'junit', version: '4.12'
1516
}

core/build.gradle

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ repositories {
99
}
1010

1111
dependencies {
12-
compile group: 'com.google.guava', name: 'guava', version: '23.0'
12+
// https://github.com/google/guava/wiki/CVE-2018-10237
13+
compile group: 'com.google.guava', name: 'guava', version: '29.0-jre'
1314
compile group: 'org.springframework', name: 'spring-context', version: '5.2.5.RELEASE'
1415
compile group: 'org.springframework', name: 'spring-beans', version: '5.2.5.RELEASE'
1516
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.10'

core/src/main/java/com/amazon/opendistroforelasticsearch/sql/analysis/ExpressionAnalyzer.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ public Expression visitEqualTo(EqualTo node, AnalysisContext context) {
7878

7979
@Override
8080
public Expression visitLiteral(Literal node, AnalysisContext context) {
81-
return DSL.literal(ExprValueUtils.fromObjectValue(node.getValue()));
81+
return DSL
82+
.literal(ExprValueUtils.fromObjectValue(node.getValue(), node.getType().getCoreType()));
8283
}
8384

8485
@Override

core/src/main/java/com/amazon/opendistroforelasticsearch/sql/ast/dsl/AstDSL.java

+12
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,18 @@ public static Literal intLiteral(Integer value) {
123123
return literal(value, DataType.INTEGER);
124124
}
125125

126+
public static Literal dateLiteral(String value) {
127+
return literal(value, DataType.DATE);
128+
}
129+
130+
public static Literal timeLiteral(String value) {
131+
return literal(value, DataType.TIME);
132+
}
133+
134+
public static Literal timestampLiteral(String value) {
135+
return literal(value, DataType.TIMESTAMP);
136+
}
137+
126138
public static Literal doubleLiteral(Double value) {
127139
return literal(value, DataType.DOUBLE);
128140
}

core/src/main/java/com/amazon/opendistroforelasticsearch/sql/ast/expression/DataType.java

+22-6
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,28 @@
1515

1616
package com.amazon.opendistroforelasticsearch.sql.ast.expression;
1717

18+
import com.amazon.opendistroforelasticsearch.sql.data.type.ExprCoreType;
19+
import lombok.Getter;
20+
import lombok.RequiredArgsConstructor;
21+
22+
/**
23+
* The DataType defintion in AST.
24+
* Question, could we use {@link ExprCoreType} directly in AST?
25+
*/
26+
@RequiredArgsConstructor
1827
public enum DataType {
19-
TYPE_ERROR,
20-
NULL,
28+
TYPE_ERROR(ExprCoreType.UNKNOWN),
29+
NULL(ExprCoreType.UNKNOWN),
30+
31+
INTEGER(ExprCoreType.INTEGER),
32+
DOUBLE(ExprCoreType.DOUBLE),
33+
STRING(ExprCoreType.STRING),
34+
BOOLEAN(ExprCoreType.BOOLEAN),
35+
36+
DATE(ExprCoreType.DATE),
37+
TIME(ExprCoreType.TIME),
38+
TIMESTAMP(ExprCoreType.TIMESTAMP);
2139

22-
INTEGER,
23-
DOUBLE,
24-
STRING,
25-
BOOLEAN
40+
@Getter
41+
private final ExprCoreType coreType;
2642
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/*
2+
*
3+
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License").
6+
* You may not use this file except in compliance with the License.
7+
* A copy of the License is located at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* or in the "license" file accompanying this file. This file is distributed
12+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13+
* express or implied. See the License for the specific language governing
14+
* permissions and limitations under the License.
15+
*
16+
*/
17+
18+
package com.amazon.opendistroforelasticsearch.sql.data.model;
19+
20+
import com.google.common.base.Objects;
21+
import lombok.RequiredArgsConstructor;
22+
23+
/**
24+
* Expression Number Value.
25+
*/
26+
@RequiredArgsConstructor
27+
public abstract class AbstractExprNumberValue extends AbstractExprValue {
28+
private final Number value;
29+
30+
@Override
31+
public Integer integerValue() {
32+
return value.intValue();
33+
}
34+
35+
@Override
36+
public Long longValue() {
37+
return value.longValue();
38+
}
39+
40+
@Override
41+
public Float floatValue() {
42+
return value.floatValue();
43+
}
44+
45+
@Override
46+
public Double doubleValue() {
47+
return value.doubleValue();
48+
}
49+
50+
@Override
51+
public int hashCode() {
52+
return Objects.hashCode(value);
53+
}
54+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/*
2+
*
3+
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License").
6+
* You may not use this file except in compliance with the License.
7+
* A copy of the License is located at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* or in the "license" file accompanying this file. This file is distributed
12+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13+
* express or implied. See the License for the specific language governing
14+
* permissions and limitations under the License.
15+
*
16+
*/
17+
18+
package com.amazon.opendistroforelasticsearch.sql.data.model;
19+
20+
import com.amazon.opendistroforelasticsearch.sql.exception.ExpressionEvaluationException;
21+
22+
/**
23+
* Abstract ExprValue.
24+
*/
25+
public abstract class AbstractExprValue implements ExprValue {
26+
/**
27+
* The customize compareTo logic.
28+
*/
29+
@Override
30+
public int compareTo(ExprValue other) {
31+
if (this.isNull() || this.isMissing()) {
32+
return this.compare(other);
33+
} else if (other.isNull() || other.isMissing()) {
34+
return -other.compareTo(this);
35+
}
36+
if (!this.type().equals(other.type())) {
37+
throw new ExpressionEvaluationException(
38+
String.format(
39+
"compare expected value have same type, but with [%s, %s]",
40+
this.type(), other.type()));
41+
}
42+
return compare(other);
43+
}
44+
45+
/**
46+
* The customize equals logic.
47+
* The table below list the NULL and MISSING handling logic.
48+
* A B A == B
49+
* NULL NULL TRUE
50+
* NULL MISSING FALSE
51+
* MISSING NULL FALSE
52+
* MISSING MISSING TRUE
53+
*/
54+
@Override
55+
public boolean equals(Object o) {
56+
if (o == this) {
57+
return true;
58+
} else if (!(o instanceof ExprValue)) {
59+
return false;
60+
}
61+
ExprValue other = (ExprValue) o;
62+
if (this.isNull() || this.isMissing()) {
63+
return equal(other);
64+
} else if (other.isNull() || other.isMissing()) {
65+
return other.equals(this);
66+
} else {
67+
return equal(other);
68+
}
69+
}
70+
71+
/**
72+
* The expression value compare.
73+
*/
74+
public abstract int compare(ExprValue other);
75+
76+
/**
77+
* The expression value equal.
78+
*/
79+
public abstract boolean equal(ExprValue other);
80+
}

0 commit comments

Comments
 (0)