Skip to content
This repository was archived by the owner on Aug 2, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
b071f51
Merge all SQL repos and adjust workflows (#549)
joshuali925 Jul 9, 2020
0622896
adding filter for columns in SQLColumns call (#556)
rupal-bq Jul 10, 2020
4b139c4
Keep mismatch results when error occurs in comparison test (#557)
dai-chen Jul 10, 2020
13afbe5
Support mathematical functions ceil/ceiling, exp, floor, ln, log (#540)
chloe-zh Jul 12, 2020
bc02233
add date and time support (#568)
penghuo Jul 13, 2020
eea2920
ODBC: Build driver files in parallel (#570)
jordanw-bq Jul 13, 2020
4888d37
ODBC: Remove catalog support from driver (#566)
jordanw-bq Jul 13, 2020
7fbe349
ODBC: Add documents for `Refresh` & `Export as CSV files` options in …
rupal-bq Jul 13, 2020
51f353d
ODBC: Update documentation for using Microsoft Excel with Open Distro…
rupal-bq Jul 14, 2020
0b57d93
Add workflow to draft release on push (#572)
joshuali925 Jul 16, 2020
9d72867
Support mathematical functions: conv, crc32, mod, pow/power, round, s…
chloe-zh Jul 20, 2020
d74cb81
Fix object/nested field select issue (#584)
dai-chen Jul 20, 2020
c66b85f
ODBC: Add user documentation for using Microsoft Excel on Mac (#594)
rupal-bq Jul 20, 2020
af4ff91
ODBC: add ODBC 2.x functions called by Excel for Mac (#592)
jordanw-bq Jul 20, 2020
8262994
ODBC: Updating Microsoft Excel connection documents (#581)
rupal-bq Jul 20, 2020
c9ea038
Extra fixes for Mac ODBC driver (#602)
jordanw-bq Jul 21, 2020
277c966
bumped lodash version (#598)
chloe-zh Jul 21, 2020
0a878ab
Support SELECT * and FROM clause in new SQL parser (#573)
dai-chen Jul 21, 2020
5365ca0
ODBC: Adding Power BI M connector (#596)
rupal-bq Jul 21, 2020
e8f0539
Using UTC as default timezone for date_format function if not provide…
penghuo Jul 21, 2020
7372a44
Fix CAST bool field to integer issue (#600)
dai-chen Jul 22, 2020
78a51a4
Support mathematical functions rand and constants e, pi (#591)
chloe-zh Jul 22, 2020
49883b9
Support trigonometric functions acos, asin, atan, atan2, cos, cot, de…
chloe-zh Jul 22, 2020
353c1c8
Add ElasticsearchExprValueFactory in StorageEngine (#608)
penghuo Jul 23, 2020
6ba778f
Update docs after merging repos (#563)
joshuali925 Jul 24, 2020
3368d60
ODBC: Report error from Excel when executing an invalid query (#611)
jordanw-bq Jul 25, 2020
f3517ee
ODBC: adding manual test plan for Microsoft Excel testing (#604)
rupal-bq Jul 25, 2020
9dac0ac
ODBC: Adding BASIC & AWS_SIGV4 auth in M Connector (#610)
rupal-bq Jul 25, 2020
e370ce9
ODBC: Change Tableau connector version (#622)
rupal-bq Jul 28, 2020
5a7084f
Issue 623, fix security vulnerability regarding to depedencies common…
penghuo Jul 28, 2020
0211d7e
Support queries end with semi colon (#609)
dai-chen Jul 29, 2020
bee2ca2
ODBC: Fix for data loading failure in Power BI Desktop (#627)
rupal-bq Jul 29, 2020
b258fda
Add Text and Keyword Data Type (#620)
penghuo Jul 29, 2020
e61b5fd
Move workbench down in kibana nav (#578)
joshuali925 Jul 29, 2020
caf21a6
Bump versions to 1.9.0.1 and add release notes (#632)
joshuali925 Jul 29, 2020
baac103
resolve conflict
joshuali925 Jul 29, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/draft-release-notes-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# The overall template of the release notes
template: |
Open Distro for Elasticsearch Version $RESOLVED_VERSION
$CHANGES

# Setting the formatting and sorting for the release notes body
name-template: Version $RESOLVED_VERSION
change-template: "- $TITLE (PR [#$NUMBER](https://github.com/opendistro-for-elasticsearch/sql/pull/$NUMBER))"
sort-by: merged_at
sort-direction: ascending

# Organizing the tagged PRs into categories
categories:
- title: "Version Upgrades"
labels:
- "version compatibility"
- title: "SQL and PPL"
labels:
- "SQL"
- "PPL"
- title: "SQL CLI"
labels:
- "CLI"
- title: "SQL JDBC"
labels:
- "JDBC"
- title: "SQL ODBC"
labels:
- "ODBC"
- title: "SQL Workbench"
labels:
- "Workbench"
- title: "Enhancements"
labels:
- "enhancement"
- "maintenance"
- title: "Bug Fixes"
labels:
- "bug"
- title: "Documentation"
labels:
- "documentation"
21 changes: 21 additions & 0 deletions .github/workflows/draft-release-notes-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Release Drafter

on:
push:
branches:
- master

jobs:
update_release_draft:
name: Update draft release notes
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
- name: Update draft release notes
uses: release-drafter/release-drafter@v5
with:
config-name: draft-release-notes-config.yml
tag: (None)
version: 1.9.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 changes: 4 additions & 14 deletions .github/workflows/sql-odbc-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,16 @@ jobs:
brew install curl
brew install cmake
brew install libiodbc
- name: aws-sdk-cpp-setup
run: |
sh aws_sdk_cpp_setup.sh
- name: configure
run: |
prefix_path=$(pwd)
mkdir cmake-build
cd cmake-build
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"
cd ..
- name: build-driver
- name: configure-and-build-driver
run: |
cmake --build cmake-build
./build_mac_release64.sh
#- name: test
# run: |
# bash ./run_test_runner.sh
- name: build-installer
if: success()
run: |
cd cmake-build
cd cmake-build64
cmake ../src
make
cpack .
Expand All @@ -59,7 +49,7 @@ jobs:
cp ./lib64/*.dylib build
cp ./lib64/*.a build
cp $(ls -d bin64/* | grep -v "\.") build
cp ./cmake-build/*.pkg installer
cp ./cmake-build64/*.pkg installer
# cp ./bin64/*.html test-output
# cp ./bin64/*.log test-output
- name: upload-build
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@

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.


## SQL Related Projects

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.

* [SQL CLI](https://github.com/opendistro-for-elasticsearch/sql/tree/master/sql-cli)
* [SQL JDBC](https://github.com/opendistro-for-elasticsearch/sql/tree/master/sql-jdbc)
* [SQL ODBC](https://github.com/opendistro-for-elasticsearch/sql/tree/master/sql-odbc)
* [SQL Workbench](https://github.com/opendistro-for-elasticsearch/sql/tree/master/sql-workbench)


## Documentation

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!
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ ext {
}

allprojects {
version = "${opendistroVersion}.0"
version = "${opendistroVersion}.1"

plugins.withId('java') {
sourceCompatibility = targetCompatibility = "1.8"
Expand Down
3 changes: 2 additions & 1 deletion common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ repositories {

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

testCompile group: 'junit', name: 'junit', version: '4.12'
}
3 changes: 2 additions & 1 deletion core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ repositories {
}

dependencies {
compile group: 'com.google.guava', name: 'guava', version: '23.0'
// https://github.com/google/guava/wiki/CVE-2018-10237
compile group: 'com.google.guava', name: 'guava', version: '29.0-jre'
compile group: 'org.springframework', name: 'spring-context', version: '5.2.5.RELEASE'
compile group: 'org.springframework', name: 'spring-beans', version: '5.2.5.RELEASE'
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.10'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ public Expression visitEqualTo(EqualTo node, AnalysisContext context) {

@Override
public Expression visitLiteral(Literal node, AnalysisContext context) {
return DSL.literal(ExprValueUtils.fromObjectValue(node.getValue()));
return DSL
.literal(ExprValueUtils.fromObjectValue(node.getValue(), node.getType().getCoreType()));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,18 @@ public static Literal intLiteral(Integer value) {
return literal(value, DataType.INTEGER);
}

public static Literal dateLiteral(String value) {
return literal(value, DataType.DATE);
}

public static Literal timeLiteral(String value) {
return literal(value, DataType.TIME);
}

public static Literal timestampLiteral(String value) {
return literal(value, DataType.TIMESTAMP);
}

public static Literal doubleLiteral(Double value) {
return literal(value, DataType.DOUBLE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,28 @@

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

import com.amazon.opendistroforelasticsearch.sql.data.type.ExprCoreType;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

/**
* The DataType defintion in AST.
* Question, could we use {@link ExprCoreType} directly in AST?
*/
@RequiredArgsConstructor
public enum DataType {
TYPE_ERROR,
NULL,
TYPE_ERROR(ExprCoreType.UNKNOWN),
NULL(ExprCoreType.UNKNOWN),

INTEGER(ExprCoreType.INTEGER),
DOUBLE(ExprCoreType.DOUBLE),
STRING(ExprCoreType.STRING),
BOOLEAN(ExprCoreType.BOOLEAN),

DATE(ExprCoreType.DATE),
TIME(ExprCoreType.TIME),
TIMESTAMP(ExprCoreType.TIMESTAMP);

INTEGER,
DOUBLE,
STRING,
BOOLEAN
@Getter
private final ExprCoreType coreType;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
*
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*
*/

package com.amazon.opendistroforelasticsearch.sql.data.model;

import com.google.common.base.Objects;
import lombok.RequiredArgsConstructor;

/**
* Expression Number Value.
*/
@RequiredArgsConstructor
public abstract class AbstractExprNumberValue extends AbstractExprValue {
private final Number value;

@Override
public Integer integerValue() {
return value.intValue();
}

@Override
public Long longValue() {
return value.longValue();
}

@Override
public Float floatValue() {
return value.floatValue();
}

@Override
public Double doubleValue() {
return value.doubleValue();
}

@Override
public int hashCode() {
return Objects.hashCode(value);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/*
*
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*
*/

package com.amazon.opendistroforelasticsearch.sql.data.model;

import com.amazon.opendistroforelasticsearch.sql.exception.ExpressionEvaluationException;

/**
* Abstract ExprValue.
*/
public abstract class AbstractExprValue implements ExprValue {
/**
* The customize compareTo logic.
*/
@Override
public int compareTo(ExprValue other) {
if (this.isNull() || this.isMissing()) {
return this.compare(other);
} else if (other.isNull() || other.isMissing()) {
return -other.compareTo(this);
}
if (!this.type().equals(other.type())) {
throw new ExpressionEvaluationException(
String.format(
"compare expected value have same type, but with [%s, %s]",
this.type(), other.type()));
}
return compare(other);
}

/**
* The customize equals logic.
* The table below list the NULL and MISSING handling logic.
* A B A == B
* NULL NULL TRUE
* NULL MISSING FALSE
* MISSING NULL FALSE
* MISSING MISSING TRUE
*/
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
} else if (!(o instanceof ExprValue)) {
return false;
}
ExprValue other = (ExprValue) o;
if (this.isNull() || this.isMissing()) {
return equal(other);
} else if (other.isNull() || other.isMissing()) {
return other.equals(this);
} else {
return equal(other);
}
}

/**
* The expression value compare.
*/
public abstract int compare(ExprValue other);

/**
* The expression value equal.
*/
public abstract boolean equal(ExprValue other);
}
Loading