Skip to content

Commit

Permalink
[FLINK-26945][table] fix review.
Browse files Browse the repository at this point in the history
  • Loading branch information
liuyongvs committed Mar 17, 2023
1 parent 78afbc7 commit 03b76d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
Expand Up @@ -261,18 +261,6 @@ Stream<TestSetSpec> getTestSetSpecs() {
DataTypes.ROW(
DataTypes.BOOLEAN(), DataTypes.DATE()))
.nullable())
.testResult(
$("f3").arrayRemove(row(false, LocalDate.of(1990, 10, 14))),
"ARRAY_REMOVE(f3, (FALSE, DATE '1990-10-14'))",
new Row[] {
Row.of(true, LocalDate.of(2022, 4, 20)),
Row.of(true, LocalDate.of(1990, 10, 14)),
null
},
DataTypes.ARRAY(
DataTypes.ROW(
DataTypes.BOOLEAN(), DataTypes.DATE()))
.nullable())
.testResult(
$("f3").arrayRemove(null),
"ARRAY_REMOVE(f3, null)",
Expand Down
Expand Up @@ -74,13 +74,13 @@ public void open(FunctionContext context) throws Exception {
final int size = haystack.size();
for (int pos = 0; pos < size; pos++) {
final Object element = elementGetter.getElementOrNull(haystack, pos);
if ((element == null && needle != null)
|| (element != null && needle == null)
if ((element == null && needle == null)
|| (element != null
&& needle != null
&& !(boolean) equalityHandle.invoke(element, needle))) {
list.add(element);
&& (boolean) equalityHandle.invoke(element, needle))) {
continue;
}
list.add(element);
}
return new GenericArrayData(list.toArray());
} catch (Throwable t) {
Expand Down

0 comments on commit 03b76d2

Please sign in to comment.