Examples of SchemaPath


Examples of org.apache.drill.common.expression.SchemaPath

    int recordCount = 0;
    int batchCount = 0;

    while(exec.next()){
      batchCount++;
      IntVector c1 = exec.getValueVectorById(new SchemaPath("blue", ExpressionPosition.UNKNOWN), IntVector.class);
      IntVector c2 = exec.getValueVectorById(new SchemaPath("green", ExpressionPosition.UNKNOWN), IntVector.class);

      IntVector.Accessor a1 = c1.getAccessor();
      IntVector.Accessor a2 = c2.getAccessor();

      for(int i =0; i < c1.getAccessor().getValueCount(); i++){
View Full Code Here

Examples of org.apache.drill.common.expression.SchemaPath

    int recordCount = 0;
    int batchCount = 0;

    while(exec.next()){
      batchCount++;
      IntVector c1 = exec.getValueVectorById(new SchemaPath("blue", ExpressionPosition.UNKNOWN), IntVector.class);
      BigIntVector c2 = exec.getValueVectorById(new SchemaPath("alt", ExpressionPosition.UNKNOWN), BigIntVector.class);

      IntVector.Accessor a1 = c1.getAccessor();
      BigIntVector.Accessor a2 = c2.getAccessor();

      for(int i =0; i < c1.getAccessor().getValueCount(); i++){
View Full Code Here

Examples of org.apache.drill.common.expression.SchemaPath

          int rows = b.getHeader().getRowCount();
          count += rows;
          RecordBatchLoader loader = new RecordBatchLoader(new BootStrapContext(DrillConfig.create()).getAllocator());
          loader.load(b.getHeader().getDef(), b.getData());
          BigIntVector vv1 = (BigIntVector)loader.getValueAccessorById(BigIntVector.class, loader.getValueVectorId(
                  new SchemaPath("col1", ExpressionPosition.UNKNOWN)).getFieldIds()).getValueVector();
          Float8Vector vv2 = (Float8Vector)loader.getValueAccessorById(Float8Vector.class, loader.getValueVectorId(
                  new SchemaPath("col2", ExpressionPosition.UNKNOWN)).getFieldIds()).getValueVector();
          IntVector pVector = (IntVector)loader.getValueAccessorById(IntVector.class, loader.getValueVectorId(
                  new SchemaPath("partition", ExpressionPosition.UNKNOWN)).getFieldIds()).getValueVector();
          long previous1 = Long.MIN_VALUE;
          double previous2 = Double.MIN_VALUE;
          int partPrevious = -1;
          long current1 = Long.MIN_VALUE;
          double current2 = Double.MIN_VALUE;
View Full Code Here

Examples of org.apache.drill.common.expression.SchemaPath

      for (QueryResultBatch b : results) {
        if (b.getHeader().getRowCount() == 0) break;
        batchCount++;
        RecordBatchLoader loader = new RecordBatchLoader(bit1.getContext().getAllocator());
        loader.load(b.getHeader().getDef(),b.getData());
        BigIntVector c1 = (BigIntVector) loader.getValueAccessorById(BigIntVector.class, loader.getValueVectorId(new SchemaPath("blue", ExpressionPosition.UNKNOWN)).getFieldIds()).getValueVector();


        BigIntVector.Accessor a1 = c1.getAccessor();
//        IntVector.Accessor a2 = c2.getAccessor();
View Full Code Here

Examples of org.apache.drill.common.expression.SchemaPath

    DrillConfig config = DrillConfig.create();
    Drillbit bit = new Drillbit(config, serviceSet);
    bit.run();
    DrillbitContext context = bit.getContext();

    MaterializedField intField = MaterializedField.create(new SchemaPath("int", ExpressionPosition.UNKNOWN), Types.required(TypeProtos.MinorType.INT));
    IntVector intVector = (IntVector)TypeHelper.getNewVector(intField, context.getAllocator());
    MaterializedField binField = MaterializedField.create(new SchemaPath("binary", ExpressionPosition.UNKNOWN), Types.required(TypeProtos.MinorType.VARBINARY));
    VarBinaryVector binVector = (VarBinaryVector)TypeHelper.getNewVector(binField, context.getAllocator());
    AllocationHelper.allocate(intVector, 4, 4);
    AllocationHelper.allocate(binVector, 4, 5);
    vectorList.add(intVector);
    vectorList.add(binVector);
View Full Code Here

Examples of org.apache.drill.common.expression.SchemaPath

  private static WritableBatch getRandomBatch(BufferAllocator allocator, int records) {
    List<ValueVector> vectors = Lists.newArrayList();
    for (int i = 0; i < 5; i++) {
      Float8Vector v = (Float8Vector) TypeHelper.getNewVector(
          MaterializedField.create(new SchemaPath("a", ExpressionPosition.UNKNOWN), Types.required(MinorType.FLOAT8)),
          allocator);
      v.allocateNew(records);
      v.getMutator().generateTestData(records);
      vectors.add(v);
    }
View Full Code Here

Examples of org.apache.drill.common.expression.SchemaPath

        FunctionImplementationRegistry registry = new FunctionImplementationRegistry(c);
        FragmentContext context = new FragmentContext(bitContext, BitControl.PlanFragment.getDefaultInstance(), connection, registry);
        SimpleRootExec exec = new SimpleRootExec(ImplCreator.getExec(context, (FragmentRoot) plan.getSortedOperators(false).iterator().next()));

        while(exec.next()) {
            IntVector intMulVector = exec.getValueVectorById(new SchemaPath("INTMUL", ExpressionPosition.UNKNOWN), IntVector.class);
            Float8Vector floatMulVector = exec.getValueVectorById(new SchemaPath("FLOATMUL", ExpressionPosition.UNKNOWN), Float8Vector.class);
            IntVector intAddVector = exec.getValueVectorById(new SchemaPath("INTADD", ExpressionPosition.UNKNOWN), IntVector.class);
            Float8Vector floatAddVector = exec.getValueVectorById(new SchemaPath("FLOATADD", ExpressionPosition.UNKNOWN), Float8Vector.class);
            assertEquals(exec.getRecordCount(), 1);
            assertEquals(intMulVector.getAccessor().get(0), 2);
            assertEquals(floatMulVector.getAccessor().get(0), (1.1 * 2.2), 0);
            assertEquals(intAddVector.getAccessor().get(0), 3);
            assertEquals(floatAddVector.getAccessor().get(0), (1.1 + 2.2), 0);
View Full Code Here

Examples of org.apache.drill.common.expression.SchemaPath

    DrillConfig c = DrillConfig.create();

    FunctionImplementationRegistry reg = new FunctionImplementationRegistry(c);
    EvaluationVisitor v = new EvaluationVisitor(reg);
    CodeGenerator<?> g = CodeGenerator.get(Projector.TEMPLATE_DEFINITION, reg);
    SchemaPath path = (SchemaPath) getExpr("a.b[4][2].c[6]");

    TypedFieldId id = TypedFieldId.newBuilder() //
      .addId(1) //
      .addId(3) //
      .remainder(path.getRootSegment()) //
      .intermediateType(Types.optional(MinorType.MAP))
      .finalType(Types.repeated(MinorType.MAP)) //
      .hyper() //
      .withIndex() //
      .build();
View Full Code Here

Examples of org.apache.drill.common.expression.SchemaPath

    FunctionImplementationRegistry registry = new FunctionImplementationRegistry(c);
    FragmentContext context = new FragmentContext(bitContext, PlanFragment.getDefaultInstance(), connection, registry);
    SimpleRootExec exec = new SimpleRootExec(ImplCreator.getExec(context, (FragmentRoot) plan.getSortedOperators(false).iterator().next()));

    while(exec.next()){
      NullableVarCharVector c1 = exec.getValueVectorById(new SchemaPath("col3", ExpressionPosition.UNKNOWN), NullableVarCharVector.class);
      NullableVarCharVector.Accessor a1;
      a1 = c1.getAccessor();

      int count = 0;
      for(int i = 0; i < c1.getAccessor().getValueCount(); i++){
View Full Code Here

Examples of org.jibx.schema.elements.SchemaPath

       
        // use child customizations to amend the generated extensions
        int size = getChildren().size();
        for (int i = 0; i < size; i++) {
            ComponentCustom custom = (ComponentCustom)getChildren().get(i);
            SchemaPath path = custom.buildPath(vctx);
            if (path != null) {
                if (path.isWildStart()) {
                    vctx.addError("Top level customizations cannot use wildcard as first step", custom);
                } else {
                   
                    // match only the first path step
                    OpenAttrBase match = path.partialMatchUnique(0, 0, m_schema);
                    if (s_logger.isDebugEnabled()) {
                        if (match == null) {
                            s_logger.debug("No global schema component found for customization " + custom);
                        } else {
                            s_logger.debug("Matched customization " + custom + " to global schema component "
                                + SchemaUtils.describeComponent(match));
                        }
                    }
                    if (match != null) {
                        String name = ((INamed)match).getName();
                        GlobalExtension exten = (GlobalExtension)match.getExtension();
                        if (custom.isExcluded()) {
                           
                            // check if customization applies to descendant of global definition component
                            if (path.getPathLength() == 1) {
                               
                                // force exclude if generation skipped by customization
                                if (exten.isIncluded()) {
                                    vctx.addWarning("Name '" + name
                                        + "' is on include list for schema, but excluded by customization", custom);
                                }
                                exten.setIncluded(false);
                                exten.setRemoved(true);
                               
                            } else {
                               
                                // apply customization to target component extension(s)
                                applyRemainingCustomizationPath(path, match, custom, vctx);
                               
                            }
                           
                        } else {
                           
                            // check for customization for global excluded at schema level
                            if (exten.isRemoved()) {
                                vctx.addWarning("Name '" + name
                                    + "' is on excludes list for schema, but has a customization", custom);
                                exten.setRemoved(false);
                                extendGlobal(builder, wlkr, exten);
                            }
                           
                            // check if customization applies to descendant of global definition component
                            if (path.getPathLength() > 1) {
                                applyRemainingCustomizationPath(path, match, custom, vctx);
                            } else {
                                custom.apply((ComponentExtension)match.getExtension(), vctx);
                            }
                           
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.