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/12/08 17:36:19 UTC

[GitHub] [pinot] walterddr commented on a diff in pull request #9943: [multistage][test] add multi-server, multi-segment test

walterddr commented on code in PR #9943:
URL: https://github.com/apache/pinot/pull/9943#discussion_r1043637770


##########
pinot-query-runtime/src/test/java/org/apache/pinot/query/runtime/queries/ResourceBasedQueriesTest.java:
##########
@@ -85,16 +89,25 @@ public void setUp()
       Map<String, Schema> schemaMap = new HashMap<>();
       for (Map.Entry<String, QueryTestCase.Table> tableEntry : testCase._tables.entrySet()) {
         String tableName = testCaseName + "_" + tableEntry.getKey();
-        // TODO: able to choose table type, now default to OFFLINE
+        // Testing only OFFLINE table b/c Hybrid table test is a special case to test separately.
         String tableNameWithType = TableNameBuilder.forType(TableType.OFFLINE).tableNameWithType(tableName);
         org.apache.pinot.spi.data.Schema pinotSchema = constructSchema(tableName, tableEntry.getValue()._schema);
         schemaMap.put(tableName, pinotSchema);
         factory1.registerTable(pinotSchema, tableNameWithType);
         factory2.registerTable(pinotSchema, tableNameWithType);
         List<QueryTestCase.ColumnAndType> columnAndTypes = tableEntry.getValue()._schema;
-        // TODO: able to select add rows to server1 or server2 (now default server1)
-        // TODO: able to select add rows to existing segment or create new one (now default create one segment)
-        factory1.addSegment(tableNameWithType, toRow(columnAndTypes, tableEntry.getValue()._inputs));
+        List<GenericRow> genericRows = toRow(columnAndTypes, tableEntry.getValue()._inputs);
+        List<GenericRow> rows = new ArrayList<>();
+        for (GenericRow row : genericRows) {
+          if (RANDOM.nextBoolean()) {

Review Comment:
   using random for now. i dont know what's a good way to specify this in the JSON format. one thing I can think of is introducing a single segment splitter special input `Object[]`
   ```
         "tbl1" : {
           "schema": [
           ],
           "inputs": [ // always start with server1
             ["foo", 1],
             ["--------"], // indicating we are splitting a segment, also next segment will go to server2
             ["--------"], // indicating we are splitting a segment (in this case nothing will be added), and swap back to server1, with nothing put into server2
             ["bar", 2]
           ]
   ```



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