Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/sql-jdbc-test-and-build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
java-version: 1.14

- name: Build with Gradle
run: ./gradlew build
run: ./gradlew build test shadowJar

- name: Create Artifact Path
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sql-odbc-release-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ env:
ODBC_BUILD_PATH: "./build/odbc/build"
AWS_SDK_INSTALL_PATH: "./build/aws-sdk/install"
PLUGIN_NAME: opensearch-sql-odbc
OD_VERSION: 1.15.0.0
OD_VERSION: 1.0.0.0

jobs:
build-mac:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sql-odbc-rename-and-release-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- rename*

env:
OD_VERSION: 1.15.0.0
OD_VERSION: 1.0.0.0

jobs:
upload-odbc:
Expand Down
20 changes: 16 additions & 4 deletions .github/workflows/sql-test-and-build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,29 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: 1.14

# Publish OpenSearch to local Maven repo for now
- name: Checkout OpenSearch
uses: actions/checkout@v2
with:
repository: 'opensearch-project/OpenSearch'
path: OpenSearch
ref: 1.0.0-alpha1

- name: Build OpenSearch
working-directory: ./OpenSearch
run: ./gradlew publishToMavenLocal -Dbuild.version_qualifier=alpha1 -Dbuild.snapshot=false

- name: Build with Gradle
run: ./gradlew build assemble

- name: Create Artifact Path
run: |
mkdir -p opendistro-sql-builds
cp -r ./plugin/build/distributions/*.zip opendistro-sql-builds/
mkdir -p opensearch-sql-builds
cp -r ./plugin/build/distributions/*.zip opensearch-sql-builds/

- name: Upload Artifacts
uses: actions/upload-artifact@v1
with:
name: opendistro-sql
path: opendistro-sql-builds
name: opensearch-sql
path: opensearch-sql-builds
2 changes: 1 addition & 1 deletion .github/workflows/sql-workbench-release-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

env:
PLUGIN_NAME: queryWorkbenchDashboards
OD_VERSION: 1.15.0.0
OD_VERSION: 1.0.0.0

jobs:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [pull_request, push]

env:
PLUGIN_NAME: queryWorkbenchDashboards
OD_VERSION: 1.15.0.0
OD_VERSION: 1.0.0.0

jobs:

Expand Down
4 changes: 2 additions & 2 deletions DEVELOPER_GUIDE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,9 @@ Sometime you want to deploy your changes to local OpenSearch cluster, basically

To automate this common task, you can prepare an all-in-one command for reuse. Below is a sample command for macOS::

./gradlew assemble && {echo y | cp -f build/distributions/opendistro_sql-1*0.jar <OpenSearch_home>/plugins/opendistro-sql} && {kill $(ps aux | awk '/[O]pensearch/ {print $2}'); sleep 3; nohup <OpenSearch_home>/bin/opensearch > ~/Temp/opensearch.log 2>&1 &}
./gradlew assemble && {echo y | cp -f build/distributions/opendistro_sql-1*0.jar <OpenSearch_home>/plugins/opensearch-sql} && {kill $(ps aux | awk '/[O]pensearch/ {print $2}'); sleep 3; nohup <OpenSearch_home>/bin/opensearch > ~/Temp/opensearch.log 2>&1 &}

Note that for the first time you need to create ``opendistro-sql`` folder and unzip ``build/distribution/opendistro_sql-xxxx.zip`` to it.
Note that for the first time you need to create ``opensearch-sql`` folder and unzip ``build/distribution/opendistro_sql-xxxx.zip`` to it.


Documentation
Expand Down
23 changes: 6 additions & 17 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,17 @@

buildscript {
ext {
es_version = "7.10.3-SNAPSHOT"
opensearch_version = "1.0.0-alpha1"
}

repositories {
mavenLocal()
mavenCentral()
maven {
url = 's3://search-vemsarat/'
credentials(AwsCredentials) {
accessKey = System.env.AWS_ACCESS_KEY_ID ?: findProperty('aws_access_key_id')
secretKey = System.env.AWS_SECRET_ACCESS_KEY ?: findProperty('aws_secret_access_key')
}
}
jcenter()
}

dependencies {
classpath "org.opensearch.gradle:build-tools:${es_version}"
classpath "org.opensearch.gradle:build-tools:${opensearch_version}"
}
}

Expand All @@ -56,11 +50,12 @@ plugins {

// Repository on root level is for dependencies that project code depends on. And this block must be placed after plugins{}
repositories {
mavenLocal()
mavenCentral() // For Elastic Libs that you can use to get started coding until open OpenSearch libs are available
}

ext {
opendistroVersion = '1.15.0'
opendistroVersion = '1.0.0'
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
}

Expand All @@ -74,14 +69,8 @@ allprojects {

subprojects {
repositories {
mavenLocal()
mavenCentral()
maven {
url = 's3://search-vemsarat/'
credentials(AwsCredentials) {
accessKey = System.env.AWS_ACCESS_KEY_ID ?: findProperty('aws_access_key_id')
secretKey = System.env.AWS_SECRET_ACCESS_KEY ?: findProperty('aws_secret_access_key')
}
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion docs/dev/Doctest.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ The reason we are not using OpenSearch test framework, is due to the difficulty

### 2.2.2 Gradle

1. Create new module/packdage `doctest` under current `opendistro-sql`, and integrate to gradle management
1. Create new module/packdage `doctest` under current `opensearch-sql`, and integrate to gradle management
1. ![doctest-gradle-project-structure](img/doctest-gradle-project-structure.png)

2. Set up gradle build script, which enables doctest by `./gradlew doctest`
Expand Down
4 changes: 1 addition & 3 deletions doctest/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ task bootstrap(type: Exec) {

//evaluationDependsOn(':')
task startES(type: SpawnProcessTask) {
def accessKey = System.env.AWS_ACCESS_KEY_ID ?: findProperty('aws_access_key_id')
def secretKey = System.env.AWS_SECRET_ACCESS_KEY ?: findProperty('aws_secret_access_key')
command "${path}/gradlew -p ${plugin_path} runRestTestCluster -Paws_access_key_id=$accessKey -Paws_secret_access_key=$secretKey"
command "${path}/gradlew -p ${plugin_path} runRestTestCluster"
ready 'started'
}

Expand Down
6 changes: 3 additions & 3 deletions integ-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ configurations.all {
}

dependencies {
testCompile group: 'org.opensearch.test', name: 'framework', version: "${es_version}"
testCompile group: 'org.opensearch.client', name: 'opensearch-rest-high-level-client', version: "${es_version}"
testCompile group: 'org.opensearch.client', name: 'opensearch-rest-client', version: "${es_version}"
testCompile group: 'org.opensearch.test', name: 'framework', version: "${opensearch_version}"
testCompile group: 'org.opensearch.client', name: 'opensearch-rest-high-level-client', version: "${opensearch_version}"
testCompile group: 'org.opensearch.client', name: 'opensearch-rest-client', version: "${opensearch_version}"
testCompile group: 'org.hamcrest', name: 'hamcrest', version: '2.1'
testCompile group: 'org.apache.logging.log4j', name: 'log4j-core', version:'2.11.1'
testCompile project(':plugin')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/
package com.amazon.opendistroforelasticsearch.sql.ppl;

import static com.amazon.opendistroforelasticsearch.sql.plugin.rest.RestPPLQueryAction.LEGACY_EXPLAIN_API_ENDPOINT;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/
package com.amazon.opendistroforelasticsearch.sql.sql;

import static com.amazon.opendistroforelasticsearch.sql.legacy.TestsConstants.TEST_INDEX_ACCOUNT;
Expand Down
8 changes: 4 additions & 4 deletions legacy/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ test {
dependencies {
compile group: 'com.alibaba', name: 'druid', version:'1.0.15'
compile group: 'org.locationtech.spatial4j', name: 'spatial4j', version:'0.7'
compile group: "org.opensearch.plugin", name: 'parent-join-client', version: "${es_version}"
compile group: "org.opensearch.plugin", name: 'reindex-client', version: "${es_version}"
compile group: "org.opensearch.plugin", name: 'parent-join-client', version: "${opensearch_version}"
compile group: "org.opensearch.plugin", name: 'reindex-client', version: "${opensearch_version}"
constraints {
implementation('commons-codec:commons-codec:1.13') {
because 'https://www.whitesourcesoftware.com/vulnerability-database/WS-2019-0379'
Expand All @@ -98,7 +98,7 @@ dependencies {
implementation group: 'com.google.guava', name: 'guava', version: '29.0-jre'
compile group: 'org.json', name: 'json', version:'20180813'
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.10'
compile group: 'org.opensearch', name: 'opensearch', version: "${es_version}"
compile group: 'org.opensearch', name: 'opensearch', version: "${opensearch_version}"
compile project(':sql')
compile project(':common')
compile project(':opensearch')
Expand All @@ -111,6 +111,6 @@ dependencies {
testCompile group: 'org.hamcrest', name: 'hamcrest-core', version:'2.2'
testCompile group: 'org.mockito', name: 'mockito-core', version:'3.5.0'
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: "org.opensearch.client", name: 'transport', version: "${es_version}"
testCompile group: "org.opensearch.client", name: 'transport', version: "${opensearch_version}"

}
6 changes: 3 additions & 3 deletions opensearch/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@ plugins {

dependencies {
compile project(':core')
compile group: 'org.opensearch', name: 'opensearch', version: "${es_version}"
compile group: 'org.opensearch', name: 'opensearch', version: "${opensearch_version}"
compile "io.github.resilience4j:resilience4j-retry:1.5.0"
compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.10.5'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.11.4'
compile group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-cbor', version: '2.11.4'
compile group: 'org.json', name: 'json', version:'20180813'
compileOnly group: 'org.opensearch.client', name: 'opensearch-rest-high-level-client', version: "${es_version}"
compileOnly group: 'org.opensearch.client', name: 'opensearch-rest-high-level-client', version: "${opensearch_version}"

testImplementation('org.junit.jupiter:junit-jupiter:5.6.2')
testCompile group: 'org.hamcrest', name: 'hamcrest-library', version: '2.1'
testCompile group: 'org.mockito', name: 'mockito-core', version: '3.5.0'
testCompile group: 'org.mockito', name: 'mockito-junit-jupiter', version: '3.5.0'
testCompile group: 'org.opensearch.client', name: 'opensearch-rest-high-level-client', version: "${es_version}"
testCompile group: 'org.opensearch.client', name: 'opensearch-rest-high-level-client', version: "${opensearch_version}"
}

test {
Expand Down
2 changes: 1 addition & 1 deletion plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ repositories {
}

opensearchplugin {
name 'opendistro-sql'
name 'opensearch-sql'
description 'OpenSearch SQL'
classname 'com.amazon.opendistroforelasticsearch.sql.plugin.SQLPlugin'
licenseFile rootProject.file("LICENSE.txt")
Expand Down
2 changes: 1 addition & 1 deletion ppl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ dependencies {
compile "org.antlr:antlr4-runtime:4.7.1"
// https://github.com/google/guava/wiki/CVE-2018-10237
compile group: 'com.google.guava', name: 'guava', version: '29.0-jre'
compile group: 'org.opensearch', name: 'opensearch-x-content', version: "${es_version}"
compile group: 'org.opensearch', name: 'opensearch-x-content', version: "${opensearch_version}"
compile group: 'org.json', name: 'json', version: '20180813'
compile group: 'org.springframework', name: 'spring-context', version: '5.2.5.RELEASE'
compile group: 'org.springframework', name: 'spring-beans', version: '5.2.5.RELEASE'
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* permissions and limitations under the License.
*/

rootProject.name = 'opendistro-sql'
rootProject.name = 'opensearch-sql'

include 'plugin'
include 'ppl'
Expand Down
2 changes: 1 addition & 1 deletion sql-cli/src/opensearch_sql_cli/opensearch_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def get_open_distro_client(self):

def is_sql_plugin_installed(self, opensearch_client):
self.plugins = opensearch_client.cat.plugins(params={"s": "component", "v": "true"})
sql_plugin_name_list = ["opendistro-sql", "opendistro_sql"]
sql_plugin_name_list = ["opendistro-sql", "opendistro_sql", "opensearch-sql"]
return any(x in self.plugins for x in sql_plugin_name_list)

def set_connection(self, is_reconnect=False):
Expand Down
2 changes: 1 addition & 1 deletion sql-jdbc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ plugins {
group 'com.amazon.opendistroforelasticsearch.client'

// keep version in sync with version in Driver source
version '1.15.0.0'
version '1.0.0.0'

boolean snapshot = "true".equals(System.getProperty("build.snapshot", "true"));
if (snapshot) {
Expand Down
2 changes: 1 addition & 1 deletion sql-jdbc/docs/tableau.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

### Specify the JDBC driver

Place the `opendistro-sql-jdbc-x.x.x.x.jar` file in the folder for your operating system. (Create the folder if it doesn't already exist.)
Place the `opensearch-sql-jdbc-x.x.x.x.jar` file in the folder for your operating system. (Create the folder if it doesn't already exist.)

| Platform | Driver Path |
|---|---|
Expand Down
2 changes: 1 addition & 1 deletion sql-jdbc/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
*
*/

rootProject.name = 'opendistro-sql-jdbc'
rootProject.name = 'opensearch-sql-jdbc'
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
public enum Version {

// keep this in sync with the gradle version
Current(1, 15, 0, 0);
Current(1, 0, 0, 0);

private int major;
private int minor;
Expand Down
4 changes: 2 additions & 2 deletions sql-odbc/docs/user/mac_configure_dsn.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Note: In order to use the OpenSearch SQL ODBC driver with the [Tableau Connector
1. Go to the **ODBC Drivers** tab.
2. Click **Add a Driver**.
* **Description of the Driver**: The driver name used for ODBC connections (ex. `ODFE SQL ODBC Driver`)
* **Driver File Name**: The path to the driver file (default installed path: `/Library/ODBC/odfesqlodbc/bin/libodfesqlodbc.dylib`)
* **Setup File Name**: The path to the driver file (default installed path: `/Library/ODBC/odfesqlodbc/bin/libodfesqlodbc.dylib`)
* **Driver File Name**: The path to the driver file (default installed path: `/Library/ODBC/opensearch-sql-odbc/bin/libodfesqlodbc.dylib`)
* **Setup File Name**: The path to the driver file (default installed path: `/Library/ODBC/opensearch-sql-odbc/bin/libodfesqlodbc.dylib`)
* Set as a **User** driver
* Below is a screenshot of how the final screen should look.
3. Click **OK** to save the options.
Expand Down
4 changes: 2 additions & 2 deletions sql-odbc/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ set(INSTALL_SRC "${CMAKE_CURRENT_SOURCE_DIR}/installer")
set(DSN_INSTALLER_SRC "${CMAKE_CURRENT_SOURCE_DIR}/DSNInstaller")

# ODBC Driver version
set(DRIVER_PACKAGE_VERSION "1.15.0.0")
set(DRIVER_PACKAGE_VERSION_COMMA_SEPARATED "1,15,0,0")
set(DRIVER_PACKAGE_VERSION "1.0.0.0")
set(DRIVER_PACKAGE_VERSION_COMMA_SEPARATED "1,0,0,0")
add_compile_definitions( OPENSEARCH_ODBC_VERSION="${DRIVER_PACKAGE_VERSION}"
# Comma separated version is required for odbc administrator's driver file.
OPENSEARCH_ODBC_DRVFILE_VERSION=${DRIVER_PACKAGE_VERSION_COMMA_SEPARATED} )
Expand Down
2 changes: 1 addition & 1 deletion sql-odbc/src/TableauConnector/odfe_sql_odbc/manifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='utf-8' ?>

<connector-plugin class='odfe_sql_odbc' superclass='odbc' plugin-version='1.15.0.0' name='SQL' version='18.1' min-version-tableau='2020.1'>
<connector-plugin class='odfe_sql_odbc' superclass='odbc' plugin-version='1.0.0.0' name='SQL' version='18.1' min-version-tableau='2020.1'>
<vendor-information>
<company name="Open Distro for ES"/>
<support-link url="https://github.com/opensearch-project/sql"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='utf-8' ?>

<connector-plugin class='odfe_sql_odbc_dev' superclass='odbc' plugin-version='1.15.0.0' name='OpenSearch SQL ODBC DEV' version='18.1' min-version-tableau='2020.1'>
<connector-plugin class='odfe_sql_odbc_dev' superclass='odbc' plugin-version='1.0.0.0' name='OpenSearch SQL ODBC DEV' version='18.1' min-version-tableau='2020.1'>
<vendor-information>
<company name="OpenSearch"/>
<support-link url="https://github.com/opensearch-project/sql"/>
Expand Down
4 changes: 2 additions & 2 deletions sql-odbc/src/installer/Resources/README.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
All files are available in '/Library/ODBC/odfe-sql-odbc' after installation.
All files are available in '/Library/ODBC/opensearch-sql-odbc' after installation.

To setup a connection, you can use DSN to store your data source connection information,
1. Open 'iODBC Data Source Administrator'.
2. Go to 'User DSN'.
3. Select 'ODFE SQL ODBC DSN' and click on 'Configure'.
4. Update the connection string values. For the list of all supported options, check '/Library/ODBC/odfe-sql-odbc/doc/README.md'.
4. Update the connection string values. For the list of all supported options, check '/Library/ODBC/opensearch-sql-odbc/doc/README.md'.
5. Click 'Ok' to save changes.

If using with ODBC compatible BI tools, refer to the tool documentation on configuring a new ODBC driver. The typical requirement is to make the tool aware of the location of the driver library file and then use it to setup database (i.e OpenSearch) connections.
Expand Down
4 changes: 2 additions & 2 deletions sql-odbc/src/installer/postinstall
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# GitHub history for details.

PKG_INSTALL_DIR=/Applications
FINAL_INSTALL_DIR=/Library/ODBC/odfe-sql-odbc
FINAL_INSTALL_DIR=/Library/ODBC/opensearch-sql-odbc

# Remove install directory if it already exists
if [ -d "${FINAL_INSTALL_DIR}" ]; then
Expand All @@ -30,7 +30,7 @@ mv ${PKG_INSTALL_DIR}/resources ${FINAL_INSTALL_DIR}/resources

# Run DSN installer to configurate driver and DSN for system for easy setup.
# chmod a+x ${FINAL_INSTALL_DIR}/bin/dsn_installer
# chmod a+x ${FINAL_INSTALL_DIR}/bin/remove-odfe-dsn.sh
# chmod a+x ${FINAL_INSTALL_DIR}/bin/remove-opensearch-dsn.sh
# echo "I can write to this file" > /tmp/dsn_installer.log
# ${FINAL_INSTALL_DIR}/bin/dsn_installer ${FINAL_INSTALL_DIR}/bin/ >> /tmp/dsn_installer.log
# echo "After DSN Installer finishes" >> /tmp/dsn_installer.log
Loading