Skip to content

Commit

Permalink
[Feature][transform-v2] jsonpath support map array type
Browse files Browse the repository at this point in the history
  • Loading branch information
nijiahui committed Jan 23, 2025
1 parent e9c6285 commit 3e077f7
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.apache.seatunnel.api.table.type.SeaTunnelDataType;
import org.apache.seatunnel.api.table.type.SeaTunnelRow;
import org.apache.seatunnel.api.table.type.SeaTunnelRowType;
import org.apache.seatunnel.api.table.type.SqlType;
import org.apache.seatunnel.translation.serialization.RowConverter;
import org.apache.seatunnel.translation.spark.utils.OffsetDateTimeUtils;

Expand Down Expand Up @@ -170,6 +171,13 @@ private WrappedArray.ofRef<?> convertArray(Object[] arrayData, ArrayType<?, ?> a
return new WrappedArray.ofRef<>(new Object[0]);
}
int num = arrayData.length;
if (SqlType.MAP.equals(arrayType.getElementType().getSqlType())) {
Object[] arrayMapData = new Object[num];
for (int i = 0; i < num; i++) {
arrayMapData[i] = convert(arrayData[i], arrayType.getElementType());
}
return new WrappedArray.ofRef<>(arrayMapData);
}
for (int i = 0; i < num; i++) {
arrayData[i] = convert(arrayData[i], arrayType.getElementType());
}
Expand Down

0 comments on commit 3e077f7

Please sign in to comment.