panbingkun commented on code in PR #37588:
URL: https://github.com/apache/spark/pull/37588#discussion_r1389120888
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/ShowTablesExec.scala:
##########
@@ -33,17 +41,36 @@ case class ShowTablesExec(
output: Seq[Attribute],
catalog: TableCatalog,
namespace: Seq[String],
- pattern: Option[String]) extends V2CommandExec with LeafExecNode {
+ pattern: Option[String],
+ isExtended: Boolean = false,
+ partitionSpec: Option[ResolvedPartitionSpec] = None) extends V2CommandExec
with LeafExecNode {
override protected def run(): Seq[InternalRow] = {
val rows = new ArrayBuffer[InternalRow]()
- val tables = catalog.listTables(namespace.toArray)
- tables.map { table =>
- if (pattern.map(StringUtils.filterPattern(Seq(table.name()),
_).nonEmpty).getOrElse(true)) {
- rows += toCatalystRow(table.namespace().quoted, table.name(),
isTempView(table))
+ if (partitionSpec.isEmpty) {
+ // Show the information of tables.
+ val identifiers = catalog.listTables(namespace.toArray)
Review Comment:
@cloud-fan
Based on the above suggestions, a separate PR has been submitted to
implement `Identifier[] listTables(String[] namespace, String pattern)` in
`TableCatalog`.
https://github.com/apache/spark/pull/43751
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]