cloud-fan commented on code in PR #37588:
URL: https://github.com/apache/spark/pull/37588#discussion_r1365547706
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/ShowTablesExec.scala:
##########
@@ -33,15 +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)
+ identifiers.map { identifier =>
+ if (pattern.map(StringUtils.filterPattern(
+ Seq(identifier.name()), _).nonEmpty).getOrElse(true)) {
+ val isTemp = isTempView(identifier)
+ if (isExtended) {
+ val table = catalog.loadTable(identifier)
Review Comment:
seems we should not load the table if it's a temp view?
--
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]