You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by GitBox <gi...@apache.org> on 2019/04/17 18:29:07 UTC

[GitHub] [drill] sohami commented on a change in pull request #1751: DRILL-7164: KafkaFilterPushdownTest is sometimes failing to pattern match correctly

sohami commented on a change in pull request #1751: DRILL-7164: KafkaFilterPushdownTest is sometimes failing to pattern match correctly
URL: https://github.com/apache/drill/pull/1751#discussion_r276342157
 
 

 ##########
 File path: contrib/storage-kafka/src/test/java/org/apache/drill/exec/store/kafka/KafkaFilterPushdownTest.java
 ##########
 @@ -32,10 +33,8 @@
 @Category({KafkaStorageTest.class, SlowTest.class})
 public class KafkaFilterPushdownTest extends KafkaTestBase {
   private static final int NUM_PARTITIONS = 5;
-  private static final String expectedSubStr = "    \"kafkaScanSpec\" : {\n" +
-                                                   "      \"topicName\" : \"drill-pushdown-topic\"\n" +
-                                                   "    },\n" +
-                                                   "    \"cost\"";
+  private static final String expectedPattern = "KafkaGroupScan.*KafkaScanSpec=KafkaScanSpec.*" +
+                                                   "topicName=drill-pushdown-topic.*rowcount.*=.*%s";
 
 Review comment:
   this pattern is not correct specially `rowcount.*=.*%s";` where %s is replaced by expected rowcount value. Since there is .* before %s this will match the longest string which will end with the expected rowcount digit value. For example: With below string if the expected rowcount to match is 0, then with above pattern match will still return true since `0.0` precedes `memory` string. So `.*0` will match `1.0, cumulative cost = {1.0 rows, 2.0 cpu, 0.0 io, 0.0 network, 0.0` and match will be successful whereas it should have failed since actual rowcount = 1.0.
   
   `Scan(table=[[kafka, drill-pushdown-topic]], groupscan=[KafkaGroupScan [KafkaScanSpec=KafkaScanSpec [topicName=drill-pushdown-topic], columns=[`**`, `kafkaMsgTimestamp`]]]) : rowType = RecordType(DYNAMIC_STAR **, ANY kafkaMsgTimestamp): rowcount = 1.0, cumulative cost = {1.0 rows, 2.0 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 966`
   
   Can we just replace it with `rowcount = %s` instead ?

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


With regards,
Apache Git Services