Skip to content

Commit c9e6692

Browse files
Added "union" to accepted types in the avro schema (GoogleCloudPlatform#5561)
I opened an issue on this topic GoogleCloudPlatform#5560 and finally found the solution myself. I wanted to share this because it allows the user to read avro files with nulls in them. This change worked for me and the pipeline returns the intended csv.
1 parent a2fc62c commit c9e6692

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dataflow/transforms/src/main/java/com/example/AvroToCsv.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class AvroToCsv {
3838

3939
private static final Logger LOG = LoggerFactory.getLogger(AvroToCsv.class);
4040
private static final List<String> acceptedTypes = Arrays.asList(
41-
new String[]{"string", "boolean", "int", "long", "float", "double"});
41+
new String[]{"string", "boolean", "int", "long", "float", "double", "union"});
4242

4343
private static String getSchema(String schemaPath) throws IOException {
4444
ReadableByteChannel channel = FileSystems.open(FileSystems.matchNewResource(

0 commit comments

Comments
 (0)