Review Board 1.7.22


Added JSONScanPOP and JSONBatchCreator

Review Request #12046 - Created June 22, 2013 and submitted

Timothy Chen
execwork
Reviewers
drill-git
jacques
drill-git
Added JSONBatchCreator and JSONScanPOP. Also included some ValueVector fixes.

 

Diff revision 1 (Latest)

  1. sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/JSONScanBatchCreator.java: Loading...
  2. sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/JSONScanPOP.java: Loading...
  3. sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/ImplCreator.java: Loading...
  4. sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/ScanBatch.java: Loading...
  5. sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/materialize/VectorRecordMaterializer.java: Loading...
  6. sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/RecordBatchLoader.java: Loading...
  7. sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/vector/AbstractFixedValueVector.java: Loading...
  8. sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/vector/BaseValueVector.java: Loading...
  9. sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/vector/Bit.java: Loading...
  10. sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/vector/NullableValueVector.java: Loading...
  11. sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/vector/VariableVector.java: Loading...
  12. sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/schema/DiffSchema.java: Loading...
  13. sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/store/JSONRecordReader.java: Loading...
  14. sandbox/prototype/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/TestSimpleFragmentRun.java: Loading...
  15. sandbox/prototype/exec/java-exec/src/test/resources/physical_json_scan_test1.json: Loading...
sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/JSONScanBatchCreator.java
New File

    
   
1
/*******************************************************************************

    
   
2
 * Licensed to the Apache Software Foundation (ASF) under one

    
   
3
 * or more contributor license agreements.  See the NOTICE file

    
   
4
 * distributed with this work for additional information

    
   
5
 * regarding copyright ownership.  The ASF licenses this file

    
   
6
 * to you under the Apache License, Version 2.0 (the

    
   
7
 * "License"); you may not use this file except in compliance

    
   
8
 * with the License.  You may obtain a copy of the License at

    
   
9
 *

    
   
10
 * http://www.apache.org/licenses/LICENSE-2.0

    
   
11
 *

    
   
12
 * Unless required by applicable law or agreed to in writing, software

    
   
13
 * distributed under the License is distributed on an "AS IS" BASIS,

    
   
14
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

    
   
15
 * See the License for the specific language governing permissions and

    
   
16
 * limitations under the License.

    
   
17
 ******************************************************************************/

    
   
18

   

    
   
19
package org.apache.drill.exec.physical.config;

    
   
20

   

    
   
21
import com.google.common.base.Preconditions;

    
   
22
import com.google.common.collect.Lists;

    
   
23
import org.apache.drill.common.exceptions.ExecutionSetupException;

    
   
24
import org.apache.drill.exec.ops.FragmentContext;

    
   
25
import org.apache.drill.exec.physical.impl.BatchCreator;

    
   
26
import org.apache.drill.exec.physical.impl.ScanBatch;

    
   
27
import org.apache.drill.exec.record.RecordBatch;

    
   
28
import org.apache.drill.exec.store.JSONRecordReader;

    
   
29
import org.apache.drill.exec.store.RecordReader;

    
   
30

   

    
   
31
import java.util.List;

    
   
32

   

    
   
33
public class JSONScanBatchCreator implements BatchCreator<JSONScanPOP> {

    
   
34

   

    
   
35
    @Override

    
   
36
    public RecordBatch getBatch(FragmentContext context, JSONScanPOP config, List<RecordBatch> children) throws ExecutionSetupException {

    
   
37
        Preconditions.checkArgument(children.isEmpty());

    
   
38
        List<JSONScanPOP.ScanEntry> entries = config.getReadEntries();

    
   
39
        List<RecordReader> readers = Lists.newArrayList();

    
   
40
        for (JSONScanPOP.ScanEntry e : entries) {

    
   
41
            readers.add(new JSONRecordReader(context, e.getUrl()));

    
   
42
        }

    
   
43

   

    
   
44
        return new ScanBatch(context, readers.iterator());

    
   
45
    }

    
   
46
}
sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/JSONScanPOP.java
New File
 
sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/ImplCreator.java
Revision d98c107 New Change
 
sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/ScanBatch.java
Revision 33c1e29 New Change
 
sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/materialize/VectorRecordMaterializer.java
Revision 7929296 New Change
 
sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/RecordBatchLoader.java
Revision d990198 New Change
 
sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/vector/AbstractFixedValueVector.java
Revision 8748285 New Change
 
sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/vector/BaseValueVector.java
Revision 69cd628 New Change
 
sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/vector/Bit.java
Revision 533e3bd New Change
 
sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/vector/NullableValueVector.java
Revision 8c3d7f6 New Change
 
sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/vector/VariableVector.java
Revision dc8fec4 New Change
 
sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/schema/DiffSchema.java
Revision b654a92 New Change
 
sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/store/JSONRecordReader.java
Revision 42d1be5 New Change
 
sandbox/prototype/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/TestSimpleFragmentRun.java
Revision 594a3a2 New Change
 
sandbox/prototype/exec/java-exec/src/test/resources/physical_json_scan_test1.json
New File
 
  1. sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/JSONScanBatchCreator.java: Loading...
  2. sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/JSONScanPOP.java: Loading...
  3. sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/ImplCreator.java: Loading...
  4. sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/ScanBatch.java: Loading...
  5. sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/materialize/VectorRecordMaterializer.java: Loading...
  6. sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/RecordBatchLoader.java: Loading...
  7. sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/vector/AbstractFixedValueVector.java: Loading...
  8. sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/vector/BaseValueVector.java: Loading...
  9. sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/vector/Bit.java: Loading...
  10. sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/vector/NullableValueVector.java: Loading...
  11. sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/vector/VariableVector.java: Loading...
  12. sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/schema/DiffSchema.java: Loading...
  13. sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/store/JSONRecordReader.java: Loading...
  14. sandbox/prototype/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/TestSimpleFragmentRun.java: Loading...
  15. sandbox/prototype/exec/java-exec/src/test/resources/physical_json_scan_test1.json: Loading...