-
Notifications
You must be signed in to change notification settings - Fork 3k
Add names to parameterized tests and simplify the parameters list #1539
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add names to parameterized tests and simplify the parameters list #1539
Conversation
|
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 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 What do others think @rdblue? 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);
}I can also create a separate issue for the ones that generate wonky names and we can deal with them / debate the meaning of |
…espace string array problem.
…emplate that one could code in
|
I'd say let's reuse |
spark/src/test/java/org/apache/iceberg/spark/data/TestSparkParquetReadMetadataColumns.java
Outdated
Show resolved
Hide resolved
|
Mostly looks good! Just a couple questions. |
|
I was wondering why the tags didn't get updated for this, but I think it's because I initially opened this as a draft. I've noticed on push in other people's PRs that they eventually populate (like when we added I'll look into this issue and if the tests are somehow not triggering labels appropriately, I'll make a change. But I don't think that's the case here as I have also edited some |
I agree. I've created an issue to follow up on that as it will ever so slightly require us to change the code in |
| { "orc", "time", "10:02:34.000000", "10:02:34.000001" }, | ||
| // Temporarily disable filters on Timestamp columns due to ORC-611 | ||
| // new Object[] { "orc", "timestamp", | ||
| // { "orc", "timestamp", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked on this, and ORC-611 is closed and the fix versions are 1.6.4 and 1.7.0.
I'm going to see if I can get these tests to pass or open a ticket about possibly upgrading our ORC version if not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried updating but it did not affect the tests. There were several orc related files on the compile time path, but I'm not sure what ran during the tests.
It looks like the issue ORC-611 was closed, but it still exists in https://issues.apache.org/jira/browse/HIVE-23036
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to also try 1.7.0, but I'm wondering if we aren't fully excluding some ORC dependencies from other dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turns out 1.7.0 is not published to maven. I am keeping these tests commented out with a mention of the corresponding still open HIVE ticket, as it indicates where in the OrcInputFormat for Hive is the issue. Might be of use to us.
…econd min/max stats
…ering by row position from table metadata
…e is now referenced in FlinkCatalog directly
|
Thanks, @kbendick! This is really helpful. |
For many of the tests that are using Parameterized from junit, our description winds up reading .
Here's an example
However, we'd like to have a format string to show what the parameter is and what its current value is in a given test run. This can be accomplished by using
namein theParameterized.Parameterssection where test parameters to be looped over are placed.I also am taking the liberty to simplify some of the parameter definitions.