paul-rogers commented on a change in pull request #1798: DRILL-7279: Enable 
provided schema for text files without headers
URL: https://github.com/apache/drill/pull/1798#discussion_r290993793
 
 

 ##########
 File path: 
exec/vector/src/main/java/org/apache/drill/exec/record/metadata/TupleMetadata.java
 ##########
 @@ -46,6 +46,10 @@
 public interface TupleMetadata extends Propertied, Iterable<ColumnMetadata> {
 
   public static final String IS_STRICT_SCHEMA_PROP = DRILL_PROP_PREFIX + 
"strict";
+  public static final String HAS_HEADERS_PROP = DRILL_PROP_PREFIX + "headers";
+  public static final String SKIP_FIRST_LINE_PROP = DRILL_PROP_PREFIX + 
"skipFirstLine";
+  public static final String DELIMITER_PROP = DRILL_PROP_PREFIX + "delimiter";
 
 Review comment:
   Good question. To the code here, the property is just a string. Any 
encoding/decoding should be done in the code that populates the properties.
   
   Created a unit test to verify. Found the following SQL:
   
   ```
   drill.text.quote=''''
   ```
   
   Works to set a quote to a single-quote character.
   
   This SQL:
   
   ```
   drill.text.fieldDelimiter='\01'
   ```
   
   Works to set the delimiter to ASCII 1. The output in the `.drill.schema` 
file:
   
   ```
         "drill.text.fieldDelimiter" : "\u0001",
   ```
   
   The following SQL also works:
   
   ```
   drill.text.fieldDelimiter='\u0001'
   ```
   
   Also, seems the following work in SQL and the schema file:
   
   ```
   drill.text.newline='\n'
   drill.text.newline='\r'
   ```

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to