Indhumathi27 commented on a change in pull request #3216: [CARBONDATA-3387] Support Partition with MV datamap & Show DataMap Status
URL:
https://github.com/apache/carbondata/pull/3216#discussion_r285902856
##########
File path: integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/datamap/CarbonDataMapShowCommand.scala
##########
@@ -92,7 +100,44 @@ case class CarbonDataMapShowCommand(tableIdentifier: Option[TableIdentifier])
.map(p => s"'${ p._1 }'='${ p._2 }'").toSeq
.sorted.mkString(", ")
}
- Row(s.getDataMapName, s.getProviderName, table, dmPropertieStr)
+ // Get datamap status and sync information details
+ var dataMapStatus = "NA"
+ var syncInfo: String = "NA"
+ if (!s.getProviderName.equalsIgnoreCase(
+ DataMapClassProvider.PREAGGREGATE.getShortName) && !s.getProviderName.equalsIgnoreCase(
+ DataMapClassProvider.TIMESERIES.getShortName)) {
+ if (DataMapStatusManager.getEnabledDataMapStatusDetails
+ .exists(_.getDataMapName.equalsIgnoreCase(s.getDataMapName))) {
+ dataMapStatus = DataMapStatus.ENABLED.name()
+ } else {
+ dataMapStatus = DataMapStatus.DISABLED.name()
+ }
+ val loadMetadataDetails = SegmentStatusManager
+ .readLoadMetadata(CarbonTablePath
+ .getMetadataPath(s.getRelationIdentifier.getTablePath))
+ if (!s.isIndexDataMap && loadMetadataDetails.nonEmpty) {
+ breakable({
+ for (i <- loadMetadataDetails.length - 1 to 0 by -1) {
+ if (loadMetadataDetails(i).getSegmentStatus.equals(SegmentStatus.SUCCESS)) {
+ val segmentMaps =
+ DataMapSegmentStatusUtil.getSegmentMap(loadMetadataDetails(i).getExtraInfo)
+ val syncInfoMap = new util.HashMap[String, String]()
+ val iterator = segmentMaps.entrySet().iterator()
+ while (iterator.hasNext) {
+ val entry = iterator.next()
+ syncInfoMap.put(entry.getKey, entry.getValue.get(entry.getValue.size() - 1))
+ }
+ syncInfoMap
+ .put(CarbonCommonConstants.LOAD_SYNC_TIME,
+ loadMetadataDetails(i).getLoadEndTime.toString)
Review comment:
done
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[hidden email]
With regards,
Apache Git Services