Examples of numFields()


Examples of ca.uhn.hl7v2.model.Segment.numFields()

      throws HL7Exception {
    LOG.debug("Validating message against primitive type rules");
    for (Iterator<Structure> iter = ReadOnlyMessageIterator
        .createPopulatedSegmentIterator(message); iter.hasNext();) {
      Segment s = (Segment) iter.next();
      for (int field = 1; field <= s.numFields(); field++) {
        Type[] t = s.getField(field);
        for (int rep = 0; rep < t.length; rep++) {
          Location location = new Location();
          location.setSegmentName(s.getName());
          location.setField(field);
View Full Code Here

Examples of ca.uhn.hl7v2.model.Segment.numFields()

      throws HL7Exception {
    LOG.debug("Validating message against primitive type rules");
    for (Iterator<Structure> iter = ReadOnlyMessageIterator
        .createPopulatedSegmentIterator(message); iter.hasNext();) {
      Segment s = (Segment) iter.next();
      for (int field = 1; field <= s.numFields(); field++) {
        Type[] t = s.getField(field);
        for (int rep = 0; rep < t.length; rep++) {
          Location location = new Location();
          location
              .withSegmentName(s.getName())
View Full Code Here

Examples of com.netflix.zeno.fastblob.record.schema.FastBlobSchema.numFields()

        FastBlobSchema schema = rec.getSchema();
        ByteData fromSpace = rec.getByteData();

        long currentPointerPosition = rec.position();

        for(int i=0;i<schema.numFields();i++) {
            FieldDefinition fieldDef = schema.getFieldDefinition(i);
            int length = rec.getFieldLength(schema.getFieldName(i));

            TypedFieldDefinition typedFieldDef;
            int ordinal;
View Full Code Here

Examples of com.netflix.zeno.fastblob.record.schema.FastBlobSchema.numFields()

        schema.writeTo(new DataOutputStream(os));

        FastBlobSchema deserialized = FastBlobSchema.readFrom(new DataInputStream(new ByteArrayInputStream(os.toByteArray())));

        Assert.assertEquals(3, deserialized.numFields());
        Assert.assertEquals(FieldType.INT, deserialized.getFieldType("field1"));
        Assert.assertEquals(FieldType.OBJECT, deserialized.getFieldType("field2"));
        Assert.assertEquals(FieldType.FLOAT, deserialized.getFieldType("field3"));
    }
View Full Code Here

Examples of org.apache.pig.impl.logicalLayer.schema.TupleSchema.numFields()

        }
        TupleSchema schema = op.outputSchema();
       
        // first of all, we are required to guarantee that there is at least one output tuple
        if (outputConstraints.cardinality() == 0 && inputData.cardinality() == 0) {
            outputConstraints.add(new Tuple(schema.numFields()));   // add an output constraint for one tuple
        }
       
        // create example tuple to steal values from when we encounter "don't care" fields (i.e. null fields)
        Tuple exampleTuple;
        if (inputData.cardinality() > 0) {
View Full Code Here

Examples of org.apache.pig.impl.logicalLayer.schema.TupleSchema.numFields()

        if (inputData.cardinality() > 0) {
            // select first tuple from input data
            exampleTuple = inputData.iterator().next();
        } else {
            // input data is empty, so make up a tuple
            Tuple exampleT = new Tuple(schema.numFields());
            exampleTuple = new ExampleTuple();
            exampleTuple.copyFrom(exampleT);
            for (int i = 0; i < exampleTuple.arity(); i++) exampleTuple.setField(i, "0");
        }
       
View Full Code Here

Examples of org.apache.pig.impl.logicalLayer.schema.TupleSchema.numFields()

        // (while synthesizing individual fields, try to match fields that exist in the real data)
        for (Iterator<Tuple> it = outputConstraints.iterator(); it.hasNext(); ) {
            Tuple outputConstraint = it.next();
           
            // sanity check:
            if (outputConstraint.arity() != schema.numFields()) throw new RuntimeException("Internal error: incorrect number of fields in constraint tuple.");
           
            Tuple inputT = new Tuple(outputConstraint.arity());
            ExampleTuple inputTuple = new ExampleTuple();
            inputTuple.copyFrom(inputT);
            for (int i = 0; i < inputTuple.arity(); i++) {
View Full Code Here

Examples of org.apache.pig.impl.logicalLayer.schema.TupleSchema.numFields()

              LogicalOperator lo = opTable.get(opKey);
             
              if (lo != null && lo.outputSchema() != null &&
                  lo.outputSchema().numFields() > current) {
                  longest = lo.outputSchema();
                  current = longest.numFields();
                }
            }
            schema = longest.copy();
        }
View Full Code Here

Examples of org.apache.pig.impl.logicalLayer.schema.TupleSchema.numFields()

            if (a == null) mStream.print("$" + pos);
            else mStream.print(a);
        } else if (schema instanceof TupleSchema) {
            mStream.print("(");
            TupleSchema ts = (TupleSchema)schema;
            int sz = ts.numFields();
            for (int j = 0; j < sz; j++) {
                if (j != 0) mStream.print(", ");
                Schema s = ts.schemaFor(j);
                if (s == null) mStream.print("$" + j);
                else printSchema(s, j);
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.