Skip to content

Commit e6be0b8

Browse files
x-tongclaude
andcommitted
Address PR review comments for FlinkArrowUtils
- Mark class as final to prevent subclassing - Add null check for logicalType parameter to throw IllegalArgumentException instead of NPE Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 666fc85 commit e6be0b8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

auron-flink-extension/auron-flink-runtime/src/main/java/org/apache/auron/flink/arrow/FlinkArrowUtils.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
/**
5454
* Utility class for converting Flink {@link LogicalType} instances to Arrow types, fields and schemas.
5555
*/
56-
public class FlinkArrowUtils {
56+
public final class FlinkArrowUtils {
5757

5858
/**
5959
* Root allocator for Arrow memory management.
@@ -82,6 +82,9 @@ public static BufferAllocator createChildAllocator(String name) {
8282
* @throws UnsupportedOperationException if the type is not supported
8383
*/
8484
public static ArrowType toArrowType(LogicalType logicalType) {
85+
if (logicalType == null) {
86+
throw new IllegalArgumentException("logicalType cannot be null");
87+
}
8588
if (logicalType instanceof NullType) {
8689
return ArrowType.Null.INSTANCE;
8790
} else if (logicalType instanceof BooleanType) {

0 commit comments

Comments
 (0)