davidradl commented on code in PR #2:
URL:
https://github.com/apache/flink-connector-http/pull/2#discussion_r2448438775
##########
flink-connector-http/src/main/java/org/apache/flink/connector/http/table/lookup/HttpLookupTableSource.java:
##########
@@ -125,11 +149,30 @@ public LookupRuntimeProvider
getLookupRuntimeProvider(LookupContext lookupContex
protected LookupRuntimeProvider getLookupRuntimeProvider(
LookupRow lookupRow,
DeserializationSchema<RowData> responseSchemaDecoder,
- PollingClientFactory<RowData> pollingClientFactory) {
-
+ PollingClientFactory pollingClientFactory) {
+ MetadataConverter[] metadataConverters = {};
+ if (this.metadataKeys != null) {
+ metadataConverters =
+ this.metadataKeys.stream()
+ .map(
+ k ->
+ Stream.of(
+
HttpLookupTableSource.ReadableMetadata
+ .values())
+ .filter(rm ->
rm.key.equals(k))
+ .findFirst()
+
.orElseThrow(IllegalStateException::new))
+ .map(m -> m.converter)
+ .toArray(MetadataConverter[]::new);
+ }
Review Comment:
I have split it up so it is easier to read.
--
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]