You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/03/16 23:29:14 UTC

[GitHub] [pinot] jackjlli commented on a change in pull request #8036: Add new compat test cases and data (#7235)

jackjlli commented on a change in pull request #8036:
URL: https://github.com/apache/pinot/pull/8036#discussion_r828527377



##########
File path: compatibility-verifier/sample-test-suite/config/dataGenerator.py
##########
@@ -0,0 +1,90 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+import random
+import csv
+import string
+
+class DataGenerator:
+
+    def __init__(self):
+        self.__NUMBER_OF_LINES = 300
+        self.__RANGE_OF_LONG_IDX = 100
+        self.__RANGE_OF_DOUBLE_IDX = 100
+        self.__VAR_LEN_STRING_LOWER = 8
+        self.__VAR_LEN_STRING_UPPER = 16
+        return
+
+    def generateLine(self, longDimSV2Prev):
+        line = []
+
+        # hours since epoch
+        line.append("123456")
+
+        # generationNumber
+        line.append("__GENERATION_NUMBER__")
+
+        # stringDimSV1 varlen,bloom
+        letters = string.ascii_lowercase
+        num_letters = random.randint(self.__VAR_LEN_STRING_LOWER, self.__VAR_LEN_STRING_UPPER)
+        line.append(''.join(random.choice(letters) for _ in range(num_letters)))
+
+        # stringDimSV2 noDict
+        letters = string.ascii_lowercase
+        num_letters = random.randint(self.__VAR_LEN_STRING_LOWER, self.__VAR_LEN_STRING_UPPER)
+        line.append(''.join(random.choice(letters) for _ in range(num_letters)))
+
+        # longDimSV1 sorted
+        line.append(longDimSV2Prev[0])
+        longDimSV2Prev[0] -= 1
+
+        # doubleDimSV1 range
+        line.append(random.randint(0, self.__RANGE_OF_DOUBLE_IDX * 100) / 100)
+
+        # SV intMetric1 noDict
+        line.append(random.randint(0, 10000))
+
+        # SV longMetric1 noDict
+        line.append(2**48+random.randint(0, 10000))
+
+        # SV floatMetric1 noDict
+        line.append(random.randint(0, 10000) / 100)
+
+        # SV doubleMetric1 noDict
+        line.append(3.4E45+random.randint(0, 100) / 10 * (10**45))
+
+        # SV bytesMetric1 noDict
+        line.append(random.choice(["deadbeef", "deed0507", "01a0bc", "d54d0507"]))
+
+        return line
+
+    def generateLines(self):
+        ret = []
+        longDimSV2 = [self.__NUMBER_OF_LINES]
+        for _ in range(self.__NUMBER_OF_LINES):
+            ret.append(self.generateLine(longDimSV2))
+
+        return ret
+
+
+if __name__ == '__main__':
+    dataGenerator = DataGenerator()
+    with open('FeatureTest3-data-realtime-00.csv', 'w', newline='') as csvfile:
+        writer = csv.writer(csvfile, quotechar='\'', delimiter=',')
+        writer.writerows(dataGenerator.generateLines())

Review comment:
       Missing empty tail line here? Same for the other files.

##########
File path: pinot-compatibility-verifier/src/main/java/org/apache/pinot/compat/QueryOp.java
##########
@@ -46,6 +46,9 @@
   private static final String COMMENT_DELIMITER = "#";
   private String _queryFileName;
   private String _expectedResultsFileName;
+  private Boolean _shouldCompareNumEntriesScannedInFilter = false;

Review comment:
       nit: why use Boolean instead of boolean here?

##########
File path: compatibility-verifier/sample-test-suite/config/feature-test-3-realtime-stream-config.json
##########
@@ -0,0 +1,8 @@
+{
+  "streamType": "kafka",
+  "stream.kafka.consumer.type": "simple",
+  "topicName": "PinotRealtimeFeatureTest3Event",
+  "partitionColumn": "longDimSV1",
+  "numPartitions": "3",
+  "stream.kafka.consumer.prop.auto.offset.reset": "smallest"
+}

Review comment:
       Same here.




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

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org