You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by GitBox <gi...@apache.org> on 2021/02/02 11:28:12 UTC

[GitHub] [carbondata] akashrn5 commented on a change in pull request #4080: [CARBONDATA-4111] Filter query having invalid results after add segment to table having SI with Indexserver

akashrn5 commented on a change in pull request #4080:
URL: https://github.com/apache/carbondata/pull/4080#discussion_r568509426



##########
File path: index/secondary-index/src/test/scala/org/apache/carbondata/spark/testsuite/secondaryindex/TestSIWithAddSegment.scala
##########
@@ -86,8 +86,8 @@ class TestSIWithAddSegment extends QueryTest with BeforeAndAfterAll {
     sql(s"alter table maintable1 add segment options('path'='${ newSegmentPath }', " +
         s"'format'='carbon')")
     sql("CREATE INDEX maintable1_si  on table maintable1 (c) as 'carbondata'")
-    assert(sql("show segments for table maintable1_si").collect().length ==
-           sql("show segments for table maintable1").collect().length)
+    assert(sql("show segments for table maintable1_si").collect().length == 2)
+    assert(sql("show segments for table maintable1").collect().length == 3)

Review comment:
       also have an assert of checking SI table is disabled and query doesn't hit SI

##########
File path: core/src/main/java/org/apache/carbondata/core/indexstore/ExtendedBlocklet.java
##########
@@ -221,7 +223,13 @@ public void deserializeFields(DataInput in, String[] locations, String tablePath
       indexUniqueId = in.readUTF();
     }
     String filePath = getPath();
-    if (filePath.startsWith(File.separator)) {
+    boolean isLocalFile = FileFactory.getCarbonFile(filePath) instanceof LocalCarbonFile;
+    // If it is external segment path, table path need not be appended to filePath
+    // Example filepath: hdfs://hacluster/opt/newsegmentpath/
+    // filePath value would start with hdfs:// or s3:// . If it is local
+    // ubuntu storage, it starts with File separator, so check if given path exists or not.
+    if ((!isLocalFile && filePath.startsWith(File.separator)) || (isLocalFile && !FileFactory

Review comment:
       the comment is not clear, please rewrite it with better example and scenarios




----------------------------------------------------------------
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:
users@infra.apache.org