Examples of FieldSchema


Examples of com.atlassian.jira.rest.client.api.domain.FieldSchema

  }

  private CimFieldInfo parseIssueFieldInfo(JSONObject json, String id) throws JSONException {
    final boolean required = json.getBoolean("required");
    final String name = JsonParseUtil.getOptionalString(json, "name");
    final FieldSchema schema = fieldSchemaJsonParser.parse(json.getJSONObject("schema"));
    final Set<StandardOperation> operations = parseOperations(json.getJSONArray("operations"));
    final Iterable<Object> allowedValues = parseAllowedValues(json.optJSONArray("allowedValues"), schema);
    final URI autoCompleteUri = JsonParseUtil.parseOptionalURI(json, "autoCompleteUrl");

    return new CimFieldInfo(id, required, name, schema, operations, allowedValues, autoCompleteUri);
View Full Code Here

Examples of org.apache.hadoop.hive.metastore.api.FieldSchema

        if (nm[1] != null) { // non-null column alias
          colInfo.setAlias(nm[1]);
        }

        if (field_schemas != null) {
          FieldSchema col = new FieldSchema();
          if (nm[1] != null) {
            col.setName(unescapeIdentifier(colInfo.getAlias()).toLowerCase()); // remove ``
          } else {
            col.setName(colInfo.getInternalName());
          }
          col.setType(colInfo.getType().getTypeName());
          field_schemas.add(col);
        }

        if (!first) {
          cols = cols.concat(",");
View Full Code Here

Examples of org.apache.pig.impl.logicalLayer.schema.Schema.FieldSchema

        Schema expectedSch =
            Schema.generateNestedSchema(DataType.BAG, DataType.INTEGER);

        //check schema of TOBAG when given input tuple having only integers
        Schema inputSch = new Schema();
        inputSch.add(new FieldSchema(null, DataType.INTEGER));
        assertEquals("schema of tobag when input has only ints",
                expectedSch, tb.outputSchema(inputSch));

        //add another int column
        inputSch.add(new FieldSchema(null, DataType.INTEGER));
        assertEquals("schema of tobag when input has only ints",
                expectedSch, tb.outputSchema(inputSch));

        //add a long column
        inputSch.add(new FieldSchema(null, DataType.LONG));
        //expect null inner schema
        expectedSch =
            Schema.generateNestedSchema(DataType.BAG, DataType.NULL);
        assertEquals("schema of tobag when input has ints and long",
                expectedSch, tb.outputSchema(inputSch));

       
        //test schema when input is a tuple with inner schema
        Schema tupInSchema = new Schema(new FieldSchema("x", DataType.CHARARRAY));
        inputSch = new Schema();
        inputSch.add(new FieldSchema("a", tupInSchema, DataType.TUPLE));
        Schema inputSchCp = new Schema(inputSch);
        inputSchCp.getField(0).alias = null;
        expectedSch = new Schema(new FieldSchema(null, inputSchCp, DataType.BAG));
        assertEquals("schema of tobag when input has cols of type tuple ",
                expectedSch, tb.outputSchema(inputSch));
       
        inputSch.add(new FieldSchema("b", tupInSchema, DataType.TUPLE));
        assertEquals("schema of tobag when input has cols of type tuple ",
                expectedSch, tb.outputSchema(inputSch));
       
        //add a column of type tuple with different inner schema
        tupInSchema = new Schema(new FieldSchema("x", DataType.BYTEARRAY));
        inputSch.add(new FieldSchema("c", tupInSchema, DataType.TUPLE));
        //expect null inner schema
        expectedSch =
            Schema.generateNestedSchema(DataType.BAG, DataType.NULL);
        assertEquals("schema of tobag when input has cols of type tuple with diff inner schema",
                expectedSch, tb.outputSchema(inputSch));
View Full Code Here

Examples of org.apache.pig.impl.logicalLayer.schema.Schema.FieldSchema

        tschema.getColumn(col);
      if (columnSchema != null) {
        ColumnType ct = columnSchema.getType();
        if (ct == org.apache.hadoop.zebra.schema.ColumnType.RECORD ||
            ct == org.apache.hadoop.zebra.schema.ColumnType.COLLECTION)
          ret.add(new FieldSchema(col, toPigSchema(columnSchema.getSchema()), ct.pigDataType()));
        else
          ret.add(new FieldSchema(col, ct.pigDataType()));
      } else {
        ret.add(new FieldSchema(null, null));
      }
    }
    return ret;
  }
View Full Code Here

Examples of org.apache.pig.impl.logicalLayer.schema.Schema.FieldSchema

            description = "autogenerated from Pig Field Schema";
            Schema inner = fieldSchema.schema;
            if (type == DataType.BAG && fieldSchema.schema != null
                    && !fieldSchema.schema.isTwoLevelAccessRequired()) {
                log.info("Insert two-level access to Resource Schema");
                FieldSchema fs = new FieldSchema("t", fieldSchema.schema);
                inner = new Schema(fs);               
            }
           
            // allow partial schema
            if ((type == DataType.BAG || type == DataType.TUPLE)
View Full Code Here

Examples of org.apache.pig.impl.logicalLayer.schema.Schema.FieldSchema

                    int pos = (Integer)((LOConst)getArguments().get(0)).getValue();
                    LogicalOperator inp = implicitReferencedOperator;
                    if(inp.getSchema() != null){
                        // input logical operator has schema, copy and link
                        //to corresponding FieldSchema
                        FieldSchema inpFs = inp.getSchema().getField(pos);
                        mFieldSchema = Schema.FieldSchema.copyAndLink(inpFs, inp);
                    }else{
                        // no schema for input logicaloperator, use bytearray
                        // and set it as parent
                        mFieldSchema = new FieldSchema(null, DataType.BYTEARRAY);
                        mFieldSchema.setParent(null, inp);
                    }
                    mIsFieldSchemaComputed = true;
                    return mFieldSchema;
                }else{
View Full Code Here

Examples of org.apache.pig.impl.logicalLayer.schema.Schema.FieldSchema

  List<FieldSchema> fieldSchemaList = new ArrayList<FieldSchema>(
    cols.size());

  for (int i = 0; i < cols.size(); i++) {
      fieldSchemaList.add(new FieldSchema(cols.get(i), HiveRCSchemaUtil
        .findPigDataType(types.get(i))));
  }

  pigSchema = new ResourceSchema(new Schema(fieldSchemaList));
View Full Code Here

Examples of org.apache.pig.impl.logicalLayer.schema.Schema.FieldSchema

    int index = fields.length;

    for (String key : keys) {
        newFields[index++] = new ResourceFieldSchema(
          new FieldSchema(key, DataType.CHARARRAY));
    }

    pigSchema.setFields(newFields);

    LOG.debug("Added partition fields: " + keys
View Full Code Here

Examples of org.apache.pig.impl.logicalLayer.schema.Schema.FieldSchema

                    Schema cSchema = op.getSchema();
                    if(cSchema!=null){
                       
                        for (FieldSchema schema : cSchema.getFields()) {
                            ++i;
                            FieldSchema newFS = null;
                            if(schema.alias != null) {
                                if(nonDuplicates.containsKey(schema.alias)) {
                                    if (nonDuplicates.get(schema.alias) != -1) {
                                        nonDuplicates.remove(schema.alias);
                                        nonDuplicates.put(schema.alias, -1);
                                    }
                                } else {
                                    nonDuplicates.put(schema.alias, i);
                                }
                                newFS = new FieldSchema(op.getAlias()+"::"+schema.alias,schema.schema,schema.type);
                            } else {
                                newFS = new Schema.FieldSchema(null, schema.type);
                            }
                            newFS.setParent(schema.canonicalName, op);
                            fss.add(newFS);
                            mSchemaInputMapping.add(op);
                        }
                    } else {
                        seeUnknown = true;
                    }
                } catch (FrontendException ioe) {
                    mIsSchemaComputed = false;
                    mSchema = null;
                    throw ioe;
                }
            }
            mIsSchemaComputed = true;
            mSchema = null;
            if (!seeUnknown)
            {
                mSchema = new Schema(fss);
                for (Entry<String, Integer> ent : nonDuplicates.entrySet()) {
                    int ind = ent.getValue();
                    if(ind==-1) continue;
                    FieldSchema prevSch = fss.get(ind);
                    // this is a non duplicate and hence can be referred to
                    // with just the field schema alias or outeralias::field schema alias
                    // In mSchema we have outeralias::fieldschemaalias. To allow
                    // using just the field schema alias, add it to mSchemas
                    // as an alias for this field.
View Full Code Here

Examples of org.apache.pig.impl.logicalLayer.schema.Schema.FieldSchema

     * @throws VisitorException
     */
    private boolean byteArrayFound(Schema s) throws VisitorException {
        for(int i=0;i<s.size();i++){
            try {
                FieldSchema fs=s.getField(i);
                if(fs.type==DataType.BYTEARRAY){
                    return true;
                }
            } catch (FrontendException fee) {
                int errCode = 1043;
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.