Examples of addProp()


Examples of org.apache.avro.Schema.addProp()

        return super.createSchema(type, names);
      if (c.isArray()) {                                     // array
        Class component = c.getComponentType();
        if (component == Byte.TYPE) {                        // byte array
          Schema result = Schema.create(Schema.Type.BYTES);
          result.addProp(CLASS_PROP, c.getName());
          return result;
        }
        Schema result = Schema.createArray(createSchema(component, names));
        result.addProp(CLASS_PROP, c.getName());
        setElement(result, component);
View Full Code Here

Examples of org.apache.avro.Schema.addProp()

          Schema result = Schema.create(Schema.Type.BYTES);
          result.addProp(CLASS_PROP, c.getName());
          return result;
        }
        Schema result = Schema.createArray(createSchema(component, names));
        result.addProp(CLASS_PROP, c.getName());
        setElement(result, component);
        return result;
      }
      AvroSchema explicit = c.getAnnotation(AvroSchema.class);
      if (explicit != null)                                  // explicit schema
View Full Code Here

Examples of org.apache.avro.Schema.addProp()

        Union union = c.getAnnotation(Union.class);
        if (union != null) {                                 // union annotated
          return getAnnotatedUnion(union, names);
        } else if (isStringable(c)) {                        // Stringable
          Schema result = Schema.create(Schema.Type.STRING);
          result.addProp(CLASS_PROP, c.getName());
          return result;
        } else if (c.isEnum()) {                             // Enum
          List<String> symbols = new ArrayList<String>();
          Enum[] constants = (Enum[])c.getEnumConstants();
          for (int i = 0; i < constants.length; i++)
View Full Code Here

Examples of org.apache.avro.Schema.addProp()

     if ("namespace".equals(key)) {               // already handled: ignore
     } else if ("aliases".equals(key)) {          // aliases
       for (String alias : getTextProps("aliases", props, token))
         s.addAlias(alias);
     } else if (props.get(key).isTextual()) {     // ignore other non-textual
       s.addProp(key, getTextProp(key, props, token));
     }

   {if (true) return s;}
    throw new Error("Missing return statement in function");
  }
View Full Code Here

Examples of org.apache.avro.Schema.addProp()

      jj_consume_token(COMMA);
      VariableDeclarator(type, fields);
    }
    jj_consume_token(SEMICOLON);
    for (String key : props.keySet())
      type.addProp(key, getTextProp(key, props, token));
  }

  final public void VariableDeclarator(Schema type, List<Field> fields) throws ParseException {
  String name;
  JsonNode defaultValue = null;
View Full Code Here

Examples of org.apache.avro.Schema.addProp()

     if ("namespace".equals(key)) {               // already handled: ignore
     } else if ("aliases".equals(key)) {          // aliases
       for (String alias : getTextProps("aliases", props, token))
         s.addAlias(alias);
     } else if (props.get(key).isTextual()) {     // ignore other non-textual
       s.addProp(key, getTextProp(key, props, token));
     }

   {if (true) return s;}
    throw new Error("Missing return statement in function");
  }
View Full Code Here

Examples of org.apache.avro.Schema.addProp()

      jj_consume_token(COMMA);
      VariableDeclarator(type, fields);
    }
    jj_consume_token(SEMICOLON);
    for (String key : props.keySet())
      type.addProp(key, getTextProp(key, props, token));
  }

  final public void VariableDeclarator(Schema type, List<Field> fields) throws ParseException {
  String name;
  JsonNode defaultValue = null;
View Full Code Here

Examples of org.apache.avro.Schema.addProp()

    fields.add(new Field("field4", Schema.createMap(Schema.create(Type.INT)), null, null));

    Schema schema = Schema.createRecord("recordName", "Record Doc String", "recordNS", false);
    schema.setFields(fields);

    schema.addProp("Property1", "Value1");
    schema.addProp("Property2", "Value2");

    return(schema);
  }
View Full Code Here

Examples of org.apache.avro.Schema.addProp()

    Schema schema = Schema.createRecord("recordName", "Record Doc String", "recordNS", false);
    schema.setFields(fields);

    schema.addProp("Property1", "Value1");
    schema.addProp("Property2", "Value2");

    return(schema);
  }

  public static void writeSchema (File file, String json) throws IOException {
View Full Code Here

Examples of org.apache.avro.Schema.addProp()

    String avroNamespace = tableClassName.getPackageForTable();

    String doc = "Sqoop import of " + avroTableName;
    Schema schema = Schema.createRecord(avroName, doc, avroNamespace, false);
    schema.setFields(fields);
    schema.addProp("tableName", avroTableName);
    return schema;
  }

  /**
   * Will create union, because each type is assumed to be nullable.
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.