Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
yaooqinn committed Mar 30, 2021
1 parent f50d87b commit 3ef5b5f
Showing 1 changed file with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -511,21 +511,17 @@ case class ShowTables(
override def children: Seq[LogicalPlan] = Seq(namespace)
}

trait ShowTablesLegacyHelper {
def getOutputAttrs: Seq[Attribute]

def getLegacyOutputAttrs: Seq[Attribute] = {
val output = getOutputAttrs
output.head.withName("database") +: output.slice(1, output.length - 1)
}
}

object ShowTables extends ShowTablesLegacyHelper {
object ShowTables {
def getOutputAttrs: Seq[Attribute] = Seq(
AttributeReference("namespace", StringType, nullable = false)(),
AttributeReference("tableName", StringType, nullable = false)(),
AttributeReference("isTemporary", BooleanType, nullable = false)(),
AttributeReference("tableType", StringType, nullable = false)())

def getLegacyOutputAttrs: Seq[Attribute] = {
val output = getOutputAttrs
output.head.withName("database") +: output.slice(1, output.length - 1)
}
}

/**
Expand All @@ -539,13 +535,18 @@ case class ShowTableExtended(
override def children: Seq[LogicalPlan] = namespace :: Nil
}

object ShowTableExtended extends ShowTablesLegacyHelper {
object ShowTableExtended {
def getOutputAttrs: Seq[Attribute] = Seq(
AttributeReference("namespace", StringType, nullable = false)(),
AttributeReference("tableName", StringType, nullable = false)(),
AttributeReference("isTemporary", BooleanType, nullable = false)(),
AttributeReference("information", StringType, nullable = false)(),
AttributeReference("tableType", StringType, nullable = false)())

def getLegacyOutputAttrs: Seq[Attribute] = {
val output = getOutputAttrs
output.head.withName("database") +: output.slice(1, output.length - 1)
}
}

/**
Expand Down

0 comments on commit 3ef5b5f

Please sign in to comment.