Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/13070#discussion_r65611801
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/interface.scala
---
@@ -140,6 +170,32 @@ case class CatalogTable(
locationUri, inputFormat, outputFormat, serde, compressed,
serdeProperties))
}
+ override def toString: String = {
+ val tableProperties = properties.map(p => p._1 + "=" +
p._2).mkString("[", ", ", "]")
+ val partitionColumns = partitionColumnNames.map("`" + _ +
"`").mkString("[", ", ", "]")
+ val sortColumns = sortColumnNames.map("`" + _ + "`").mkString("[", ",
", "]")
+ val bucketColumns = bucketColumnNames.map("`" + _ + "`").mkString("[",
", ", "]")
+
+ val output =
+ Seq(s"Table:${identifier.quotedString}",
+ if (owner.nonEmpty) s"Owner:$owner" else "",
+ s"Created:${new Date(createTime).toString}",
+ s"Last Access:${new Date(lastAccessTime).toString}",
+ s"Type:${tableType.name}",
+ if (schema.nonEmpty) s"Schema:${schema.mkString("[", ", ", "]")}"
else "",
+ if (partitionColumnNames.nonEmpty) s"Partition
Columns:$partitionColumns" else "",
+ if (numBuckets != -1) s"Num Buckets:$numBuckets" else "",
+ if (bucketColumnNames.nonEmpty) s"Bucket Columns:$bucketColumns"
else "",
+ if (sortColumnNames.nonEmpty) s"Sort Columns:$sortColumns" else "",
+ viewOriginalText.map("Original View:" + _).getOrElse(""),
+ viewText.map("View:" + _).getOrElse(""),
+ comment.map("Comment:" + _).getOrElse(""),
+ if (properties.nonEmpty) s"Properties:$tableProperties" else "",
+ s"$storage")
+
+ output.filter(_.nonEmpty).mkString("CatalogTable(", ", ", ")")
--- End diff --
Since there are so many informations to display, I'm wondering using `\n`
as separator maybe better
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]