(
Field<?> field,
Function<? super UDTDataType<?>, ? extends Field<?>> arrayOfUDT,
Supplier<? extends Field<?>> arrayOfFormatted,
Supplier<? extends Field<?>> arrayOfUnformatted,
BiFunction<? super UDTDataType<?>, ? super UDTPathField<?, ?, ?>, ? extends Field<?>> udt
)
| 683 | } |
| 684 | |
| 685 | private static final Field<?> transformNestedTypes( |
| 686 | Field<?> field, |
| 687 | Function<? super UDTDataType<?>, ? extends Field<?>> arrayOfUDT, |
| 688 | Supplier<? extends Field<?>> arrayOfFormatted, |
| 689 | Supplier<? extends Field<?>> arrayOfUnformatted, |
| 690 | BiFunction<? super UDTDataType<?>, ? super UDTPathField<?, ?, ?>, ? extends Field<?>> udt |
| 691 | ) { |
| 692 | DataType<?> t = field.getDataType(); |
| 693 | |
| 694 | if (t.isArray()) { |
| 695 | DataType<?> ct = t.getArrayComponentDataType(); |
| 696 | |
| 697 | // [#19067] This currently applies to arrays of UDTs only. Let's not complicate things for ordinary arrays. |
| 698 | if (ConvertedDataType.delegate(ct) instanceof UDTDataType<?> ut) |
| 699 | return arrayOfUDT.apply(ut); |
| 700 | else if (ct.getBinding().formatter() != null) |
| 701 | return arrayOfFormatted.get(); |
| 702 | else |
| 703 | return arrayOfUnformatted.get(); |
| 704 | } |
| 705 | else if (ConvertedDataType.delegate(t) instanceof UDTDataType<?> ut) { |
| 706 | UDTPathField<?, ?, ?> up; |
| 707 | |
| 708 | if (field instanceof UDTPathField<?, ?, ?> u) |
| 709 | up = u; |
| 710 | else if (field instanceof TableField<?, ?> tf) |
| 711 | up = new UDTPathFieldImpl<>(field.getUnqualifiedName(), t, tf.getTable(), ut.udt, null); |
| 712 | else |
| 713 | up = null; |
| 714 | |
| 715 | if (up != null) |
| 716 | return udt.apply(ut, up); |
| 717 | } |
| 718 | |
| 719 | return field; |
| 720 | } |
| 721 | |
| 722 | private static final JSONArrayAggOrderByStep<?> jsonxArrayAgg(Context<?> ctx, Field<?> field) { |
| 723 | switch (emulateMultiset(ctx.configuration())) { |
no test coverage detected