ferenc-csaky commented on code in PR #38:
URL:
https://github.com/apache/flink-connector-http/pull/38#discussion_r3091191626
##########
flink-connector-http/src/main/java/org/apache/flink/connector/http/table/lookup/querycreators/GenericJsonAndUrlQueryCreator.java:
##########
@@ -132,9 +134,15 @@ public LookupQueryInfo createLookupQuery(final RowData
lookupDataRow) {
}
// Parameters are encoded as query params for GET and none GET.
// Later code will turn these query params into the body for PUTs and
POSTs
+ // Use the map to rename columns to query param keys
ObjectNode jsonObjectForQueryParams =
ObjectMapperAdapter.instance().createObjectNode();
- for (String requestColumnName : this.requestQueryParamsFields) {
- jsonObjectForQueryParams.set(requestColumnName,
jsonObject.get(requestColumnName));
+ for (Map.Entry<String, String> entry :
this.requestQueryParamsMap.entrySet()) {
+ String columnName = entry.getKey();
+ String queryParamKey = entry.getValue();
+ JsonNode value = jsonObject.get(columnName);
+ if (value != null) {
+ jsonObjectForQueryParams.set(queryParamKey, value);
+ }
Review Comment:
+1 for this addition. If this gets covered, the rest LGTM.
--
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]