drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [drill] sanel commented on a change in pull request #2085: DRILL-7746: Add REST API Ability to Accept CSV Input
Date Tue, 02 Jun 2020 17:51:00 GMT

sanel commented on a change in pull request #2085:
URL: https://github.com/apache/drill/pull/2085#discussion_r434062419



##########
File path: contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/HttpScanBatchCreator.java
##########
@@ -92,9 +92,16 @@ public void bind(ManagedScanFramework framework) { }
     @Override
     public ManagedReader<SchemaNegotiator> next() {
 
+      // Get the expected input type
+      String inputType = subScan.tableSpec().connectionConfig().inputType();
+
       // Only a single scan (in a single thread)
       if (count++ == 0) {
-        return new HttpBatchReader(subScan);
+        if (inputType.equalsIgnoreCase("csv")) {
+          return new HttpCSVBatchReader(subScan);
+        } else {
+          return new HttpBatchReader(subScan);
+        }

Review comment:
       Github won't let me leave the comment for `else` block down below, but that `return
null;` can go as default (without `else`). 




----------------------------------------------------------------
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:
users@infra.apache.org



Mime
View raw message