Copilot commented on code in PR #6500:
URL: https://github.com/apache/paimon/pull/6500#discussion_r2480748870
##########
paimon-api/src/main/java/org/apache/paimon/CoreOptions.java:
##########
@@ -2295,6 +2302,16 @@ public String fileCompression() {
return options.get(FILE_COMPRESSION);
}
+ public String formatTableFileImplementation() {
+ if (options.containsKey(FILE_COMPRESSION.key())) {
+ return options.get(FILE_COMPRESSION);
+ } else if (options.containsKey(FORMAT_TABLE_FILE_COMPRESSION.key())) {
+ return options.get(FORMAT_TABLE_FILE_COMPRESSION);
+ } else {
+ return fileCompression();
Review Comment:
The fallback logic at line 2311 calls `fileCompression()` which returns
`options.get(FILE_COMPRESSION)` and can be null. This creates a circular logic
issue: if `FILE_COMPRESSION` key is not present (checked at line 2306), calling
`fileCompression()` will still return null. This method can return null,
causing potential NullPointerException when used. The method should either
return a non-null default value based on format type (like
`CatalogUtils.getFormatTableFileCompression()` does) or be annotated as
`@Nullable`.
```suggestion
// Fallback to a sensible default value if neither key is
present.
// For example, "none" or another appropriate default.
return "none";
```
--
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]