You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2020/10/01 02:49:20 UTC

[GitHub] [iceberg] kbendick commented on pull request #1539: Add names to parameterized tests and simplify the parameters list

kbendick commented on pull request #1539:
URL: https://github.com/apache/iceberg/pull/1539#issuecomment-701788175


   In some of the tests, one of the parameters is a String[] instead of a String. Because the current JUnit set up casts the names based on index by calling `.toString()` on them, we wind up with some bad names in these edge cases. Example:
   
   ```md
   testReplacePartitions[catalogName=testhadoop, baseNamespace=[Ljava.lang.String;36c1c7d9], format=PARQUET, isStreaming=false]
   ```
   
   We can fix this in a few ways. One, there is another library that offers us the ability to have more control over parameters: https://github.com/Pragmatists/JUnitParams
   
   However, I'm not so sure about that. Additionally, while baseNamespace is not _exactly_ a namespace, it is in a way. And there is a class `Namespace` with a meaningful `toString` method. We can either create an additional `BaseNamespace` class or simply delegate to `Namespace` and accept that a `BaseNamespace` and a `Namespace` are essentially just references to the different possible lengths of a namespace.
   
   What do others think @rdblue? `baseNamespace` as shown above is the only example I have found. And `Namespace` already has a helper function in the Flink test code:
   
   ```java
     private Namespace toNamespace(String database) {
       String[] namespace = new String[baseNamespace.length + 1];
       System.arraycopy(baseNamespace, 0, namespace, 0, baseNamespace.length);
       namespace[baseNamespace.length] = database;
       return Namespace.of(namespace);
     }
   ```  


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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org