-
Notifications
You must be signed in to change notification settings - Fork 28.3k
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-3299][SQL]Public API in SQLContext to list tables #4547
Conversation
Test build #27316 has started for PR 4547 at commit
|
sql("DROP DATABASE IF EXISTS db1") | ||
} | ||
|
||
test("get All Tables of current database") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lower case all?
Test build #27316 has finished for PR 4547 at commit
|
Test FAILed. |
Actually, I cannot use |
You could just add and remove a table to make sure the list reflects this
|
Test build #27324 has started for PR 4547 at commit
|
Test build #27325 has started for PR 4547 at commit
|
Test build #27324 has finished for PR 4547 at commit
|
Test PASSed. |
Test build #27325 has finished for PR 4547 at commit
|
Test PASSed. |
Test build #27395 has started for PR 4547 at commit
|
Test build #27395 has finished for PR 4547 at commit
|
Test PASSed. |
https://issues.apache.org/jira/browse/SPARK-3299 Author: Yin Huai <yhuai@databricks.com> Closes #4547 from yhuai/tables and squashes the following commits: 6c8f92e [Yin Huai] Add tableNames. acbb281 [Yin Huai] Update Python test. 7793dcb [Yin Huai] Fix scala test. 572870d [Yin Huai] Address comments. aba2e88 [Yin Huai] Format. 12c86df [Yin Huai] Add tables() to SQLContext to return a DataFrame containing existing tables. (cherry picked from commit 1d0596a) Signed-off-by: Michael Armbrust <michael@databricks.com>
@@ -734,6 +734,42 @@ class SQLContext(@transient val sparkContext: SparkContext) | |||
def table(tableName: String): DataFrame = | |||
DataFrame(this, catalog.lookupRelation(Seq(tableName))) | |||
|
|||
/** | |||
* Returns a [[DataFrame]] containing names of existing tables in the given database. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the javadoc is actually wrong. this one should say "current database", and next one should say "given database"
I have created #4579 for the doc fix. |
https://issues.apache.org/jira/browse/SPARK-3299