private Schema.Field createAvroField(String name, TypeInfo typeInfo, String comment) { return new Schema.Field(name, createAvroSchema(typeInfo), comment, null); }
private Schema createAvroUnion(TypeInfo typeInfo) { List<Schema> childSchemas = new ArrayList<Schema>(); for (TypeInfo childTypeInfo : ((UnionTypeInfo) typeInfo).getAllUnionObjectTypeInfos()) { final Schema childSchema = createAvroSchema(childTypeInfo); if (childSchema.getType() == Schema.Type.UNION) { childSchemas.addAll(childSchema.getTypes()); } else { childSchemas.add(childSchema); } } return Schema.createUnion(removeDuplicateNullSchemas(childSchemas)); }
private Schema createAvroArray(TypeInfo typeInfo) { ListTypeInfo listTypeInfo = (ListTypeInfo) typeInfo; Schema listSchema = createAvroSchema(listTypeInfo.getListElementTypeInfo()); return Schema.createArray(listSchema); }
private Schema createAvroMap(TypeInfo typeInfo) { TypeInfo keyTypeInfo = ((MapTypeInfo) typeInfo).getMapKeyTypeInfo(); if (((PrimitiveTypeInfo) keyTypeInfo).getPrimitiveCategory() != PrimitiveObjectInspector.PrimitiveCategory.STRING) { throw new UnsupportedOperationException("Key of Map can only be a String"); } TypeInfo valueTypeInfo = ((MapTypeInfo) typeInfo).getMapValueTypeInfo(); Schema valueSchema = createAvroSchema(valueTypeInfo); return Schema.createMap(valueSchema); }
private Schema.Field createAvroField(String name, TypeInfo typeInfo, String comment) { return new Schema.Field(name, createAvroSchema(typeInfo), comment, null); }
private Schema.Field createAvroField(String name, TypeInfo typeInfo, String comment) { return new Schema.Field(name, createAvroSchema(typeInfo), comment, null); }
private Schema.Field createAvroField(String name, TypeInfo typeInfo, String comment) { return new Schema.Field(name, createAvroSchema(typeInfo), comment, null); }
private Schema.Field createAvroField(String name, TypeInfo typeInfo, String comment) { return new Schema.Field(name, createAvroSchema(typeInfo), comment, null); }
private Schema createAvroUnion(TypeInfo typeInfo) { List<Schema> childSchemas = new ArrayList<Schema>(); for (TypeInfo childTypeInfo : ((UnionTypeInfo) typeInfo).getAllUnionObjectTypeInfos()) { final Schema childSchema = createAvroSchema(childTypeInfo); if (childSchema.getType() == Schema.Type.UNION) { childSchemas.addAll(childSchema.getTypes()); } else { childSchemas.add(childSchema); } } return Schema.createUnion(removeDuplicateNullSchemas(childSchemas)); }
private Schema createAvroUnion(TypeInfo typeInfo) { List<Schema> childSchemas = new ArrayList<Schema>(); for (TypeInfo childTypeInfo : ((UnionTypeInfo) typeInfo).getAllUnionObjectTypeInfos()) { final Schema childSchema = createAvroSchema(childTypeInfo); if (childSchema.getType() == Schema.Type.UNION) { childSchemas.addAll(childSchema.getTypes()); } else { childSchemas.add(childSchema); } } return Schema.createUnion(removeDuplicateNullSchemas(childSchemas)); }
private Schema createAvroUnion(TypeInfo typeInfo) { List<Schema> childSchemas = new ArrayList<Schema>(); for (TypeInfo childTypeInfo : ((UnionTypeInfo) typeInfo).getAllUnionObjectTypeInfos()) { final Schema childSchema = createAvroSchema(childTypeInfo); if (childSchema.getType() == Schema.Type.UNION) { childSchemas.addAll(childSchema.getTypes()); } else { childSchemas.add(childSchema); } } return Schema.createUnion(removeDuplicateNullSchemas(childSchemas)); }
private Schema createAvroUnion(TypeInfo typeInfo) { List<Schema> childSchemas = new ArrayList<Schema>(); for (TypeInfo childTypeInfo : ((UnionTypeInfo) typeInfo).getAllUnionObjectTypeInfos()) { final Schema childSchema = createAvroSchema(childTypeInfo); if (childSchema.getType() == Schema.Type.UNION) { childSchemas.addAll(childSchema.getTypes()); } else { childSchemas.add(childSchema); } } return Schema.createUnion(removeDuplicateNullSchemas(childSchemas)); }
private Schema createAvroArray(TypeInfo typeInfo) { ListTypeInfo listTypeInfo = (ListTypeInfo) typeInfo; Schema listSchema = createAvroSchema(listTypeInfo.getListElementTypeInfo()); return Schema.createArray(listSchema); }
private Schema createAvroArray(TypeInfo typeInfo) { ListTypeInfo listTypeInfo = (ListTypeInfo) typeInfo; Schema listSchema = createAvroSchema(listTypeInfo.getListElementTypeInfo()); return Schema.createArray(listSchema); }
private Schema createAvroArray(TypeInfo typeInfo) { ListTypeInfo listTypeInfo = (ListTypeInfo) typeInfo; Schema listSchema = createAvroSchema(listTypeInfo.getListElementTypeInfo()); return Schema.createArray(listSchema); }
private Schema createAvroArray(TypeInfo typeInfo) { ListTypeInfo listTypeInfo = (ListTypeInfo) typeInfo; Schema listSchema = createAvroSchema(listTypeInfo.getListElementTypeInfo()); return Schema.createArray(listSchema); }
private Schema createAvroMap(TypeInfo typeInfo) { TypeInfo keyTypeInfo = ((MapTypeInfo) typeInfo).getMapKeyTypeInfo(); if (((PrimitiveTypeInfo) keyTypeInfo).getPrimitiveCategory() != PrimitiveObjectInspector.PrimitiveCategory.STRING) { throw new UnsupportedOperationException("Key of Map can only be a String"); } TypeInfo valueTypeInfo = ((MapTypeInfo) typeInfo).getMapValueTypeInfo(); Schema valueSchema = createAvroSchema(valueTypeInfo); return Schema.createMap(valueSchema); }
private Schema createAvroMap(TypeInfo typeInfo) { TypeInfo keyTypeInfo = ((MapTypeInfo) typeInfo).getMapKeyTypeInfo(); if (((PrimitiveTypeInfo) keyTypeInfo).getPrimitiveCategory() != PrimitiveObjectInspector.PrimitiveCategory.STRING) { throw new UnsupportedOperationException("Key of Map can only be a String"); } TypeInfo valueTypeInfo = ((MapTypeInfo) typeInfo).getMapValueTypeInfo(); Schema valueSchema = createAvroSchema(valueTypeInfo); return Schema.createMap(valueSchema); }
private Schema createAvroMap(TypeInfo typeInfo) { TypeInfo keyTypeInfo = ((MapTypeInfo) typeInfo).getMapKeyTypeInfo(); if (((PrimitiveTypeInfo) keyTypeInfo).getPrimitiveCategory() != PrimitiveObjectInspector.PrimitiveCategory.STRING) { throw new UnsupportedOperationException("Key of Map can only be a String"); } TypeInfo valueTypeInfo = ((MapTypeInfo) typeInfo).getMapValueTypeInfo(); Schema valueSchema = createAvroSchema(valueTypeInfo); return Schema.createMap(valueSchema); }
private Schema createAvroMap(TypeInfo typeInfo) { TypeInfo keyTypeInfo = ((MapTypeInfo) typeInfo).getMapKeyTypeInfo(); if (((PrimitiveTypeInfo) keyTypeInfo).getPrimitiveCategory() != PrimitiveObjectInspector.PrimitiveCategory.STRING) { throw new UnsupportedOperationException("Key of Map can only be a String"); } TypeInfo valueTypeInfo = ((MapTypeInfo) typeInfo).getMapValueTypeInfo(); Schema valueSchema = createAvroSchema(valueTypeInfo); return Schema.createMap(valueSchema); }