-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-27899][SQL] Make HiveMetastoreClient.getTableObjectsByName available in ExternalCatalog/SessionCatalog API #24774
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
Changes from all commits
dbe6065
b73eadc
7b48220
bbb5b18
2d82550
82a30b9
b621043
93c5261
873644d
d233146
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -277,6 +277,28 @@ abstract class ExternalCatalogSuite extends SparkFunSuite with BeforeAndAfterEac | |
| } | ||
| } | ||
|
|
||
| test("get tables by name") { | ||
| assert(newBasicCatalog().getTablesByName("db2", Seq("tbl1", "tbl2")) | ||
| .map(_.identifier.table) == Seq("tbl1", "tbl2")) | ||
| } | ||
|
|
||
| test("get tables by name when some tables do not exists") { | ||
| assert(newBasicCatalog().getTablesByName("db2", Seq("tbl1", "tblnotexist")) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added |
||
| .map(_.identifier.table) == Seq("tbl1")) | ||
| } | ||
|
|
||
| test("get tables by name when contains invalid name") { | ||
| // scalastyle:off | ||
| val name = "砖" | ||
| // scalastyle:on | ||
| assert(newBasicCatalog().getTablesByName("db2", Seq("tbl1", name)) | ||
| .map(_.identifier.table) == Seq("tbl1")) | ||
| } | ||
|
|
||
| test("get tables by name when empty table list") { | ||
| assert(newBasicCatalog().getTablesByName("db2", Seq.empty).isEmpty) | ||
| } | ||
|
|
||
| test("list tables without pattern") { | ||
| val catalog = newBasicCatalog() | ||
| intercept[AnalysisException] { catalog.listTables("unknown_db") } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -84,6 +84,9 @@ private[hive] trait HiveClient { | |
| /** Returns the metadata for the specified table or None if it doesn't exist. */ | ||
| def getTableOption(dbName: String, tableName: String): Option[CatalogTable] | ||
|
|
||
| /** Returns metadata of existing permanent tables/views for given names. */ | ||
| def getTablesByName(dbName: String, tableNames: Seq[String]): Seq[CatalogTable] | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a comment to describe the function?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added |
||
|
|
||
| /** Creates a table with the given metadata. */ | ||
| def createTable(table: CatalogTable, ignoreIfExists: Boolean): Unit | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.