-
Notifications
You must be signed in to change notification settings - Fork 73
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
Chunking fail for String variable with new netcdf-c package library (4.9.0) #1420
Comments
Greetings @charlycou! Thank you for your detailed report. I have confirmed with the netCDF-C team that this is indeed the same issue you pointed to in the issue on the netCDF4-python repository. When using netCDF-Java to write netCDF-4 files, we apply a default chunking strategy, which does add compression. To fix this particular bug, we will need to tweak the chunk strategies we include in netCDF-Java to not set a deflate level greater than zero when writing variables that are of type |
Thank you for your answer @lesserwhirls . In this case adding a condition in @Override
public boolean isChunked(Variable v) {
if (v.isUnlimited())
return true;
// if (getChunkAttribute(v) != null) return true;
if(v.getDataType().equals(DataType.STRING) || v.isVariableLength() )
return false;
long size = v.getSize() * v.getElementSize();
return (size > minVariableSize);
} But is String the only DataType for which chunking should be excluded? |
I think we will also have to handle STRUCTURE special as well, since the STRUCTURE should not contain STRING either (I think). I also think we'll need to do a check in the |
In netcdf-c, I had to write a recursive routine that walked all the types to look for variable length types. |
Thanks for that tip, @DennisHeimbigner! I don't know that we have a sample file with that level of complexity or not, but I should make sure we hit that case. |
Versions impacted by the bug
netcdf-java : 5.7.0
netcdf-c : 4.9.0 (packed with libnetcdf19)
What went wrong?
netcdf4 file writing fail writing variable
at
netcdf-java/netcdf4/src/main/java/ucar/nc2/jni/netcdf/Nc4Iosp.java
Line 2544 in be9e03f
This issue is raised for String variable and is not thrown for other Double variable from the same file. This could be linked to Unidata/netcdf4-python#1205 but from this discussion this issue is raised when trying to use compression on variable length String variable which seems not to be my case.
Relevant stack trace
Relevant log messages
To reproduce my issue : https://github.com/charlycou/netcdf4-java-chunking-issue
The text was updated successfully, but these errors were encountered: