[
https://issues.apache.org/jira/browse/KNOX-1742?focusedWorklogId=374665&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-374665
]
ASF GitHub Bot logged work on KNOX-1742:
----------------------------------------
Author: ASF GitHub Bot
Created on: 20/Jan/20 16:45
Start Date: 20/Jan/20 16:45
Worklog Time Spent: 10m
Work Description: lmccay commented on pull request #241: KNOX-1742 -
Simple SQL Client in KnoxShell for access to JDBC sources
URL: https://github.com/apache/knox/pull/241
(It is very **important** that you created an Apache Knox JIRA for this
change and that the PR title/commit message includes the Apache Knox JIRA ID!)
## What changes were proposed in this pull request?
Adding a simple SQL client/shell to KnoxShell for accessing JDBC data
sources such as HiveServer2 and others. Rather than providing connection
details on the command line for the data source, this shell leverages the
DataSource persistence introduced in KNOX-2128.
Enter the SQL client, list datasources, select datasources and execute SQL
query:
lmccay@strange:~/Projects/releases/knoxshell-1.4.0-SNAPSHOT$
bin/knoxshell.sh knoxline
_ _ _
| | ___ __ _____ _| (_)_ __ ___
| |/ / '_ \ / _ \ \/ / | | '_ \ / _ \
| <| | | | (_) > <| | | | | | __/
|_|\_\_| |_|\___/_/\_\_|_|_| |_|\\__|
powered by Apache Knox
knoxline> :ds
Name : secgov :
jdbc:hive2://sme-secgov-de-01.sme-secg.a465-9q4k.cloudera.site:8443/;ssl=true;transportMode=http;httpPath=sme-secgov-de-01/cdp-proxy-api/hive
Name : anatva :
jdbc:hive2://de-anatva-master0.sandbox.a465-9q4k.cloudera.site/;ssl=true;transportMode=http;httpPath=de-anatva/cdp-proxy-api/hive
Name : derby1 : jdbc:derby:codejava/webdb1
knoxline> :ds select derby1
knoxline> select * from book
select * from book
BOOK
+------------+--------------------+
| BOOK_ID | TITLE |
+------------+--------------------+
| 1 | Effective Java |
| 2 | Core Java |
| 3 | Core Apache Knox |
+------------+--------------------+
Rows: 3
knoxline> ^CClosing any open connections ...
## How was this patch tested?
Manual testing of this feature and unit testing run to ensure no regressions.
Please review [Knox Contributing
Process](https://cwiki.apache.org/confluence/display/KNOX/Contribution+Process#ContributionProcess-GithubWorkflow)
before opening a pull request.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 374665)
Remaining Estimate: 0h
Time Spent: 10m
> Simple SQL Client in KnoxShell for access to HiveServer2 via HiveDriver
> -----------------------------------------------------------------------
>
> Key: KNOX-1742
> URL: https://issues.apache.org/jira/browse/KNOX-1742
> Project: Apache Knox
> Issue Type: Improvement
> Components: KnoxShell
> Reporter: Larry McCay
> Assignee: Larry McCay
> Priority: Major
> Fix For: 1.5.0
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Let's take the following wiki article example and make it an actual feature
> of KnoxShell:
> https://cwiki.apache.org/confluence/display/KNOX/SQL+Client+Example+using+KnoxShell+in+Apache+Knox
> In order to make it a generic feature, we will need to do a number of things:
> # add a lib directory
> # add the HiveDriver - *maybe* - perhaps it is better to have the user
> download the right version?
> # add commons-logging jar to lib directory
> # add a real table rendering class to the KnoxShell rather than embedded in
> the SQL client script - so that other features and scripts can use it to
> render results
> # add the knoxline.sh and hive2.groovy script to bin directory
--
This message was sent by Atlassian Jira
(v8.3.4#803005)