[GitHub] [carbondata] QiangCai commented on a change in pull request #3183: [CARBONDATA-3349] support carboncli show sort_columns for a segment folder

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] QiangCai commented on a change in pull request #3183: [CARBONDATA-3349] support carboncli show sort_columns for a segment folder

GitBox
QiangCai commented on a change in pull request #3183: [CARBONDATA-3349] support carboncli show sort_columns for a segment folder
URL: https://github.com/apache/carbondata/pull/3183#discussion_r285475300
 
 

 ##########
 File path: integration/spark-common/src/main/scala/org/apache/carbondata/api/CarbonStore.scala
 ##########
 @@ -137,14 +159,65 @@ object CarbonStore {
               mergedTo,
               load.getFileFormat.toString,
               Strings.formatSize(dataSize.toFloat),
-              Strings.formatSize(indexSize.toFloat))
+              Strings.formatSize(indexSize.toFloat),
+              isSorted,
+              sortColumns)
           }
         }.toSeq
     } else {
       Seq.empty
     }
   }
 
+  private def getSortColumnsOfSegment(
+      load: LoadMetadataDetails,
+      readCommitScope: ReadCommittedScope,
+      tableDataMap: TableDataMap,
+      hadoopConf: Configuration
+  ): (String, String) = {
+    // isSorted has 3 options: true, false, ""(for legacy store, before version 1.5.1)
+    var isSorted = ""
+    // when isSorted is true, need show sort_columns
+    var sortColumns = ""
+    if (load.getFileFormat == FileFormat.ROW_V1) {
+      isSorted = "false"
+    } else if (tableDataMap != null && load.getVisibility.equalsIgnoreCase("true")) {
+      val indexHeader = SegmentIndexFileStore
+        .getIndexHeaderOfSegment(load,
 
 Review comment:
   change to use cli

----------------------------------------------------------------
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