LakshSingla commented on code in PR #16322:
URL: https://github.com/apache/druid/pull/16322#discussion_r1595151720


##########
processing/src/test/java/org/apache/druid/frame/key/RowKeyComparisonRunLengthsTest.java:
##########
@@ -0,0 +1,184 @@
+/*
+ * 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.
+ */
+
+package org.apache.druid.frame.key;
+
+import com.google.common.collect.ImmutableList;
+import org.apache.druid.error.DruidException;
+import org.apache.druid.segment.column.ColumnType;
+import org.apache.druid.segment.column.RowSignature;
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.util.Collections;
+import java.util.List;
+
+public class RowKeyComparisonRunLengthsTest

Review Comment:
   I was considering having a parameterized test, however, how do I add the 
expected results for each test case generically, without repeating the logic in 
`RowKeyComparisonRunLengths`. 
   
   For example, if the input test case is "complex ASC, string DESC, string 
DESC"; how can I get the expected value of the result, without repeating what I 
have written in `RowKeyComparisonRunLength`?  One way would be iterating the 
results of all 64 combinations, which can be done, but I wanted to confirm if 
that's what you referred to in the comment. 
   
   The test case would read something like:
   
   ```java
   assertionHelper(
     HelperUtils.createCheckerFor(new RunLength(false, 1, ASC), new 
RunLength(true, 2, DESC))
     RowKeyComparisonRunLength.create("complex ASC, string DESC, string DESC")
   );
   .... (total 64 entries)
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to