davidradl commented on code in PR #2:
URL:
https://github.com/apache/flink-connector-http/pull/2#discussion_r2445509220
##########
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 agree the indentation is wild, I copied this from the [Kafka connector
](https://github.com/apache/flink-connector-kafka/blob/cb5c5c07318ba602c6c63cb116774a12c52fc478/flink-connector-kafka/src/main/java/org/apache/flink/streaming/connectors/kafka/table/KafkaDynamicSource.java#L524)
.
For consistency I am tempted to leave it, but it you feel strongly I can
look to split it down. Let me know what you think @ferenc-csaky
--
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]