Package org.apache.drill.exec.record

Examples of org.apache.drill.exec.record.RecordBatchLoader.load()


    String planString = Resources.toString(Resources.getResource("functions/hive/GenericUDF.json"), Charsets.UTF_8);
    List<QueryResultBatch> results = testPhysicalWithResults(planString);

    RecordBatchLoader batchLoader = new RecordBatchLoader(getAllocator());
    for (QueryResultBatch result : results) {
      batchLoader.load(result.getHeader().getDef(), result.getData());
      if (batchLoader.getRecordCount() <= 0) {
        result.release();
        batchLoader.clear();
        continue;
      }
View Full Code Here


    String planString = Resources.toString(Resources.getResource("functions/hive/UDF.json"), Charsets.UTF_8);
    List<QueryResultBatch> results = testPhysicalWithResults(planString);

    RecordBatchLoader batchLoader = new RecordBatchLoader(getAllocator());
    for (QueryResultBatch result : results) {
      batchLoader.load(result.getHeader().getDef(), result.getData());
      if (batchLoader.getRecordCount() <= 0) {
        result.release();
        batchLoader.clear();
        continue;
      }
View Full Code Here

    // look at records
    RecordBatchLoader batchLoader = new RecordBatchLoader(client.getAllocator());
    int recordCount = 0;
    for (QueryResultBatch batch : results) {
      boolean schemaChanged = batchLoader.load(batch.getHeader().getDef(), batch.getData());
      boolean firstColumn = true;

      // print headers.
      if (schemaChanged) {
        System.out.println("\n\n========NEW SCHEMA=========\n\n");
View Full Code Here

          assertFalse(batch.hasData());
          batch.release();
          continue;
        }

        assertTrue(batchLoader.load(batch.getHeader().getDef(), batch.getData()));
        boolean firstColumn = true;

        // print headers.
        System.out.println("\n\n========NEW SCHEMA=========\n\n");
        for (VectorWrapper<?> v : batchLoader) {
View Full Code Here

          Files.toString(FileUtils.getResourceAsFile("/functions/cast/two_way_implicit_cast.json"), Charsets.UTF_8));

      RecordBatchLoader batchLoader = new RecordBatchLoader(bit.getContext().getAllocator());

      QueryResultBatch batch = results.get(0);
      assertTrue(batchLoader.load(batch.getHeader().getDef(), batch.getData()));

      Iterator<VectorWrapper<?>> itr = batchLoader.iterator();

      ValueVector.Accessor intAccessor1 = itr.next().getValueVector().getAccessor();
      ValueVector.Accessor varcharAccessor1 = itr.next().getValueVector().getAccessor();
View Full Code Here

    List<QueryResultBatch> results = testPhysicalWithResults(plan);

    RecordBatchLoader batchLoader = new RecordBatchLoader(getAllocator());

    QueryResultBatch batch = results.get(1);
    assertTrue(batchLoader.load(batch.getHeader().getDef(), batch.getData()));

    VarCharVector fragmentIdV = (VarCharVector) batchLoader.getValueAccessorById(VarCharVector.class, 0).getValueVector();
    BigIntVector recordWrittenV = (BigIntVector) batchLoader.getValueAccessorById(BigIntVector.class, 1).getValueVector();

    // expected only one row in output
View Full Code Here

    RecordBatchLoader batchLoader = new RecordBatchLoader(getAllocator());

    int recordsWritten = 0;
    for (QueryResultBatch batch : results) {
      batchLoader.load(batch.getHeader().getDef(), batch.getData());

      if (batchLoader.getRecordCount() <= 0) {
        continue;
      }
View Full Code Here

      int recordCount = 0;

      assertEquals(3, results.size());

      QueryResultBatch batch = results.get(1);
      assertTrue(batchLoader.load(batch.getHeader().getDef(), batch.getData()));
      batchLoader.load(batch.getHeader().getDef(), batch.getData());

      for (int r = 0; r < batchLoader.getRecordCount(); r++) {
        recordCount++;
        VectorWrapper<?> wrapper = batchLoader.getValueAccessorById(
View Full Code Here

      assertEquals(3, results.size());

      QueryResultBatch batch = results.get(1);
      assertTrue(batchLoader.load(batch.getHeader().getDef(), batch.getData()));
      batchLoader.load(batch.getHeader().getDef(), batch.getData());

      for (int r = 0; r < batchLoader.getRecordCount(); r++) {
        recordCount++;
        VectorWrapper<?> wrapper = batchLoader.getValueAccessorById(
            BigIntVector.class,
View Full Code Here

      int recordCount = 0;

      assertEquals(3, results.size());

      QueryResultBatch batch = results.get(1);
      assertTrue(batchLoader.load(batch.getHeader().getDef(), batch.getData()));
      batchLoader.load(batch.getHeader().getDef(), batch.getData());
      ValueVector.Accessor output = batchLoader.getValueAccessorById(NullableBigIntVector.class,
          batchLoader.getValueVectorId(
              new SchemaPath(new PathSegment.NameSegment("output"))).getFieldIds()[0]
      ).getValueVector().getAccessor();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.