diff --git a/paimon-common/src/main/java/org/apache/paimon/types/InternalRowToSizeVisitor.java b/paimon-common/src/main/java/org/apache/paimon/types/InternalRowToSizeVisitor.java index f8f0051717188..ca01965c46f43 100644 --- a/paimon-common/src/main/java/org/apache/paimon/types/InternalRowToSizeVisitor.java +++ b/paimon-common/src/main/java/org/apache/paimon/types/InternalRowToSizeVisitor.java @@ -300,5 +300,4 @@ public BiFunction visit(RowType rowType) { } }; } - } diff --git a/paimon-common/src/test/java/org/apache/paimon/types/InternalRowToSizeVisitorTest.java b/paimon-common/src/test/java/org/apache/paimon/types/InternalRowToSizeVisitorTest.java index aa9731c2439ca..17b0e5299ba44 100644 --- a/paimon-common/src/test/java/org/apache/paimon/types/InternalRowToSizeVisitorTest.java +++ b/paimon-common/src/test/java/org/apache/paimon/types/InternalRowToSizeVisitorTest.java @@ -1,3 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.apache.paimon.types; import org.apache.paimon.data.BinaryString; @@ -18,9 +36,7 @@ import java.util.function.BiFunction; import java.util.stream.Collectors; -/** - * Test for subclasses of InternalRowToSizeVisitor. - */ +/** Test for subclasses of InternalRowToSizeVisitor. */ public class InternalRowToSizeVisitorTest { private List> feildSizeCalculator; @@ -77,9 +93,10 @@ void setUp() { .build(); InternalRowToSizeVisitor internalRowToSizeVisitor = new InternalRowToSizeVisitor(); - feildSizeCalculator = rowType.getFieldTypes().stream().map( - dataType -> dataType.accept(internalRowToSizeVisitor) - ).collect(Collectors.toList()); + feildSizeCalculator = + rowType.getFieldTypes().stream() + .map(dataType -> dataType.accept(internalRowToSizeVisitor)) + .collect(Collectors.toList()); } @Test @@ -104,7 +121,7 @@ void testCalculatorSize() { row.setField(5, 0.5D); Assertions.assertThat(feildSizeCalculator.get(5).apply(row, 5)).isEqualTo(8); - row.setField(6, new GenericArray(new Object[]{BinaryString.fromString("1")})); + row.setField(6, new GenericArray(new Object[] {BinaryString.fromString("1")})); Assertions.assertThat(feildSizeCalculator.get(6).apply(row, 6)).isEqualTo(1); row.setField(7, BinaryString.fromString("3")); @@ -131,7 +148,7 @@ void testCalculatorSize() { row.setField(14, Decimal.fromBigDecimal(new BigDecimal("0.22"), 3, 3)); Assertions.assertThat(feildSizeCalculator.get(14).apply(row, 14)).isEqualTo(2); - row.setField(15, new byte[]{1, 5, 2}); + row.setField(15, new byte[] {1, 5, 2}); Assertions.assertThat(feildSizeCalculator.get(15).apply(row, 15)).isEqualTo(3); row.setField(16, 0.26F); @@ -154,12 +171,10 @@ void testCalculatorSize() { Assertions.assertThat(feildSizeCalculator.get(20).apply(row, 20)).isEqualTo(2); row.setField( - 21, - new GenericMap(Collections.singletonMap(BinaryString.fromString("set"), 1))); + 21, new GenericMap(Collections.singletonMap(BinaryString.fromString("set"), 1))); Assertions.assertThat(feildSizeCalculator.get(21).apply(row, 21)).isEqualTo(3); - row.setField( 22, GenericRow.of( @@ -168,11 +183,10 @@ void testCalculatorSize() { Collections.singletonMap( BinaryString.fromString("k"), BinaryString.fromString("v"))), - new GenericArray(new Object[]{BinaryString.fromString("1")}), + new GenericArray(new Object[] {BinaryString.fromString("1")}), new GenericMap( Collections.singletonMap( BinaryString.fromString("set"), 1))))); Assertions.assertThat(feildSizeCalculator.get(22).apply(row, 22)).isEqualTo(6); } - -} \ No newline at end of file +}