liuyongvs commented on a change in pull request #12851:
URL: https://github.com/apache/flink/pull/12851#discussion_r452594080
##########
File path:
flink-table/flink-table-planner-blink/src/test/java/org/apache/flink/table/planner/factories/TestValuesTableFactory.java
##########
@@ -460,34 +620,38 @@ public DynamicTableSource copy() {
isAsync,
lookupFunctionClass,
nestedProjectionSupported,
- projectedFields);
+ projectedFields,
+ filterPredicates,
+ filterableFields);
}
@Override
public String asSummaryString() {
return "TestValues";
}
- private static Collection<RowData> convertToRowData(
- Collection<Row> data,
- int[] projectedFields,
- DataStructureConverter converter) {
+ private Collection<RowData> convertToRowData(
+ Collection<Row> data,
+ int[] projectedFields,
+ DataStructureConverter converter) {
List<RowData> result = new ArrayList<>();
for (Row value : data) {
- Row projectedRow;
- if (projectedFields == null) {
- projectedRow = value;
- } else {
- Object[] newValues = new
Object[projectedFields.length];
- for (int i = 0; i <
projectedFields.length; ++i) {
- newValues[i] =
value.getField(projectedFields[i]);
+ if (applyPredicatesToRow(value)) {
Review comment:
thanks . i will change the function name to
isRetainedAfterApplyingFilterPredicates make it more readable
##########
File path:
flink-table/flink-table-planner-blink/src/test/java/org/apache/flink/table/planner/factories/TestValuesTableFactory.java
##########
@@ -333,28 +364,34 @@ private ChangelogMode parseChangelogMode(String string) {
/**
* Values {@link DynamicTableSource} for testing.
*/
- private static class TestValuesTableSource implements ScanTableSource,
LookupTableSource, SupportsProjectionPushDown {
+ private static class TestValuesTableSource implements ScanTableSource,
LookupTableSource, SupportsProjectionPushDown, SupportsFilterPushDown {
private TableSchema physicalSchema;
private final ChangelogMode changelogMode;
private final boolean bounded;
private final String runtimeSource;
private final Collection<Row> data;
private final boolean isAsync;
- private final @Nullable String lookupFunctionClass;
+ private final @Nullable
+ String lookupFunctionClass;
private final boolean nestedProjectionSupported;
- private @Nullable int[] projectedFields;
+ private @Nullable
+ int[] projectedFields;
+ private List<ResolvedExpression> filterPredicates;
+ private Set<String> filterableFields;
Review comment:
ok
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]