Skip to content

Commit

Permalink
Changes for SNAP-2603:
Browse files Browse the repository at this point in the history
 - Code changes for displaying temporary global table's Field details.
  • Loading branch information
snappy-sachin committed Jan 21, 2019
1 parent ff14fe9 commit cb653dd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
*/
package org.apache.spark.status.api.v1

import scala.collection.mutable

import io.snappydata.SnappyTableStatsProviderService

import org.apache.spark.sql.types.StructType
Expand Down Expand Up @@ -70,8 +72,19 @@ object TableDetails {

gblTempViewBuff.mapValues(view => {
val colCount = view.getSchema.asInstanceOf[StructType].size
val schemaFields = view.getSchema.asInstanceOf[StructType].fields
val schemaStringBuilder = new StringBuilder
schemaFields.foreach(field => {
schemaStringBuilder.append("(" + field.name + ":" + field.dataType + ", " +
"nullable=" + { if (field.nullable) "Yes" else "No" } + ")\n")
})

val columnsInfo = mutable.HashMap.empty[String, Any]
columnsInfo += ("numColumns" -> colCount);
columnsInfo += ("fieldsString" -> schemaStringBuilder.toString());

new GlobalTemporaryViewSummary(view.getFullyQualifiedName, view.getTableName,
view.getTableType, colCount)
view.getTableType, columnsInfo)
}).values.toList
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,5 @@ class GlobalTemporaryViewSummary private[spark](
val tableFQName: String,
val tableName: String,
val tableType: String,
val numColumns: Int
val columnsInfo: mutable.HashMap[String, Any]
)
Original file line number Diff line number Diff line change
Expand Up @@ -510,10 +510,10 @@ object SnappyDashboardPage {
val gblTempViewsStatsTitleTooltip = "SnappyData Global Temporary Views Summary"
val gblTempViewStatsColumn = scala.collection.mutable.HashMap.empty[String, String]
gblTempViewStatsColumn += ("name" -> "Name")
gblTempViewStatsColumn += ("nameTooltip" -> "Global Temporary Views Name")
gblTempViewStatsColumn += ("nameTooltip" -> "Global Temporary View's Name")
gblTempViewStatsColumn += ("type" -> "Type")
gblTempViewStatsColumn += ("typeTooltip" -> "Type")
gblTempViewStatsColumn += ("columnsCount" -> "Columns Count")
gblTempViewStatsColumn += ("columnsCountTooltip" -> "Number of Columns in View")
gblTempViewStatsColumn += ("columnsCount" -> "Fields")
gblTempViewStatsColumn += ("columnsCountTooltip" -> "Number of Fields/Columns in the View")

}

0 comments on commit cb653dd

Please sign in to comment.