@Nullable @Override public <T> SerializableFunction<Row, T> fromRowFunction(TypeDescriptor<T> typeDescriptor) { SchemaProvider schemaProvider = providers.get(typeDescriptor); return (schemaProvider != null) ? schemaProvider.fromRowFunction(typeDescriptor) : null; } }
/** * Given a type, returns a function that converts from a {@link Row} object to that type. If no * schema exists, returns null. */ @Override public <T> SerializableFunction<Row, T> fromRowFunction(TypeDescriptor<T> typeDescriptor) { SchemaProvider schemaProvider = getSchemaProvider(typeDescriptor); return (schemaProvider != null) ? schemaProvider.fromRowFunction(typeDescriptor) : null; } }
/** Retrieve the function that converts a {@link Row} object to the specified type. */ public <T> SerializableFunction<Row, T> getFromRowFunction(TypeDescriptor<T> typeDescriptor) throws NoSuchSchemaException { SchemaEntry entry = entries.get(typeDescriptor); if (entry != null) { return entry.fromRow; } return getProviderResult((SchemaProvider p) -> p.fromRowFunction(typeDescriptor)); }