wenlong88 commented on a change in pull request #17754:
URL: https://github.com/apache/flink/pull/17754#discussion_r748950093
##########
File path:
flink-connectors/flink-connector-jdbc/src/test/java/org/apache/flink/connector/jdbc/table/JdbcDynamicTableFactoryTest.java
##########
@@ -174,6 +175,7 @@ public void testJdbcLookupProperties() {
.setCacheMaxSize(1000)
.setCacheExpireMs(10_000)
.setMaxRetryTimes(10)
+ .setExcludeEmptyQueryResult(true)
Review comment:
you need to a new case instead of override the default value
##########
File path:
flink-connectors/flink-connector-jdbc/src/main/java/org/apache/flink/connector/jdbc/table/JdbcRowDataLookupFunction.java
##########
@@ -146,10 +148,12 @@ public void eval(Object... keys) {
if (cache != null) {
List<RowData> cachedRows = cache.getIfPresent(keyRow);
if (cachedRows != null) {
- for (RowData cachedRow : cachedRows) {
- collect(cachedRow);
+ if (!cachedRows.isEmpty() || !excludeEmptyQueryResult) {
+ for (RowData cachedRow : cachedRows) {
Review comment:
i am afraid that you should not just ignore the empty values, instead
you should remove the keyRow from the cache if exlucdeEmptyQueryResult is true,
and collect is still needed.
--
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]