davidradl commented on code in PR #2:
URL:
https://github.com/apache/flink-connector-http/pull/2#discussion_r2448439542
##########
flink-connector-http/src/main/java/org/apache/flink/connector/http/table/lookup/JavaNetHttpPollingClient.java:
##########
@@ -199,10 +248,43 @@ private Collection<RowData> processHttpResponse(
response.statusCode(),
responseBody);
- if (StringUtils.isNullOrWhitespaceOnly(responseBody) ||
ignoreResponse(response)) {
- return Collections.emptyList();
+ if (!isError
+ && (StringUtils.isNullOrWhitespaceOnly(responseBody) ||
ignoreResponse(response))) {
Review Comment:
done
##########
flink-connector-http/src/main/java/org/apache/flink/connector/http/table/lookup/HttpTableLookupFunction.java:
##########
@@ -83,6 +95,55 @@ public void open(FunctionContext context) throws Exception {
@Override
public Collection<RowData> lookup(RowData keyRow) {
localHttpCallCounter.incrementAndGet();
- return client.pull(keyRow);
+ List<RowData> outputList = new ArrayList<>();
+ final int metadataArity = metadataConverters.length;
+
+ HttpRowDataWrapper httpRowDataWrapper = client.pull(keyRow);
+ Collection<RowData> httpCollector = httpRowDataWrapper.getData();
+
+ int physicalArity = -1;
+
+ GenericRowData producedRow = null;
+ if (httpRowDataWrapper.shouldIgnore()) {
+ return Collections.emptyList();
+ }
+ // grab the actual data if there is any from the response and populate
the producedRow with
+ // it
+ if (!httpCollector.isEmpty()) {
+ // TODO original code increments again if empty - removing
+ // if (httpCollector.isEmpty()) {
+ // localHttpCallCounter.incrementAndGet();
+ // } else {
Review Comment:
removed
--
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]