cgivre commented on a change in pull request #1962: DRILL-7554: Convert LTSV Format Plugin to EVF URL: https://github.com/apache/drill/pull/1962#discussion_r376516027
########## File path: exec/java-exec/src/main/java/org/apache/drill/exec/store/easy/EasyEVFBatchReader.java ########## @@ -0,0 +1,162 @@ +/* + * 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.store.easy; + +import org.apache.drill.common.exceptions.UserException; +import org.apache.drill.common.types.TypeProtos; +import org.apache.drill.exec.physical.impl.scan.file.FileScanFramework.FileSchemaNegotiator; +import org.apache.drill.exec.physical.impl.scan.framework.ManagedReader; +import org.apache.drill.exec.physical.resultSet.ResultSetLoader; +import org.apache.drill.exec.physical.resultSet.RowSetLoader; +import org.apache.drill.exec.record.metadata.ColumnMetadata; +import org.apache.drill.exec.record.metadata.MetadataUtils; +import org.apache.drill.exec.vector.accessor.ScalarWriter; +import org.apache.drill.exec.vector.accessor.TupleWriter; +import org.apache.hadoop.mapred.FileSplit; +import org.joda.time.Instant; +import org.joda.time.LocalDate; +import org.joda.time.LocalTime; +import org.joda.time.Period; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; +import java.util.Iterator; + +public abstract class EasyEVFBatchReader implements ManagedReader<FileSchemaNegotiator> { + + private static final Logger logger = LoggerFactory.getLogger(EasyEVFBatchReader.class); Review comment: @arina-ielchiieva I wanted to try to hide as much of the boiler plate code for format plugins as possible. I wanted to start with the LTSV plugin since it is relatively simple. I think this would be useful for simple formats (image, httpd, etc) and future formats. I don't think there is any point in converting EVF plugins to use this, but my goal was to make it easier for future EVF based plugins. LTSV doesn't know the schema in advance, so this one just generates the columns on the fly. The next iteration of this will include features to define the schema in advance, like HTTPD does. ---------------------------------------------------------------- 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