paul-rogers commented on a change in pull request #1618: DRILL-6950: Row set-based scan framework URL: https://github.com/apache/drill/pull/1618#discussion_r251218627
########## File path: exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/scan/columns/ColumnsScanFramework.java ########## @@ -0,0 +1,121 @@ +/* + * 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.drill.exec.physical.impl.scan.columns; + +import java.util.List; + +import org.apache.drill.common.exceptions.ExecutionSetupException; +import org.apache.drill.common.expression.SchemaPath; +import org.apache.drill.exec.physical.impl.scan.file.BaseFileScanFramework; +import org.apache.drill.exec.physical.impl.scan.file.BaseFileScanFramework.FileSchemaNegotiator; +import org.apache.drill.exec.physical.impl.scan.file.FileScanFramework.FileSchemaNegotiatorImpl; +import org.apache.drill.exec.physical.impl.scan.framework.ManagedReader; +import org.apache.drill.exec.physical.impl.scan.framework.ShimBatchReader; +import org.apache.drill.exec.store.dfs.DrillFileSystem; +import org.apache.drill.exec.store.dfs.easy.FileWork; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.mapred.FileSplit; + +/** + * Scan framework for a file that supports the special "columns" column. + */ + +public class ColumnsScanFramework extends BaseFileScanFramework<ColumnsScanFramework.ColumnsSchemaNegotiator> { + + public interface FileReaderCreator { + ManagedReader<ColumnsSchemaNegotiator> makeBatchReader( + DrillFileSystem dfs, + FileSplit split) throws ExecutionSetupException; + } + + /** + * Schema negotiator that supports the file scan options plus access + * to the specific selected columns indexes. + */ + + public interface ColumnsSchemaNegotiator extends FileSchemaNegotiator { + boolean columnsArrayProjected(); + boolean[] projectedIndexes(); + } + + /** + * Implementation of the columns array schema negotiator. + */ + + public static class ColumnsSchemaNegotiatorImpl extends FileSchemaNegotiatorImpl + implements ColumnsSchemaNegotiator { + + private final ColumnsScanFramework framework; + + public ColumnsSchemaNegotiatorImpl(ColumnsScanFramework framework, + ShimBatchReader<ColumnsSchemaNegotiator> shim) { + super(framework, shim); Review comment: Done. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
