File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
paimon-core/src/main/java/org/apache/paimon/stats Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 2222import org .apache .paimon .data .BinaryArray ;
2323import org .apache .paimon .data .BinaryRow ;
2424import org .apache .paimon .data .GenericRow ;
25+ import org .apache .paimon .data .InternalArray ;
2526import org .apache .paimon .data .InternalRow ;
2627import org .apache .paimon .types .ArrayType ;
2728import org .apache .paimon .types .BigIntType ;
@@ -93,10 +94,15 @@ public InternalRow toRow() {
9394 }
9495
9596 public static SimpleStats fromRow (InternalRow row ) {
96- return new SimpleStats (
97- deserializeBinaryRow (row .getBinary (0 )),
98- deserializeBinaryRow (row .getBinary (1 )),
99- BinaryArray .fromLongArray (row .getArray (2 )));
97+ BinaryRow minValues = deserializeBinaryRow (row .getBinary (0 ));
98+ BinaryRow maxValues = deserializeBinaryRow (row .getBinary (1 ));
99+ InternalArray nullCounts = row .getArray (2 );
100+ if (minValues .getFieldCount () == 0
101+ && maxValues .getFieldCount () == 0
102+ && nullCounts .size () == 0 ) {
103+ return EMPTY_STATS ;
104+ }
105+ return new SimpleStats (minValues , maxValues , BinaryArray .fromLongArray (nullCounts ));
100106 }
101107
102108 @ Override
You can’t perform that action at this time.
0 commit comments