Github user paul-rogers commented on a diff in the pull request:

    https://github.com/apache/drill/pull/1045#discussion_r156176534
  
    --- Diff: 
contrib/storage-jdbc/src/main/java/org/apache/drill/exec/store/jdbc/JdbcBatchCreator.java
 ---
    @@ -33,10 +32,10 @@
     public class JdbcBatchCreator implements BatchCreator<JdbcSubScan> {
       @Override
       public ScanBatch getBatch(FragmentContext context, JdbcSubScan config,
    -      List<RecordBatch> children) throws ExecutionSetupException {
    +                            List<RecordBatch> children) throws 
ExecutionSetupException {
         Preconditions.checkArgument(children.isEmpty());
         JdbcStoragePlugin plugin = config.getPlugin();
    -    RecordReader reader = new JdbcRecordReader(context, 
plugin.getSource(), config.getSql(), plugin.getName());
    +    RecordReader reader = new JdbcRecordReader(plugin.getSource(), 
config.getSql(), plugin.getName());
    --- End diff --
    
    For readers that don't need the fragment context, it is certainly helpful, 
for unit testing, to omit it. However, operator context seems fair game. The 
operator context provides the Drill file system, the physical operator 
definition (the "config" here) and so on. Unfortunately, it is created inside 
the `ScanBatch`, to late to pass to the reader constructor.
    
    The new scan framework from the "batch size" project addresses these 
issues; but only for those few readers that we choose to upgrade; most readers 
will continue to use the changes you are making here.
    
    One other point: in an earlier file, you removed the physical operator 
definition (AKA "POP config") from the `ScanBatch` constructor. Here you leave 
it. Will this cause unexpected modes in which sometimes the operator definition 
is available, other times not?


---

Reply via email to