Copilot commented on code in PR #1605:
URL: https://github.com/apache/fluss/pull/1605#discussion_r2336750129


##########
fluss-common/src/main/java/org/apache/fluss/record/LogRecordReadContext.java:
##########
@@ -69,6 +69,12 @@ public static LogRecordReadContext createReadContext(
         if (projection == null) {
             // set a default dummy projection to simplify code
             projection = Projection.of(IntStream.range(0, 
rowType.getFieldCount()).toArray());
+        } else {
+            // Explicitly forbid any projection for COMPACTED log format
+            if (logFormat == LogFormat.COMPACTED) {
+                throw new IllegalArgumentException(
+                        "Projection is not supported for COMPACTED log format. 
Please remove projection.");
+            }
         }

Review Comment:
   The projection validation check occurs inside an else block that only 
executes when projection is non-null, but it should validate against COMPACTED 
format regardless of whether projection exists. This validation should be moved 
outside the projection null check or handled differently to ensure COMPACTED 
format always rejects projections.
   ```suggestion
           }
           // Explicitly forbid any projection for COMPACTED log format
           if (logFormat == LogFormat.COMPACTED) {
               throw new IllegalArgumentException(
                       "Projection is not supported for COMPACTED log format. 
Please remove projection.");
           }
   ```



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

Reply via email to