Skip to content

Commit

Permalink
[CARBONDATA-1803] Changing format of Show segments
Browse files Browse the repository at this point in the history
Changing the show segments format for backward compatibility.
(1) File Format is a new option previously added in between, so moved the same to last
(2) Segment Id is again changed back to SegmentSequenceId

This closes apache#1558
  • Loading branch information
dhatchayani authored and anubhav100 committed Jun 22, 2018
1 parent 1b0a036 commit 3c33597
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Expand Up @@ -92,8 +92,8 @@ object CarbonStore {
load.getSegmentStatus.getMessage,
startTime,
endTime,
load.getFileFormat.toString,
mergedTo)
mergedTo,
load.getFileFormat.toString)
}.toSeq
} else {
Seq.empty
Expand Down
Expand Up @@ -374,7 +374,7 @@ object GlobalDictionaryUtil {
classOf[CSVInputFormat],
classOf[NullWritable],
classOf[StringArrayWritable],
hadoopConf).setName("global dictionary").map[Row] { currentRow =>
jobConf).setName("global dictionary").map[Row] { currentRow =>
row.setValues(currentRow._2.get())
}
sqlContext.createDataFrame(rdd, schema)
Expand Down
Expand Up @@ -122,12 +122,12 @@ case class ShowLoadsCommand(
extends Command {

override def output: Seq[Attribute] = {
Seq(AttributeReference("Segment Id", StringType, nullable = false)(),
Seq(AttributeReference("SegmentSequenceId", StringType, nullable = false)(),
AttributeReference("Status", StringType, nullable = false)(),
AttributeReference("Load Start Time", TimestampType, nullable = false)(),
AttributeReference("Load End Time", TimestampType, nullable = true)(),
AttributeReference("File Format", StringType, nullable = false)(),
AttributeReference("Merged To", StringType, nullable = false)())
AttributeReference("Merged To", StringType, nullable = false)(),
AttributeReference("File Format", StringType, nullable = false)())
}
}

Expand Down
Expand Up @@ -248,7 +248,7 @@ class TestSegmentReading extends QueryTest with BeforeAndAfterAll {
|('DELIMITER'= ',', 'QUOTECHAR'= '\"')""".stripMargin)
val df = sql("SHOW SEGMENTS for table carbon_table_show_seg")
val col = df.collect().map{
row => Row(row.getString(0),row.getString(1),row.getString(5))
row => Row(row.getString(0),row.getString(1),row.getString(4))
}.toSeq
assert(col.equals(Seq(Row("2","Success","NA"),
Row("1","Compacted","0.1"),
Expand Down
Expand Up @@ -570,7 +570,7 @@ class TestStreamingTableOperation extends QueryTest with BeforeAndAfterAll {
result.foreach { row =>
if (row.getString(0).equals("1")) {
assertResult(SegmentStatus.STREAMING.getMessage)(row.getString(1))
assertResult(FileFormat.ROW_V1.toString)(row.getString(4))
assertResult(FileFormat.ROW_V1.toString)(row.getString(5))
}
}
}
Expand Down

0 comments on commit 3c33597

Please sign in to comment.