Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to the plugin #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
13 changes: 5 additions & 8 deletions Presto/qubole_odbc/connection-dialog.tcd
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
<connection-dialog class='qubole_odbc'>
<connection-config>
<authentication-mode value='None' />
<authentication-mode value='PasswordOnly' />
<authentication-options>
<option name="None" default="true" value="auth-none" />
<option name="Password" default="true" value="api-token" />
</authentication-options>
<db-name-prompt value="Catalog :" />
<has-databases value="true" />

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@saugatt should we not have has-databases enabled in dialogue box?

<db-name-prompt value="@string/db_name_prompt/" />
<has-schemas value="true" />
<server-prompt value="End Point;Bucket Region : " default="https://api.qubole.com;us-east-1"/>
<service-prompt value="API Token : " />
<show-uncommitted-data-checkbox value="true" />

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@saugatt We use show-uncommitted-data-checkbox to enable streaming. I see it is removed. Do we have any specific field to achieve the same?

cc : @vijaymann

<warehouse-prompt value="Cluster Label :" default="presto" />
<server-prompt value="@string/server_prompt/" default="https://api.qubole.com;us-east-1"/>
<warehouse-prompt value="@string/warehouse_prompt/" default="presto" />
</connection-config>
</connection-dialog>
29 changes: 8 additions & 21 deletions Presto/qubole_odbc/connectionBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,23 @@
var params = {};
var server = attr[connectionHelper.attributeServer].split(';');

// It is hard coded, there are other options to
// take care Hive, Spark.
params["DSI"] = "presto"
// Database name in UI is mapped to Catalog in presto.
params["CATALOG"] = attr["dbname"];
// Server is in UI is mapped to EndPoint.
// It could take any one of the values (us, in, api)
// Drop down would be best here.
params["CATALOG"] = attr[connectionHelper.attributeDatabase];
params["ENDPOINT"] = server[0];
// Either can be treated as a password or bare string.
// Need to look into the aspects of security on reconnection.
// Service in UI is mapped to API.
params["APITOKEN"] = attr["service"];
// Warehouse in UI is mapped to cluster label.
params["CLUSTER_LABEL"] = attr["warehouse"];
//params["BUCKET_REGION"] = "ap-south-1";
params["APITOKEN"] = attr[connectionHelper.attributePassword];
params["CLUSTER_LABEL"] = attr[connectionHelper.attributeWarehouse];
params["BUCKET_REGION"] = server[1];
// use_s3 feature enabled in odbc-2.0.0
params["USE_S3"] = "true";

// Enabling PATH-STYLE-URLS(bucket name with `.` in it)
// when we have bucket region as input.
if (server.length == 2 && server[1] != "") {
if (server.length == 2 && server[1] != "")
{
params["VIRTUAL_HOST_STYLE"] = "false";
};

var stream = attr["IsolationLevel"];

if (stream == "ReadUncommitted") {
if (stream == "ReadUncommitted")
{
params["STREAM_RESULTS"] = "true";
};

Expand All @@ -44,6 +31,6 @@
{
formattedParams.push(connectionHelper.formatKeyValuePair(key, params[key]));
}

return formattedParams;
})
18 changes: 10 additions & 8 deletions Presto/qubole_odbc/connectionResolver.tdr
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@
</connection-builder>
<connection-normalizer>
<required-attributes>
<attribute-list>
<attr>class</attr>
<attr>server</attr>
<attr>dbname</attr>
<attr>service</attr>
<attr>warehouse</attr>
<attr>IsolationLevel</attr>
</attribute-list>
<setImpersonateAttributes/>
<attribute-list>
<attr>server</attr>
<attr>dbname</attr>
<attr>warehouse</attr>
<attr>IsolationLevel</attr>
<attr>one-time-sql</attr>
<attr>authentication</attr>
<attr>password</attr>
</attribute-list>
</required-attributes>
</connection-normalizer>
</connection-resolver>
Expand Down
6 changes: 3 additions & 3 deletions Presto/qubole_odbc/manifest.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version='1.0' encoding='utf-8' ?>

<connector-plugin class='qubole_odbc' superclass='presto' plugin-version='0.0.0' name='Qubole Presto' version='10.01.1031'>
<connector-plugin class='qubole_odbc' superclass='presto' plugin-version='1.0' name='@string/qubole_odbc/' version='18.1'>
<connection-customization class="qubole_odbc" enabled="true" version="10.0">
<vendor name="Qubole"/>
<driver name="QuboleODBC"/>
<vendor name="vendor"/>
<driver name="driver"/>
<customizations>
</customizations>
</connection-customization>
Expand Down
7 changes: 7 additions & 0 deletions Presto/qubole_odbc/resources-en_US.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="qubole_odbc">Qubole Presto</string>
<string name="db_name_prompt">Catalog:</string>
<string name="server_prompt">End Point;Bucket Region:</string>
<string name="warehouse_prompt">Cluster Label:</string>
</resources>