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

[SPARK-17819][SQL][BRANCH-2.0] Support default database in connection URIs for Spark Thrift Server #15507

Closed
wants to merge 1 commit into from

Conversation

dongjoon-hyun
Copy link
Member

What changes were proposed in this pull request?

Currently, Spark Thrift Server ignores the default database in URI. This PR supports that like the following.

$ bin/beeline -u jdbc:hive2://localhost:10000 -e "create database testdb"
$ bin/beeline -u jdbc:hive2://localhost:10000/testdb -e "create table t(a int)"
$ bin/beeline -u jdbc:hive2://localhost:10000/testdb -e "show tables"
...
+------------+--------------+--+
| tableName  | isTemporary  |
+------------+--------------+--+
| t          | false        |
+------------+--------------+--+
1 row selected (0.347 seconds)
$ bin/beeline -u jdbc:hive2://localhost:10000 -e "show tables"
...
+------------+--------------+--+
| tableName  | isTemporary  |
+------------+--------------+--+
+------------+--------------+--+
No rows selected (0.098 seconds)

How was this patch tested?

Pass the Jenkins with a newly added testsuite.

@SparkQA
Copy link

SparkQA commented Oct 17, 2016

Test build #67049 has finished for PR 15507 at commit 43a9d48.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@dongjoon-hyun
Copy link
Member Author

dongjoon-hyun commented Oct 17, 2016

@rxin . This is the backport for branch-2.0 of 59e3eb5

@rxin
Copy link
Contributor

rxin commented Oct 17, 2016

Thanks - merging .

@rxin
Copy link
Contributor

rxin commented Oct 17, 2016

Can you close the pr?

asfgit pushed a commit that referenced this pull request Oct 17, 2016
… URIs for Spark Thrift Server

## What changes were proposed in this pull request?

Currently, Spark Thrift Server ignores the default database in URI. This PR supports that like the following.

```sql
$ bin/beeline -u jdbc:hive2://localhost:10000 -e "create database testdb"
$ bin/beeline -u jdbc:hive2://localhost:10000/testdb -e "create table t(a int)"
$ bin/beeline -u jdbc:hive2://localhost:10000/testdb -e "show tables"
...
+------------+--------------+--+
| tableName  | isTemporary  |
+------------+--------------+--+
| t          | false        |
+------------+--------------+--+
1 row selected (0.347 seconds)
$ bin/beeline -u jdbc:hive2://localhost:10000 -e "show tables"
...
+------------+--------------+--+
| tableName  | isTemporary  |
+------------+--------------+--+
+------------+--------------+--+
No rows selected (0.098 seconds)
```

## How was this patch tested?

Pass the Jenkins with a newly added testsuite.

Author: Dongjoon Hyun <dongjoon@apache.org>

Closes #15507 from dongjoon-hyun/SPARK-17819-BACK.
@dongjoon-hyun
Copy link
Member Author

Thank you again, @rxin .

@dongjoon-hyun dongjoon-hyun deleted the SPARK-17819-BACK branch November 7, 2016 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants