paul-rogers commented on a change in pull request #1789: DRILL-7181: Improve V3 
text reader (row set) error messages
URL: https://github.com/apache/drill/pull/1789#discussion_r285405232
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/scan/file/FileScanFramework.java
 ##########
 @@ -206,7 +206,13 @@ protected FileSplit nextSplit() {
 
   @Override
   protected SchemaNegotiatorImpl newNegotiator() {
-    return new FileSchemaNegotiatorImpl(this);
+    SchemaNegotiatorImpl nego = new FileSchemaNegotiatorImpl(this);
+    String tableName = 
Path.getPathWithoutSchemeAndAuthority(currentSplit.getPath()).toString();
+    if (currentSplit.getStart() != 0) {
+      tableName += String.format(", offset %,d", currentSplit.getStart());
+    }
+    nego.setTableName(tableName);
 
 Review comment:
   You spotted a quick & dirty hack. I originally thought that the row set 
context could hold interesting attributes. Have changed to code to clarify that 
it actually turned out that each kind of reader & plugin needs its own custom 
attributes.
   
   Example: the CSV reader wants to display things like:
   
   * That the Text format plugin is being used.
   * Extract header options.
   
   Then, the split context wants to add things like:
   
   * The name of the file being read.
   * The block offset where some error occurred (assuming the file is large, 
and the error occurred in, say, the third block.)

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