stevenzwu commented on a change in pull request #2566: URL: https://github.com/apache/iceberg/pull/2566#discussion_r636654755
########## File path: flink/src/main/java/org/apache/iceberg/flink/source/BatchRowDataIterator.java ########## @@ -0,0 +1,225 @@ +/* + * 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.iceberg.flink.source; + +import java.io.IOException; +import java.util.Collection; +import java.util.Map; +import org.apache.flink.table.data.ColumnarRowData; +import org.apache.flink.table.data.RowData; +import org.apache.flink.table.data.vector.VectorizedColumnBatch; +import org.apache.flink.table.types.DataType; +import org.apache.flink.table.types.logical.LogicalType; +import org.apache.iceberg.CombinedScanTask; +import org.apache.iceberg.DataFile; +import org.apache.iceberg.FileContent; +import org.apache.iceberg.FileFormat; +import org.apache.iceberg.FileScanTask; +import org.apache.iceberg.MetadataColumns; +import org.apache.iceberg.Schema; +import org.apache.iceberg.encryption.EncryptionManager; +import org.apache.iceberg.flink.data.RowDataUtil; +import org.apache.iceberg.flink.data.vectorized.VectorizedFlinkOrcReaders; +import org.apache.iceberg.io.CloseableIterable; +import org.apache.iceberg.io.CloseableIterator; +import org.apache.iceberg.io.FileIO; +import org.apache.iceberg.mapping.NameMappingParser; +import org.apache.iceberg.orc.ORC; +import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap; +import org.apache.iceberg.relocated.com.google.common.collect.Sets; +import org.apache.iceberg.types.TypeUtil; +import org.apache.iceberg.util.PartitionUtil; +import org.jetbrains.annotations.NotNull; + +class BatchRowDataIterator extends DataIterator<RowData> { + + private final Schema tableSchema; + private final Schema projectedSchema; + private final String nameMapping; + private final boolean caseSensitive; + private final DataType[] dataTypes; + + BatchRowDataIterator(CombinedScanTask task, FileIO io, EncryptionManager encryption, Schema tableSchema, + Schema projectedSchema, String nameMapping, boolean caseSensitive, DataType[] dataTypes) { + super(task, io, encryption); + this.tableSchema = tableSchema; + this.projectedSchema = projectedSchema; + this.nameMapping = nameMapping; + this.caseSensitive = caseSensitive; + this.dataTypes = dataTypes; Review comment: I have a few questions about passing in `DataType[]` here to check if they contain any unsupported types 1. I believe the array is only for top level columns. what if a nested field is unsupported type? 2. Since the `DataType[]` is only extracted from table or projected schema in `FlinkSource`, should such validation be done once in the constructor of `FlinkInputFormat`? 3. Will vectorized read be able to support all valid types so that we don't need to do this check in the future? -- 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: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
