opensearch-project / sql-odbc

OpenSearchODBC is a read-only ODBC driver for Windows and Mac for connecting to OpenSearch SQL support.
Apache License 2.0
7 stars 17 forks source link

Issue #70 - Add Serverless Support #73

Closed currantw closed 1 day ago

currantw commented 1 week ago

Description

Adds support for OpenSearch Serverless to the ODBC driver.

Issues Resolved

70

Check List

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Related Issues

currantw commented 3 days ago

The build_mac action is also failing on the main project (https://github.com/opensearch-project/sql-odbc). Currently, building locally on Mac fails unless the -Werror flag is removed, so this is perhaps the cause of this failure.

Raised this issue to address this: https://github.com/opensearch-project/sql-odbc/issues/74

currantw commented 3 days ago

Automated testing is non-trivial, and has been deferred to #75. In the meantime, we have performed the following to test this new behaviour on Mac:

TESTING SERVERLESS

Amazon OpenSearch Serverless cluster was setup for testing. See comments for more details.

✅ ODBC connects successfully with iodbctest.

TESTING NON-SERVERLESS WITH EDITED HOST FILE

A local OpenSearch cluster was setup for testing.

✅ ODBC connects successfully with iodbctest.

NOTES ON TESTING

The following steps where taken to setup and test the Serverless cluster:

  1. Created a new OpenSearch Serverless cluster that includes SQL.
  2. Updated my AWS credentials file ( to add opensearchodbc profile with the appropriate access key, secret access key, and session token.
  3. Load some test data to OpenSearch using Postman.
  4. Downloaded the repo and build the .dll using CMake.
  5. Updated my odbc.ini and odbcinst.ini files to configure the ODBC (see below)
  6. Download iodbctest (brew install libiodbc).
  7. Run iodbctest, connect to the corresponding DSN, and query the test data.
image
# odbc.ini

[ODBC Data Sources]
OpenSearchServerlessDSN = OpenSearchODBC

[OpenSearchServerlessDSN]
Host                 = https://<HOST-URL>.aoss.amazonaws.com
Port                 = 443
UseSSL               = 1
ResponseTimeout      = 10
HostnameVerification = 1
Region               = <AWS_REGION>
Auth                 = AWS_SIGV4
LogOutput            = /Library/ODBC/opensearch-sql-odbc
Driver               = <PROJECT_ROOT>/build/odbc/lib/libsqlodbc.dylib
ServerlessOverride   = 1

# odbcinst.ini
[ODBC Drivers]
OpenSearchODBC = Installed

[OpenSearchODBC]
Driver = <PROJECT_ROOT>/build/odbc/lib/libsqlodbc.dylib
Setup  = <PROJECT_ROOT>//build/odbc/lib/libsqlodbc.dylib
currantw commented 1 day ago

Automated testing is non-trivial, and has been deferred to #75. In the meantime, we have performed the following to test this new behaviour on Mac:

TESTING SERVERLESS

Amazon OpenSearch Serverless cluster was setup for testing. See comments for more details.

✅ ODBC connects successfully with iodbctest.

TESTING NON-SERVERLESS WITH EDITED HOST FILE

A local OpenSearch cluster was setup for testing.

✅ ODBC connects successfully with iodbctest.

NOTES ON TESTING

The following steps where taken to setup and test the Serverless cluster:

  1. Created a new OpenSearch Serverless cluster that includes SQL.
  2. Updated my AWS credentials file ( to add opensearchodbc profile with the appropriate access key, secret access key, and session token.
  3. Load some test data to OpenSearch using Postman.
  4. Downloaded the repo and build the .dll using CMake.
  5. Updated my odbc.ini and odbcinst.ini files to configure the ODBC (see below)
  6. Download iodbctest (brew install libiodbc).
  7. Run iodbctest, connect to the corresponding DSN, and query the test data.
image
# odbc.ini

[ODBC Data Sources]
OpenSearchServerlessDSN = OpenSearchODBC

[OpenSearchServerlessDSN]
Host                 = https://<HOST-URL>.aoss.amazonaws.com
Port                 = 443
UseSSL               = 1
ResponseTimeout      = 10
HostnameVerification = 1
Region               = <AWS_REGION>
Auth                 = AWS_SIGV4
LogOutput            = /Library/ODBC/opensearch-sql-odbc
Driver               = <PROJECT_ROOT>/build/odbc/lib/libsqlodbc.dylib
ServerlessOverride   = 1

# odbcinst.ini
[ODBC Drivers]
OpenSearchODBC = Installed

[OpenSearchODBC]
Driver = <PROJECT_ROOT>/build/odbc/lib/libsqlodbc.dylib
Setup  = <PROJECT_ROOT>//build/odbc/lib/libsqlodbc.dylib