cshuo commented on code in PR #12796: URL: https://github.com/apache/hudi/pull/12796#discussion_r1962765560
########## hudi-client/hudi-flink-client/src/main/java/org/apache/hudi/client/model/HoodieFlinkInternalRowTypeInfo.java: ########## @@ -0,0 +1,107 @@ +/* + * 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.hudi.client.model; + +import org.apache.flink.api.common.ExecutionConfig; +import org.apache.flink.api.common.typeinfo.TypeInformation; +import org.apache.flink.api.common.typeutils.TypeSerializer; +import org.apache.flink.table.data.RowData; +import org.apache.flink.table.types.logical.RowType; + +import java.util.Objects; + +/** + * Type information class for {@link HoodieFlinkInternalRow}. + */ +public class HoodieFlinkInternalRowTypeInfo extends TypeInformation<HoodieFlinkInternalRow> { + + private static final long serialVersionUID = 1L; + + private final RowType rowType; + + private final TypeInformation<RowData> rowDataInfo; Review Comment: `getArity` and `getTotalFields` are used in Flink internal `CompositeType`, for eg, `TupleTypeInfoBase` or `PojoTypeInfo`, and are useless for other cases. Actually, we can simple return 1 for both cases, just like what `InternalTypeInfo` for RowData does or you can refer to other system, e.g, Iceberg/Paimon, which also have some customized TypeInfo & Serializer. For the performance lost, it's weird, because I believe`getArity` and `getTotalFields`will not be called at all. I am wondering whether the benchmark metric is stable for multiple runs even with same settings. -- 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]
