From 040552fbeeb1ea74a794d0e2542cd8c4b509ba5c Mon Sep 17 00:00:00 2001 From: Guian Gumpac Date: Wed, 17 Nov 2021 13:48:34 -0800 Subject: [PATCH 01/18] Added Tableau Connector to OpenSearch SQL Signed-off-by: Guian Gumpac --- .../opensearch_sql_jdbc/META-INF/MANIFEST.MF | 3 + .../opensearch_sql_jdbc/connection-fields.xml | 44 +++ .../connection-metadata.xml | 6 + .../opensearch_sql_jdbc/connectionBuilder.js | 28 ++ .../connectionResolver.tdr | 26 ++ .../opensearch_sql_jdbc/dialect.tdd | 349 ++++++++++++++++++ .../opensearch_sql_jdbc/manifest.xml | 53 +++ .../opensearch_sql_jdbc_dev.taco | Bin 0 -> 5259 bytes 8 files changed, 509 insertions(+) create mode 100644 sql-jdbc/src/TableauConnector/opensearch_sql_jdbc/META-INF/MANIFEST.MF create mode 100644 sql-jdbc/src/TableauConnector/opensearch_sql_jdbc/connection-fields.xml create mode 100644 sql-jdbc/src/TableauConnector/opensearch_sql_jdbc/connection-metadata.xml create mode 100644 sql-jdbc/src/TableauConnector/opensearch_sql_jdbc/connectionBuilder.js create mode 100644 sql-jdbc/src/TableauConnector/opensearch_sql_jdbc/connectionResolver.tdr create mode 100644 sql-jdbc/src/TableauConnector/opensearch_sql_jdbc/dialect.tdd create mode 100644 sql-jdbc/src/TableauConnector/opensearch_sql_jdbc/manifest.xml create mode 100644 sql-jdbc/src/TableauConnector/opensearch_sql_jdbc/opensearch_sql_jdbc_dev.taco diff --git a/sql-jdbc/src/TableauConnector/opensearch_sql_jdbc/META-INF/MANIFEST.MF b/sql-jdbc/src/TableauConnector/opensearch_sql_jdbc/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..97a662d62c --- /dev/null +++ b/sql-jdbc/src/TableauConnector/opensearch_sql_jdbc/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Created-By: 13 (Oracle Corporation) + diff --git a/sql-jdbc/src/TableauConnector/opensearch_sql_jdbc/connection-fields.xml b/sql-jdbc/src/TableauConnector/opensearch_sql_jdbc/connection-fields.xml new file mode 100644 index 0000000000..54f5296f7e --- /dev/null +++ b/sql-jdbc/src/TableauConnector/opensearch_sql_jdbc/connection-fields.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sql-jdbc/src/TableauConnector/opensearch_sql_jdbc/connection-metadata.xml b/sql-jdbc/src/TableauConnector/opensearch_sql_jdbc/connection-metadata.xml new file mode 100644 index 0000000000..1b3432c317 --- /dev/null +++ b/sql-jdbc/src/TableauConnector/opensearch_sql_jdbc/connection-metadata.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/sql-jdbc/src/TableauConnector/opensearch_sql_jdbc/connectionBuilder.js b/sql-jdbc/src/TableauConnector/opensearch_sql_jdbc/connectionBuilder.js new file mode 100644 index 0000000000..1a16fddaec --- /dev/null +++ b/sql-jdbc/src/TableauConnector/opensearch_sql_jdbc/connectionBuilder.js @@ -0,0 +1,28 @@ +(function dsbuilder(attr){ + var connStr = "jdbc:opensearch://"; + // Set SSL value in connection string + if (attr[connectionHelper.attributeSSLMode] == "require"){ + connStr += "https://"; + } else { + connStr += "http://"; + } + + // Set host information in connection string + connStr += attr[connectionHelper.attributeServer] + ":" + attr[connectionHelper.attributePort] + "?"; + + // Set authentication values in connection string + var authAttrValue = attr[connectionHelper.attributeAuthentication]; + if (authAttrValue == "auth-none"){ + connStr += "auth=NONE&trustSelfSigned=" + attr["v-trustSelfSigned"]; + } else if (authAttrValue == "auth-integrated"){ + connStr += "auth=AWS_SIGV4"; + var region = attr["v-region"]; + if (region){ + connStr += "&Region=" + region; + } + } else { //if (authAttrValue == "auth-user-pass"){ + connStr += "auth=BASIC&user=" + attr[connectionHelper.attributeUsername] + "&password=" + attr[connectionHelper.attributePassword] + "&trustSelfSigned=" + attr["v-trustSelfSigned"]; + } + + return [connStr]; +}) diff --git a/sql-jdbc/src/TableauConnector/opensearch_sql_jdbc/connectionResolver.tdr b/sql-jdbc/src/TableauConnector/opensearch_sql_jdbc/connectionResolver.tdr new file mode 100644 index 0000000000..c51adc002e --- /dev/null +++ b/sql-jdbc/src/TableauConnector/opensearch_sql_jdbc/connectionResolver.tdr @@ -0,0 +1,26 @@ + + + + +