Java Code Examples for org.apache.avro.Schema.Field#order()
The following examples show how to use
org.apache.avro.Schema.Field#order() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MarketoUtils.java From components with Apache License 2.0 | 5 votes |
public static Field generateNewField(Field origin) { Schema.Field field = new Schema.Field(origin.name(), origin.schema(), origin.doc(), origin.defaultVal(), origin.order()); field.getObjectProps().putAll(origin.getObjectProps()); for (Map.Entry<String, Object> entry : origin.getObjectProps().entrySet()) { field.addProp(entry.getKey(), entry.getValue()); } return field; }
Example 2
Source File: TMarketoInputProperties.java From components with Apache License 2.0 | 5 votes |
private Field getMigratedField(Field origin, Schema expectedSchema, String expectedDIType) { Field expectedField = new Schema.Field(origin.name(), expectedSchema, origin.doc(), origin.defaultVal(), origin.order()); for (Map.Entry<String, Object> entry : origin.getObjectProps().entrySet()) { if ("di.column.talendType".equals(entry.getKey())) { expectedField.addProp("di.column.talendType", expectedDIType); } else { expectedField.addProp(entry.getKey(), entry.getValue()); } } return expectedField; }
Example 3
Source File: EnvelopePayloadConverter.java From incubator-gobblin with Apache License 2.0 | 5 votes |
/** * Convert to the output schema of a field */ protected Field convertFieldSchema(Schema inputSchema, Field field, WorkUnitState workUnit) throws SchemaConversionException { if (field.name().equals(payloadField)) { // Create a payload field with latest schema return createLatestPayloadField(field); } // Make a copy of the field to the output schema return new Field(field.name(), field.schema(), field.doc(), field.defaultValue(), field.order()); }
Example 4
Source File: EnvelopePayloadConverter.java From incubator-gobblin with Apache License 2.0 | 5 votes |
/** * Create a payload field with its latest schema fetched from {@link #registry} * * @param field the original payload field from input envelope schema * @return a new payload field with its latest schema */ private Field createLatestPayloadField(Field field) throws SchemaConversionException { try { Schema payloadSchema = fetchLatestPayloadSchema(); return new Field(field.name(), payloadSchema, DECORATED_PAYLOAD_DOC, field.defaultValue(), field.order()); } catch (Exception e) { throw new SchemaConversionException(e); } }