Java Code Examples for org.apache.avro.SchemaNormalization#parsingFingerprint64()

The following examples show how to use org.apache.avro.SchemaNormalization#parsingFingerprint64() . 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: SchemaIdGenerator.java    From component-runtime with Apache License 2.0 5 votes vote down vote up
private static long fingerprint(final List<Schema.Field> fields) {
    return SchemaNormalization
            .parsingFingerprint64(Schema
                    .createRecord(fields
                            .stream()
                            .map(it -> new Schema.Field(it.name(), it.schema(), it.doc(), it.defaultVal(),
                                    it.order()))
                            .collect(toList())));
}
 
Example 2
Source File: IcebergDecoder.java    From iceberg with Apache License 2.0 4 votes vote down vote up
private void addSchema(org.apache.avro.Schema writeSchema) {
  long fp = SchemaNormalization.parsingFingerprint64(writeSchema);
  decoders.put(fp, new RawDecoder<>(readSchema, writeSchema));
}
 
Example 3
Source File: IcebergDecoder.java    From iceberg with Apache License 2.0 4 votes vote down vote up
private void addSchema(org.apache.avro.Schema writeSchema) {
  long fp = SchemaNormalization.parsingFingerprint64(writeSchema);
  decoders.put(fp, new RawDecoder<>(readSchema, writeSchema));
}