Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/14331#discussion_r71989869
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/command/tables.scala ---
@@ -498,23 +498,19 @@ case class DescribeTableCommand(table:
TableIdentifier, isExtended: Boolean, isF
}
private def describeBucketingInfo(metadata: CatalogTable, buffer:
ArrayBuffer[Row]): Unit = {
- def appendBucketInfo(numBuckets: Int, bucketColumns: Seq[String],
sortColumns: Seq[String]) = {
- append(buffer, "Num Buckets:", numBuckets.toString, "")
- append(buffer, "Bucket Columns:", bucketColumns.mkString("[", ", ",
"]"), "")
- append(buffer, "Sort Columns:", sortColumns.mkString("[", ", ",
"]"), "")
+ def appendBucketInfo(bucketSpec: Option[BucketSpec]) = bucketSpec
match {
+ case Some(BucketSpec(numBuckets, bucketColumnNames,
sortColumnNames)) =>
+ append(buffer, "Num Buckets:", numBuckets.toString, "")
+ append(buffer, "Bucket Columns:", bucketColumnNames.mkString("[",
", ", "]"), "")
+ append(buffer, "Sort Columns:", sortColumnNames.mkString("[", ",
", "]"), "")
+
+ case _ =>
}
- DDLUtils.getBucketSpecFromTableProperties(metadata) match {
- case Some(bucketSpec) =>
- appendBucketInfo(
- bucketSpec.numBuckets,
- bucketSpec.bucketColumnNames,
- bucketSpec.sortColumnNames)
- case None =>
- appendBucketInfo(
- metadata.numBuckets,
- metadata.bucketColumnNames,
- metadata.sortColumnNames)
+ if (DDLUtils.isDatasourceTable(metadata)) {
+ appendBucketInfo(DDLUtils.getBucketSpecFromTableProperties(metadata))
+ } else {
+ appendBucketInfo(metadata.bucketSpec)
--- End diff --
For now, yes. But I don't wanna change the existing logic here, and we may
support bucketed hive serde table in the future(not hive table).
---
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]