[ 
https://issues.apache.org/jira/browse/DRILL-7601?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17045484#comment-17045484
 ] 

ASF GitHub Bot commented on DRILL-7601:
---------------------------------------

arina-ielchiieva commented on pull request #1993: DRILL-7601: Shift column 
conversion to reader from scan framework
URL: https://github.com/apache/drill/pull/1993#discussion_r384453827
 
 

 ##########
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/store/easy/text/compliant/TextCsvWithoutHeadersWithSchema.java
 ##########
 @@ -0,0 +1,163 @@
+/*
+ * 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.text.compliant;
+
+import org.apache.drill.common.types.TypeProtos.MinorType;
+import org.apache.drill.exec.physical.rowSet.RowSet;
+import org.apache.drill.exec.physical.rowSet.RowSetBuilder;
+import org.apache.drill.exec.record.metadata.SchemaBuilder;
+import org.apache.drill.exec.record.metadata.TupleMetadata;
+import org.apache.drill.test.rowSet.RowSetUtilities;
+import org.joda.time.LocalDate;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Tests the combination of a CSV file without headers, but with a
+ * provided schema. The provided schema <b>must</b> list columns
+ * in the order they appear in the file, with no holes. The column
+ * list need not be exhaustive, however, there can be unlabeled columns
+ * at the end which are ignored. No `columns` array is created in
+ * this case.
+ * <p>
+ * Not exhaustive: once we get past building the schema, operation
+ * is identical to the with-headers, with-schema case.
+ */
+public class TextCsvWithoutHeadersWithSchema extends BaseCsvTest {
 
 Review comment:
   Maybe we should also update the docs, describing this new feature 
(https://drill.apache.org/docs/create-or-replace-schema/).
 
----------------------------------------------------------------
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]


> Shift column conversion to reader from scan framework
> -----------------------------------------------------
>
>                 Key: DRILL-7601
>                 URL: https://issues.apache.org/jira/browse/DRILL-7601
>             Project: Apache Drill
>          Issue Type: Improvement
>    Affects Versions: 1.17.0
>            Reporter: Paul Rogers
>            Assignee: Paul Rogers
>            Priority: Major
>             Fix For: 1.18.0
>
>
> At the time we implemented provided schemas with the text reader, the best 
> path forward appeared to be to perform column type conversions within the 
> scan framework including deep in the column writer structure.
> Experience with other readers has shown that the text reader is a special 
> case: it always writes strings, which Drill-provided converters can parse 
> into other types. Other readers, however are not so simple: they often have 
> their own source structures which must be mated to a column reader, and so 
> conversion is generally best done in the reader where it can be specific to 
> the nuances of each reader.
> This ticket asks to restructure the conversion code to fit the 
> reader-does-conversion pattern.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to