Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xuyu committed Aug 1, 2024
1 parent c0bc782 commit e88c610
Showing 1 changed file with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ package org.apache.spark.sql.execution.datasources.v2
import org.apache.spark.sql.catalyst.InternalRow
import org.apache.spark.sql.catalyst.analysis.ResolvedTable
import org.apache.spark.sql.catalyst.expressions.Attribute
import org.apache.spark.sql.catalyst.util.CharVarcharUtils
import org.apache.spark.sql.execution.LeafExecNode
import org.apache.spark.unsafe.types.UTF8String

Expand All @@ -37,14 +36,8 @@ case class ShowColumnsTableExec(
}

private def showColumnsTable(resolvedTable: ResolvedTable, builder: StringBuilder): Unit = {
import org.apache.spark.sql.connector.catalog.CatalogV2Implicits._
val table = resolvedTable.table;
val columns = CharVarcharUtils.getRawSchema(table.columns.asSchema, conf).fields.map(_.toDDL)
builder ++= concatByMultiLines(columns)
}

private def concatByMultiLines(iter: Iterable[String]): String = {
iter.mkString("(\n ", ",\n ", ")\n")
table.columns().foreach(f => builder.append(f.name()).append("\n"))
}

}

0 comments on commit e88c610

Please sign in to comment.