wattache commented on code in PR #29715:
URL: https://github.com/apache/beam/pull/29715#discussion_r1488260740


##########
sdks/java/io/clickhouse/src/main/java/org/apache/beam/sdk/io/clickhouse/TableSchema.java:
##########
@@ -111,6 +112,14 @@ public static Schema.FieldType 
getEquivalentFieldType(ColumnType columnType) {
         return Schema.FieldType.STRING;
       case BOOL:
         return Schema.FieldType.BOOLEAN;
+      case TUPLE:
+        List<Schema.Field> fields =
+            columnType.tupleTypes().entrySet().stream()
+                .map(x -> Schema.Field.of(x.getKey(), 
Schema.FieldType.DATETIME))

Review Comment:
   Hi, 
   
   This quick adaptation seems to work: 
   ```
   case TUPLE:
        List<TableSchema.Column> columns = 
columnType.tupleTypes().entrySet().stream().map(
                                 x -> TableSchema.Column.of(x.getKey(), 
x.getValue())
                            ).collect(Collectors.toList());
        TableSchema tupleSchema = TableSchema.of(columns.toArray(new 
TableSchema.Column[0]));
        Schema tupleAsRowSchema = getEquivalentSchema(tupleSchema);
        return Schema.FieldType.row(tupleAsRowSchema);
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to