Indhumathi27 commented on a change in pull request #3792:
URL: https://github.com/apache/carbondata/pull/3792#discussion_r442128902



##########
File path: docs/segment-management-on-carbondata.md
##########
@@ -54,6 +54,12 @@ concept which helps to maintain consistency of data and easy 
transaction managem
   SHOW SEGMENTS ON CarbonDatabase.CarbonTable
   ```
 
+  Show lastest 10 visible segments

Review comment:
       After compaction also, it should show latest segments right? For 
example, there are 6 segments, after major compaction, show segments with limit 
2 will display 4.1 and 5th segment only, whereas latest segments are 0.2 and 
0.3. I think we should get latest segments based on timestamp. 

##########
File path: 
integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/segment/ShowSegmentTestCase.scala
##########
@@ -191,7 +214,11 @@ class ShowSegmentTestCase extends QueryTest with 
BeforeAndAfterAll {
     sql("drop table if exists a")
     sql("create table a(a string) stored as carbondata")
     sql("insert into a select 'k'")
+    sql("insert into a select 'j'")
+    sql("insert into a select 'k'")
     val rows = sql("show segments for table a").collect()
+    assert(sql(s"show segments for table a").collect().length == 3)

Review comment:
       ```suggestion
       assert(rows.length == 3)
   ```

##########
File path: 
integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/segmentreading/TestSegmentReading.scala
##########
@@ -251,13 +251,16 @@ class TestSegmentReading extends QueryTest with 
BeforeAndAfterAll {
         s"""LOAD DATA local inpath '$resourcesPath/data.csv' INTO TABLE 
carbon_table_show_seg OPTIONS
             |('DELIMITER'= ',', 'QUOTECHAR'= '\"')""".stripMargin)
       val df = sql("SHOW SEGMENTS for table carbon_table_show_seg as select * 
from carbon_table_show_seg_segments")
+      sql("SHOW SEGMENTS for table carbon_table_show_seg as select * from 
carbon_table_show_seg_segments").show()

Review comment:
       Can remove this line




----------------------------------------------------------------
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:
[email protected]


Reply via email to