public static <K, V> void validateFormat(Map<K, V> offsetData) { // Both keys and values for offsets may be null. For values, this is a useful way to delete offsets or indicate // that there's not usable concept of offsets in your source system. if (offsetData == null) return; for (Map.Entry<K, V> entry : offsetData.entrySet()) { if (!(entry.getKey() instanceof String)) throw new DataException("Offsets may only use String keys"); Object value = entry.getValue(); if (value == null) continue; Schema.Type schemaType = ConnectSchema.schemaType(value.getClass()); if (schemaType == null) throw new DataException("Offsets may only contain primitive types as values, but field " + entry.getKey() + " contains " + value.getClass()); if (!schemaType.isPrimitive()) throw new DataException("Offsets may only contain primitive types as values, but field " + entry.getKey() + " contains " + schemaType); } } }
Schema.Type inferredType = ConnectSchema.schemaType(value.getClass()); if (inferredType == null) { throw new DataException("Flatten transformation was passed a value of type " + value.getClass()
if (value == null) return null; Schema.Type inferredType = schema == null ? ConnectSchema.schemaType(value.getClass()) : schema.type(); if (inferredType == null) {
final Schema.Type schemaType; if (schema == null) { schemaType = ConnectSchema.schemaType(value.getClass()); if (schemaType == null) throw new DataException("Java class " + value.getClass() + " does not have corresponding schema type.");
schemaType = ConnectSchema.schemaType(value.getClass()); if (schemaType == null) throw new DataException("Java class " + value.getClass() + " does not have corresponding schema type.");