KurtYoung commented on a change in pull request #8492: [FLINK-12563][table-runtime-blink] Introduce vector data format in blink URL: https://github.com/apache/flink/pull/8492#discussion_r286328269
########## File path: flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/vector/VectorizedColumnBatch.java ########## @@ -0,0 +1,134 @@ +/* + * 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.flink.table.dataformat.vector; + +import org.apache.flink.table.dataformat.Decimal; +import org.apache.flink.table.dataformat.vector.BytesColumnVector.Bytes; + +import java.io.Serializable; + +/** + * A VectorizedColumnBatch is a set of rows, organized with each column as a vector. It is the + * unit of query execution, organized to minimize the cost per row. + * + * <p>{@code VectorizedColumnBatch}s are influenced by Apache Hive VectorizedRowBatch. + */ +public class VectorizedColumnBatch implements Serializable { + private static final long serialVersionUID = 8180323238728166155L; + + /** + * This number is carefully chosen to minimize overhead and typically allows + * one VectorizedColumnBatch to fit in cache. + */ + public static final int DEFAULT_SIZE = 2048; + + private int numRows; + public final ColumnVector[] columns; + + public VectorizedColumnBatch(ColumnVector[] vectors) { + this.columns = vectors; + } + + /** + * Resets the batch for writing. + */ + public void reset() { + for (ColumnVector column : columns) { + column.reset(); + } + this.numRows = 0; + } + + public void setNumRows(int numRows) { Review comment: why not set this in constructor? ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services