Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
daleiz committed Aug 22, 2024
1 parent 8f7d7fe commit 3ac02a1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sink-las/app/src/main/java/sink/LasSinkTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,11 @@ void putValue(GenericData.Record record, Schema schema, String field, Object val
record.put(field, floatValue);
break;
case DOUBLE:
record.put(field, value);
double doubleValue = (Double) value;
record.put(field, doubleValue);
break;
case STRING:
record.put(field, value.toString());
break;
case UNION:
// by default, a field in a LAS table is nullable, ant its schema is a union like [type, null].
Expand All @@ -139,6 +143,7 @@ void putValue(GenericData.Record record, Schema schema, String field, Object val
} else {
putValue(record, unionTypes.get(1), field, value);
}
break;
default:
throw new RuntimeException(String.format("Unsupported column type %s in a LAS table, we only allow string type and number types in a LAS table.", valueSchema.getType().toString()));

Expand Down

0 comments on commit 3ac02a1

Please sign in to comment.