This is an automated email from the ASF dual-hosted git repository.

wyk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/asterixdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 2e96b66091 [ASTERIXDB-3266][COMP] Avoid pushing down the inner SELECT 
for EVERY
2e96b66091 is described below

commit 2e96b66091b4b1b6eb332f78c4f87e11f9b5f1a2
Author: Wail Alkowaileet <[email protected]>
AuthorDate: Mon Sep 18 15:04:00 2023 -0700

    [ASTERIXDB-3266][COMP] Avoid pushing down the inner SELECT for EVERY
    
    - user model changes: no
    - storage format changes: no
    - interface changes: no
    
    Details:
    Avoid pushing down the inner SELECT for EVERY
    in columnar and external filters.
    
    Change-Id: I3fd509897e4894c3c8ceeedd04695d07d53084f6
    Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17784
    Integration-Tests: Jenkins <[email protected]>
    Tested-by: Jenkins <[email protected]>
    Reviewed-by: Wail Alkowaileet <[email protected]>
    Reviewed-by: Ali Alsuliman <[email protected]>
---
 .../processor/AbstractFilterPushdownProcessor.java |  9 +++-
 .../translator/LangExpressionToPlanTranslator.java |  2 +
 .../filter/not-in_every/not-in_every.001.ddl.sqlpp | 31 +++++++++++
 .../not-in_every/not-in_every.002.update.sqlpp     | 26 +++++++++
 .../filter/not-in_every/not-in_every.003.get.http  | 19 +++++++
 .../not-in_every/not-in_every.004.update.sqlpp     | 26 +++++++++
 .../filter/not-in_every/not-in_every.005.get.http  | 19 +++++++
 .../not-in_every/not-in_every.100.query.sqlpp      | 29 ++++++++++
 .../not-in_every/not-in_every.101.query.sqlpp      | 29 ++++++++++
 .../not-in_every/not-in_every.200.query.sqlpp      | 29 ++++++++++
 .../not-in_every/not-in_every.201.query.sqlpp      | 29 ++++++++++
 .../not-in_every/not-in_every.300.query.sqlpp      | 29 ++++++++++
 .../not-in_every/not-in_every.301.query.sqlpp      | 29 ++++++++++
 .../dynamic-prefixes/not-in/not-in.000.ddl.sqlpp   | 42 +++++++++++++++
 .../dynamic-prefixes/not-in/not-in.010.query.sqlpp | 26 +++++++++
 .../dynamic-prefixes/not-in/not-in.011.query.sqlpp | 26 +++++++++
 .../dynamic-prefixes/not-in/not-in.110.query.sqlpp | 26 +++++++++
 .../dynamic-prefixes/not-in/not-in.111.query.sqlpp | 26 +++++++++
 .../filter/not-in_every/not-in_every.003.regexadm  |  1 +
 .../filter/not-in_every/not-in_every.005.regexadm  |  1 +
 .../filter/not-in_every/not-in_every.100.adm       |  5 ++
 .../filter/not-in_every/not-in_every.101.plan      | 37 +++++++++++++
 .../filter/not-in_every/not-in_every.200.adm       |  3 ++
 .../filter/not-in_every/not-in_every.201.plan      | 55 +++++++++++++++++++
 .../filter/not-in_every/not-in_every.300.adm       |  3 ++
 .../filter/not-in_every/not-in_every.301.plan      | 39 ++++++++++++++
 .../array-access-pushdown.010.plan                 |  2 +-
 .../common/dynamic-prefixes/not-in/not-in.010.adm  |  6 +++
 .../common/dynamic-prefixes/not-in/not-in.011.plan | 37 +++++++++++++
 .../common/dynamic-prefixes/not-in/not-in.110.adm  |  3 ++
 .../common/dynamic-prefixes/not-in/not-in.111.plan | 63 ++++++++++++++++++++++
 .../filter/not-in_every/not-in_every.101.plan      | 37 +++++++++++++
 .../filter/not-in_every/not-in_every.201.plan      | 55 +++++++++++++++++++
 .../filter/not-in_every/not-in_every.301.plan      | 39 ++++++++++++++
 .../array-access-pushdown.010.plan                 |  2 +-
 .../runtimets/testsuite_external_dataset_s3.xml    |  6 +++
 .../test/resources/runtimets/testsuite_sqlpp.xml   |  5 ++
 .../core/algebra/base/OperatorAnnotations.java     | 33 +++++++-----
 38 files changed, 869 insertions(+), 15 deletions(-)

diff --git 
a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/pushdown/processor/AbstractFilterPushdownProcessor.java
 
b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/pushdown/processor/AbstractFilterPushdownProcessor.java
index 67f5c5321a..4a1f156c1c 100644
--- 
a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/pushdown/processor/AbstractFilterPushdownProcessor.java
+++ 
b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/pushdown/processor/AbstractFilterPushdownProcessor.java
@@ -41,6 +41,7 @@ import 
org.apache.hyracks.algebricks.core.algebra.base.ILogicalOperator;
 import org.apache.hyracks.algebricks.core.algebra.base.IOptimizationContext;
 import org.apache.hyracks.algebricks.core.algebra.base.LogicalExpressionTag;
 import org.apache.hyracks.algebricks.core.algebra.base.LogicalOperatorTag;
+import org.apache.hyracks.algebricks.core.algebra.base.OperatorAnnotations;
 import 
org.apache.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression;
 
 abstract class AbstractFilterPushdownProcessor extends 
AbstractPushdownProcessor {
@@ -128,7 +129,7 @@ abstract class AbstractFilterPushdownProcessor extends 
AbstractPushdownProcessor
              */
             ILogicalOperator useOperator = useDescriptor.getOperator();
             if (useDescriptor.getScope() == scanDefineDescriptor.getScope()
-                    && useOperator.getOperatorTag() == 
LogicalOperatorTag.SELECT) {
+                    && useOperator.getOperatorTag() == 
LogicalOperatorTag.SELECT && isPushdownAllowed(useOperator)) {
                 inlineAndPushdownFilter(useDescriptor, scanDefineDescriptor);
             } else if (useOperator.getOperatorTag() == 
LogicalOperatorTag.INNERJOIN) {
                 inlineAndPushdownFilter(useDescriptor, scanDefineDescriptor);
@@ -143,6 +144,12 @@ abstract class AbstractFilterPushdownProcessor extends 
AbstractPushdownProcessor
         }
     }
 
+    private boolean isPushdownAllowed(ILogicalOperator useOperator) {
+        Boolean disallowed = (Boolean) useOperator.getAnnotations()
+                
.getOrDefault(OperatorAnnotations.DISALLOW_FILTER_PUSHDOWN_TO_SCAN, 
Boolean.FALSE);
+        return disallowed == Boolean.FALSE;
+    }
+
     private void inlineAndPushdownFilter(UseDescriptor useDescriptor, 
ScanDefineDescriptor scanDefineDescriptor)
             throws AlgebricksException {
         ILogicalOperator selectOp = useDescriptor.getOperator();
diff --git 
a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/LangExpressionToPlanTranslator.java
 
b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/LangExpressionToPlanTranslator.java
index f1a1398339..9c4fddff19 100644
--- 
a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/LangExpressionToPlanTranslator.java
+++ 
b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/LangExpressionToPlanTranslator.java
@@ -1445,6 +1445,8 @@ abstract class LangExpressionToPlanTranslator
                         
BuiltinFunctions.getBuiltinFunctionInfo(AlgebricksBuiltinFunctions.NOT), 
notArgs);
                 notExpr.setSourceLocation(sourceLoc);
                 s = new SelectOperator(new MutableObject<>(notExpr));
+                // Disable pushdowns
+                
s.getAnnotations().put(OperatorAnnotations.DISALLOW_FILTER_PUSHDOWN_TO_SCAN, 
Boolean.TRUE);
                 s.getInputs().add(eo2.second);
                 s.setSourceLocation(sourceLoc);
                 fAgg = 
BuiltinFunctions.makeAggregateFunctionExpression(BuiltinFunctions.EMPTY_STREAM,
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/not-in_every/not-in_every.001.ddl.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/not-in_every/not-in_every.001.ddl.sqlpp
new file mode 100644
index 0000000000..a271778586
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/not-in_every/not-in_every.001.ddl.sqlpp
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+DROP DATAVERSE test if exists;
+CREATE DATAVERSE test;
+USE test;
+
+CREATE TYPE ColumnType AS {
+    id: int
+};
+
+CREATE DATASET ColumnDataset(ColumnType)
+PRIMARY KEY id WITH {
+    "storage-format": {"format" : "column"}
+};
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/not-in_every/not-in_every.002.update.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/not-in_every/not-in_every.002.update.sqlpp
new file mode 100644
index 0000000000..169c767eb4
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/not-in_every/not-in_every.002.update.sqlpp
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+USE test;
+
+INSERT INTO ColumnDataset (
+    {"id": 1, "a": "1", "array": [10, 20, 30]},
+    {"id": 2, "a": "2", "array": [40, 50, 60]},
+    {"id": 3, "a": "3", "array": [70, 80, 90]}
+);
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/not-in_every/not-in_every.003.get.http
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/not-in_every/not-in_every.003.get.http
new file mode 100644
index 0000000000..57d830aed0
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/not-in_every/not-in_every.003.get.http
@@ -0,0 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/connector?dataverseName=test&datasetName=ColumnDataset
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/not-in_every/not-in_every.004.update.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/not-in_every/not-in_every.004.update.sqlpp
new file mode 100644
index 0000000000..1a6b83d50b
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/not-in_every/not-in_every.004.update.sqlpp
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+USE test;
+
+INSERT INTO ColumnDataset (
+    {"id": 4, "a": "4", "array": [100, 200, 300]},
+    {"id": 5, "a": "5", "array": [400, 500, 600]},
+    {"id": 6, "a": "6", "array": [700, 800, 900]}
+);
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/not-in_every/not-in_every.005.get.http
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/not-in_every/not-in_every.005.get.http
new file mode 100644
index 0000000000..57d830aed0
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/not-in_every/not-in_every.005.get.http
@@ -0,0 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/connector?dataverseName=test&datasetName=ColumnDataset
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/not-in_every/not-in_every.100.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/not-in_every/not-in_every.100.query.sqlpp
new file mode 100644
index 0000000000..7038c6ae3d
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/not-in_every/not-in_every.100.query.sqlpp
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+USE test;
+SET `compiler.column.filter` "true";
+
+
+
+
+SELECT VALUE d
+FROM ColumnDataset d
+WHERE d.a NOT IN ["1"]
+ORDER BY d.id;
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/not-in_every/not-in_every.101.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/not-in_every/not-in_every.101.query.sqlpp
new file mode 100644
index 0000000000..422b085d92
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/not-in_every/not-in_every.101.query.sqlpp
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+USE test;
+SET `compiler.column.filter` "true";
+SET `compiler.parallelism` "0";
+SET `compiler.sort.parallel` "false";
+
+EXPLAIN
+SELECT VALUE d
+FROM ColumnDataset d
+WHERE d.a NOT IN ["1"]
+ORDER BY d.id;
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/not-in_every/not-in_every.200.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/not-in_every/not-in_every.200.query.sqlpp
new file mode 100644
index 0000000000..161e44ea8a
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/not-in_every/not-in_every.200.query.sqlpp
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+USE test;
+SET `compiler.column.filter` "true";
+
+
+
+
+SELECT VALUE d
+FROM ColumnDataset d
+WHERE d.a NOT IN ["1", "2", "3"]
+ORDER BY d.id;
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/not-in_every/not-in_every.201.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/not-in_every/not-in_every.201.query.sqlpp
new file mode 100644
index 0000000000..6bedcc2a16
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/not-in_every/not-in_every.201.query.sqlpp
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+USE test;
+SET `compiler.column.filter` "true";
+SET `compiler.parallelism` "0";
+SET `compiler.sort.parallel` "false";
+
+EXPLAIN
+SELECT VALUE d
+FROM ColumnDataset d
+WHERE d.a NOT IN ["1", "2", "3"]
+ORDER BY d.id;
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/not-in_every/not-in_every.300.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/not-in_every/not-in_every.300.query.sqlpp
new file mode 100644
index 0000000000..af79428835
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/not-in_every/not-in_every.300.query.sqlpp
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+USE test;
+SET `compiler.column.filter` "true";
+
+
+
+
+SELECT VALUE d
+FROM ColumnDataset d
+WHERE (EVERY x in d.array SATISFIES x >= 100)
+ORDER BY d.id;
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/not-in_every/not-in_every.301.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/not-in_every/not-in_every.301.query.sqlpp
new file mode 100644
index 0000000000..7034be319d
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/not-in_every/not-in_every.301.query.sqlpp
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+USE test;
+SET `compiler.column.filter` "true";
+SET `compiler.parallelism` "0";
+SET `compiler.sort.parallel` "false";
+
+EXPLAIN
+SELECT VALUE d
+FROM ColumnDataset d
+WHERE (EVERY x in d.array SATISFIES x >= 100)
+ORDER BY d.id;
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/not-in/not-in.000.ddl.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/not-in/not-in.000.ddl.sqlpp
new file mode 100644
index 0000000000..6036e7950a
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/not-in/not-in.000.ddl.sqlpp
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+DROP DATAVERSE test IF EXISTS;
+CREATE DATAVERSE test;
+USE test;
+
+CREATE TYPE TestType AS {
+};
+
+
+CREATE EXTERNAL DATASET Department(TestType) USING %adapter% (
+    %template%,
+    ("container"="playground"),
+    ("definition"="external-filter/department/{department:string}"),
+    ("embed-filter-values" = "false"),
+    ("format"="json")
+);
+
+CREATE EXTERNAL DATASET LastName(TestType) USING %adapter% (
+    %template%,
+    ("container"="playground"),
+    ("definition"="external-filter/last-name/{name.last:string}"),
+    ("embed-filter-values" = "false"),
+    ("format"="json")
+);
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/not-in/not-in.010.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/not-in/not-in.010.query.sqlpp
new file mode 100644
index 0000000000..45ee54321c
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/not-in/not-in.010.query.sqlpp
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+USE test;
+
+
+SELECT VALUE d
+FROM Department d
+WHERE lowercase(d.department) NOT IN ["engineering"]
+ORDER BY d.id;
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/not-in/not-in.011.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/not-in/not-in.011.query.sqlpp
new file mode 100644
index 0000000000..2923faaf9c
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/not-in/not-in.011.query.sqlpp
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+USE test;
+
+EXPLAIN
+SELECT VALUE d
+FROM Department d
+WHERE lowercase(d.department) NOT IN ["engineering"]
+ORDER BY d.id;
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/not-in/not-in.110.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/not-in/not-in.110.query.sqlpp
new file mode 100644
index 0000000000..5c81df4922
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/not-in/not-in.110.query.sqlpp
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+USE test;
+
+
+SELECT VALUE d
+FROM Department d
+WHERE lowercase(d.department) NOT IN ["engineering", "accounting"]
+ORDER BY d.id;
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/not-in/not-in.111.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/not-in/not-in.111.query.sqlpp
new file mode 100644
index 0000000000..b3a7d4438e
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/external-dataset/common/dynamic-prefixes/not-in/not-in.111.query.sqlpp
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+USE test;
+
+EXPLAIN
+SELECT VALUE d
+FROM Department d
+WHERE lowercase(d.department) NOT IN ["engineering", "accounting"]
+ORDER BY d.id;
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/filter/not-in_every/not-in_every.003.regexadm
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/filter/not-in_every/not-in_every.003.regexadm
new file mode 100644
index 0000000000..81882d4ca9
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/filter/not-in_every/not-in_every.003.regexadm
@@ -0,0 +1 @@
+\Q{"keys":"id","type":{"type":"org.apache.asterix.om.types.ARecordType","name":"ColumnType","open":true,"fields":[{"id":{"type":"AInt64"}}]},"splits":[\E.*\Q]}\E
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/filter/not-in_every/not-in_every.005.regexadm
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/filter/not-in_every/not-in_every.005.regexadm
new file mode 100644
index 0000000000..81882d4ca9
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/filter/not-in_every/not-in_every.005.regexadm
@@ -0,0 +1 @@
+\Q{"keys":"id","type":{"type":"org.apache.asterix.om.types.ARecordType","name":"ColumnType","open":true,"fields":[{"id":{"type":"AInt64"}}]},"splits":[\E.*\Q]}\E
\ No newline at end of file
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/filter/not-in_every/not-in_every.100.adm
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/filter/not-in_every/not-in_every.100.adm
new file mode 100644
index 0000000000..5b49cadb65
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/filter/not-in_every/not-in_every.100.adm
@@ -0,0 +1,5 @@
+{ "id": 2, "a": "2", "array": [ 40, 50, 60 ] }
+{ "id": 3, "a": "3", "array": [ 70, 80, 90 ] }
+{ "id": 4, "a": "4", "array": [ 100, 200, 300 ] }
+{ "id": 5, "a": "5", "array": [ 400, 500, 600 ] }
+{ "id": 6, "a": "6", "array": [ 700, 800, 900 ] }
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/filter/not-in_every/not-in_every.101.plan
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/filter/not-in_every/not-in_every.101.plan
new file mode 100644
index 0000000000..043246ed81
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/filter/not-in_every/not-in_every.101.plan
@@ -0,0 +1,37 @@
+distribute result [$$d] [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+-- DISTRIBUTE_RESULT  |PARTITIONED|
+  exchange [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+    project ([$$d]) [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+    -- STREAM_PROJECT  |PARTITIONED|
+      exchange [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+      -- SORT_MERGE_EXCHANGE [$$20(ASC) ]  |PARTITIONED|
+        order (ASC, $$20) [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+        -- STABLE_SORT [$$20(ASC)]  |PARTITIONED|
+          exchange [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+          -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+            project ([$$d, $$20]) [cardinality: 0.0, op-cost: 0.0, total-cost: 
0.0]
+            -- STREAM_PROJECT  |PARTITIONED|
+              select ($$18) [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+              -- STREAM_SELECT  |PARTITIONED|
+                project ([$$20, $$d, $$18]) [cardinality: 0.0, op-cost: 0.0, 
total-cost: 0.0]
+                -- STREAM_PROJECT  |PARTITIONED|
+                  subplan {
+                            aggregate [$$18] <- [empty-stream()] [cardinality: 
0.0, op-cost: 0.0, total-cost: 0.0]
+                            -- AGGREGATE  |LOCAL|
+                              select (not(if-missing-or-null(neq($$21, "1"), 
false))) [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+                              -- STREAM_SELECT  |LOCAL|
+                                nested tuple source [cardinality: 0.0, 
op-cost: 0.0, total-cost: 0.0]
+                                -- NESTED_TUPLE_SOURCE  |LOCAL|
+                         } [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+                  -- SUBPLAN  |PARTITIONED|
+                    assign [$$21] <- [$$d.getField("a")] [cardinality: 0.0, 
op-cost: 0.0, total-cost: 0.0]
+                    -- ASSIGN  |PARTITIONED|
+                      exchange [cardinality: 0.0, op-cost: 0.0, total-cost: 
0.0]
+                      -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                        data-scan []<-[$$20, $$d] <- test.ColumnDataset 
[cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+                        -- DATASOURCE_SCAN  |PARTITIONED|
+                          exchange [cardinality: 0.0, op-cost: 0.0, 
total-cost: 0.0]
+                          -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                            empty-tuple-source [cardinality: 0.0, op-cost: 
0.0, total-cost: 0.0]
+                            -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/filter/not-in_every/not-in_every.200.adm
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/filter/not-in_every/not-in_every.200.adm
new file mode 100644
index 0000000000..8f22331091
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/filter/not-in_every/not-in_every.200.adm
@@ -0,0 +1,3 @@
+{ "id": 4, "a": "4", "array": [ 100, 200, 300 ] }
+{ "id": 5, "a": "5", "array": [ 400, 500, 600 ] }
+{ "id": 6, "a": "6", "array": [ 700, 800, 900 ] }
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/filter/not-in_every/not-in_every.201.plan
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/filter/not-in_every/not-in_every.201.plan
new file mode 100644
index 0000000000..bda626867a
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/filter/not-in_every/not-in_every.201.plan
@@ -0,0 +1,55 @@
+distribute result [$$d] [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+-- DISTRIBUTE_RESULT  |PARTITIONED|
+  exchange [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+    project ([$$d]) [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+    -- STREAM_PROJECT  |PARTITIONED|
+      exchange [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+      -- SORT_MERGE_EXCHANGE [$$24(ASC) ]  |PARTITIONED|
+        project ([$$d, $$24]) [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+        -- STREAM_PROJECT  |PARTITIONED|
+          select ($$18) [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+          -- STREAM_SELECT  |PARTITIONED|
+            exchange [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+            -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+              group by ([$$24 := $$20]) decor ([$$d]) {
+                        aggregate [$$18] <- [empty-stream()] [cardinality: 
0.0, op-cost: 0.0, total-cost: 0.0]
+                        -- AGGREGATE  |LOCAL|
+                          select (not(is-missing($$23))) [cardinality: 0.0, 
op-cost: 0.0, total-cost: 0.0]
+                          -- STREAM_SELECT  |LOCAL|
+                            nested tuple source [cardinality: 0.0, op-cost: 
0.0, total-cost: 0.0]
+                            -- NESTED_TUPLE_SOURCE  |LOCAL|
+                     } [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+              -- PRE_CLUSTERED_GROUP_BY[$$20]  |PARTITIONED|
+                exchange [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+                -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                  order (ASC, $$20) [cardinality: 0.0, op-cost: 0.0, 
total-cost: 0.0]
+                  -- STABLE_SORT [$$20(ASC)]  |PARTITIONED|
+                    exchange [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+                    -- HASH_PARTITION_EXCHANGE [$$20]  |PARTITIONED|
+                      project ([$$d, $$23, $$20]) [cardinality: 0.0, op-cost: 
0.0, total-cost: 0.0]
+                      -- STREAM_PROJECT  |PARTITIONED|
+                        exchange [cardinality: 0.0, op-cost: 0.0, total-cost: 
0.0]
+                        -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                          left outer join (not(if-missing-or-null(neq($$21, 
$#1), false))) [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+                          -- NESTED_LOOP  |PARTITIONED|
+                            exchange [cardinality: 0.0, op-cost: 0.0, 
total-cost: 0.0]
+                            -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                              assign [$$21] <- [$$d.getField("a")] 
[cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+                              -- ASSIGN  |PARTITIONED|
+                                exchange [cardinality: 0.0, op-cost: 0.0, 
total-cost: 0.0]
+                                -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                  data-scan []<-[$$20, $$d] <- 
test.ColumnDataset [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+                                  -- DATASOURCE_SCAN  |PARTITIONED|
+                                    exchange [cardinality: 0.0, op-cost: 0.0, 
total-cost: 0.0]
+                                    -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                      empty-tuple-source [cardinality: 0.0, 
op-cost: 0.0, total-cost: 0.0]
+                                      -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
+                            exchange [cardinality: 0.0, op-cost: 0.0, 
total-cost: 0.0]
+                            -- BROADCAST_EXCHANGE  |PARTITIONED|
+                              assign [$$23] <- [true] [cardinality: 0.0, 
op-cost: 0.0, total-cost: 0.0]
+                              -- ASSIGN  |UNPARTITIONED|
+                                unnest $#1 <- scan-collection(array: [ "1", 
"2", "3" ]) [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+                                -- UNNEST  |UNPARTITIONED|
+                                  empty-tuple-source [cardinality: 0.0, 
op-cost: 0.0, total-cost: 0.0]
+                                  -- EMPTY_TUPLE_SOURCE  |UNPARTITIONED|
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/filter/not-in_every/not-in_every.300.adm
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/filter/not-in_every/not-in_every.300.adm
new file mode 100644
index 0000000000..8f22331091
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/filter/not-in_every/not-in_every.300.adm
@@ -0,0 +1,3 @@
+{ "id": 4, "a": "4", "array": [ 100, 200, 300 ] }
+{ "id": 5, "a": "5", "array": [ 400, 500, 600 ] }
+{ "id": 6, "a": "6", "array": [ 700, 800, 900 ] }
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/filter/not-in_every/not-in_every.301.plan
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/filter/not-in_every/not-in_every.301.plan
new file mode 100644
index 0000000000..b632b8b2cf
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/filter/not-in_every/not-in_every.301.plan
@@ -0,0 +1,39 @@
+distribute result [$$d] [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+-- DISTRIBUTE_RESULT  |PARTITIONED|
+  exchange [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+    project ([$$d]) [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+    -- STREAM_PROJECT  |PARTITIONED|
+      exchange [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+      -- SORT_MERGE_EXCHANGE [$$28(ASC) ]  |PARTITIONED|
+        order (ASC, $$28) [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+        -- STABLE_SORT [$$28(ASC)]  |PARTITIONED|
+          exchange [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+          -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+            project ([$$d, $$28]) [cardinality: 0.0, op-cost: 0.0, total-cost: 
0.0]
+            -- STREAM_PROJECT  |PARTITIONED|
+              select ($$26) [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+              -- STREAM_SELECT  |PARTITIONED|
+                project ([$$28, $$d, $$26]) [cardinality: 0.0, op-cost: 0.0, 
total-cost: 0.0]
+                -- STREAM_PROJECT  |PARTITIONED|
+                  subplan {
+                            aggregate [$$26] <- [empty-stream()] [cardinality: 
0.0, op-cost: 0.0, total-cost: 0.0]
+                            -- AGGREGATE  |LOCAL|
+                              select (not(if-missing-or-null(ge($$x, 100), 
false))) [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+                              -- STREAM_SELECT  |LOCAL|
+                                unnest $$x <- scan-collection($$29) 
[cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+                                -- UNNEST  |LOCAL|
+                                  nested tuple source [cardinality: 0.0, 
op-cost: 0.0, total-cost: 0.0]
+                                  -- NESTED_TUPLE_SOURCE  |LOCAL|
+                         } [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+                  -- SUBPLAN  |PARTITIONED|
+                    assign [$$29] <- [$$d.getField("array")] [cardinality: 
0.0, op-cost: 0.0, total-cost: 0.0]
+                    -- ASSIGN  |PARTITIONED|
+                      exchange [cardinality: 0.0, op-cost: 0.0, total-cost: 
0.0]
+                      -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                        data-scan []<-[$$28, $$d] <- test.ColumnDataset 
[cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+                        -- DATASOURCE_SCAN  |PARTITIONED|
+                          exchange [cardinality: 0.0, op-cost: 0.0, 
total-cost: 0.0]
+                          -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                            empty-tuple-source [cardinality: 0.0, op-cost: 
0.0, total-cost: 0.0]
+                            -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/pushdown/array-access-pushdown/array-access-pushdown.010.plan
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/pushdown/array-access-pushdown/array-access-pushdown.010.plan
index 3f46c9cacf..7783b102b4 100644
--- 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/pushdown/array-access-pushdown/array-access-pushdown.010.plan
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/pushdown/array-access-pushdown/array-access-pushdown.010.plan
@@ -33,7 +33,7 @@ distribute result [$$50] [cardinality: 0.0, op-cost: 0.0, 
total-cost: 0.0]
                     -- STREAM_PROJECT  |PARTITIONED|
                       exchange [cardinality: 0.0, op-cost: 0.0, total-cost: 
0.0]
                       -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                        data-scan []<-[$$49, $$p] <- test.ColumnDataset 
project ({entities:{urls:[{display_url:any}]}}) filter on: 
not(if-missing-or-null(eq(scan-collection($$p.getField("entities").getField("urls")).getField("display_url"),
 "string"), false)) [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+                        data-scan []<-[$$49, $$p] <- test.ColumnDataset 
project ({entities:{urls:[{display_url:any}]}}) [cardinality: 0.0, op-cost: 
0.0, total-cost: 0.0]
                         -- DATASOURCE_SCAN  |PARTITIONED|
                           exchange [cardinality: 0.0, op-cost: 0.0, 
total-cost: 0.0]
                           -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/external-dataset/common/dynamic-prefixes/not-in/not-in.010.adm
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/external-dataset/common/dynamic-prefixes/not-in/not-in.010.adm
new file mode 100644
index 0000000000..f896ea3bd4
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/external-dataset/common/dynamic-prefixes/not-in/not-in.010.adm
@@ -0,0 +1,6 @@
+{ "id": 1, "department": "accounting", "name": { "first": "John", "last": 
"Smith" } }
+{ "id": 2, "department": "accounting", "name": { "first": "Mike", "last": 
"Jones" } }
+{ "id": 3, "department": "accounting", "name": { "first": "Alex", "last": 
"Miller" } }
+{ "id": 7, "department": "hr", "name": { "first": "James", "last": "Smith" } }
+{ "id": 8, "department": "hr", "name": { "first": "David", "last": "Jones" } }
+{ "id": 9, "department": "hr", "name": { "first": "Noah", "last": "Miller" } }
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/external-dataset/common/dynamic-prefixes/not-in/not-in.011.plan
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/external-dataset/common/dynamic-prefixes/not-in/not-in.011.plan
new file mode 100644
index 0000000000..f5b9fd00b4
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/external-dataset/common/dynamic-prefixes/not-in/not-in.011.plan
@@ -0,0 +1,37 @@
+distribute result [$$d] [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+-- DISTRIBUTE_RESULT  |PARTITIONED|
+  exchange [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+    project ([$$d]) [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+    -- STREAM_PROJECT  |PARTITIONED|
+      exchange [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+      -- SORT_MERGE_EXCHANGE [$$22(ASC) ]  |PARTITIONED|
+        order (ASC, $$22) [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+        -- STABLE_SORT [$$22(ASC)]  |PARTITIONED|
+          exchange [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+          -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+            project ([$$d, $$22]) [cardinality: 0.0, op-cost: 0.0, total-cost: 
0.0]
+            -- STREAM_PROJECT  |PARTITIONED|
+              select ($$19) [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+              -- STREAM_SELECT  |PARTITIONED|
+                project ([$$d, $$22, $$19]) [cardinality: 0.0, op-cost: 0.0, 
total-cost: 0.0]
+                -- STREAM_PROJECT  |PARTITIONED|
+                  subplan {
+                            aggregate [$$19] <- [empty-stream()] [cardinality: 
0.0, op-cost: 0.0, total-cost: 0.0]
+                            -- AGGREGATE  |LOCAL|
+                              select 
(not(if-missing-or-null(neq(lowercase($$21), "engineering"), false))) 
[cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+                              -- STREAM_SELECT  |LOCAL|
+                                nested tuple source [cardinality: 0.0, 
op-cost: 0.0, total-cost: 0.0]
+                                -- NESTED_TUPLE_SOURCE  |LOCAL|
+                         } [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+                  -- SUBPLAN  |PARTITIONED|
+                    assign [$$22, $$21] <- [$$d.getField("id"), 
$$d.getField("department")] [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+                    -- ASSIGN  |PARTITIONED|
+                      exchange [cardinality: 0.0, op-cost: 0.0, total-cost: 
0.0]
+                      -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                        data-scan []<-[$$d] <- test.Department [cardinality: 
0.0, op-cost: 0.0, total-cost: 0.0]
+                        -- DATASOURCE_SCAN  |PARTITIONED|
+                          exchange [cardinality: 0.0, op-cost: 0.0, 
total-cost: 0.0]
+                          -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                            empty-tuple-source [cardinality: 0.0, op-cost: 
0.0, total-cost: 0.0]
+                            -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/external-dataset/common/dynamic-prefixes/not-in/not-in.110.adm
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/external-dataset/common/dynamic-prefixes/not-in/not-in.110.adm
new file mode 100644
index 0000000000..296a9085bb
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/external-dataset/common/dynamic-prefixes/not-in/not-in.110.adm
@@ -0,0 +1,3 @@
+{ "id": 7, "department": "hr", "name": { "first": "James", "last": "Smith" } }
+{ "id": 8, "department": "hr", "name": { "first": "David", "last": "Jones" } }
+{ "id": 9, "department": "hr", "name": { "first": "Noah", "last": "Miller" } }
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/external-dataset/common/dynamic-prefixes/not-in/not-in.111.plan
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/external-dataset/common/dynamic-prefixes/not-in/not-in.111.plan
new file mode 100644
index 0000000000..9bf7d8290d
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/external-dataset/common/dynamic-prefixes/not-in/not-in.111.plan
@@ -0,0 +1,63 @@
+distribute result [$$d] [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+-- DISTRIBUTE_RESULT  |PARTITIONED|
+  exchange [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+    project ([$$d]) [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+    -- STREAM_PROJECT  |PARTITIONED|
+      exchange [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+      -- SORT_MERGE_EXCHANGE [$$22(ASC) ]  |PARTITIONED|
+        order (ASC, $$22) [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+        -- STABLE_SORT [$$22(ASC)]  |PARTITIONED|
+          exchange [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+          -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+            project ([$$d, $$22]) [cardinality: 0.0, op-cost: 0.0, total-cost: 
0.0]
+            -- STREAM_PROJECT  |PARTITIONED|
+              select ($$19) [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+              -- STREAM_SELECT  |PARTITIONED|
+                project ([$$19, $$22, $$d]) [cardinality: 0.0, op-cost: 0.0, 
total-cost: 0.0]
+                -- STREAM_PROJECT  |PARTITIONED|
+                  exchange [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+                  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                    group by ([$$25 := $$23]) decor ([$$22; $$d]) {
+                              aggregate [$$19] <- [empty-stream()] 
[cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+                              -- AGGREGATE  |LOCAL|
+                                select (not(is-missing($$24))) [cardinality: 
0.0, op-cost: 0.0, total-cost: 0.0]
+                                -- STREAM_SELECT  |LOCAL|
+                                  nested tuple source [cardinality: 0.0, 
op-cost: 0.0, total-cost: 0.0]
+                                  -- NESTED_TUPLE_SOURCE  |LOCAL|
+                           } [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+                    -- PRE_CLUSTERED_GROUP_BY[$$23]  |PARTITIONED|
+                      exchange [cardinality: 0.0, op-cost: 0.0, total-cost: 
0.0]
+                      -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                        order (ASC, $$23) [cardinality: 0.0, op-cost: 0.0, 
total-cost: 0.0]
+                        -- STABLE_SORT [$$23(ASC)]  |PARTITIONED|
+                          exchange [cardinality: 0.0, op-cost: 0.0, 
total-cost: 0.0]
+                          -- HASH_PARTITION_EXCHANGE [$$23]  |PARTITIONED|
+                            project ([$$d, $$22, $$24, $$23]) [cardinality: 
0.0, op-cost: 0.0, total-cost: 0.0]
+                            -- STREAM_PROJECT  |PARTITIONED|
+                              exchange [cardinality: 0.0, op-cost: 0.0, 
total-cost: 0.0]
+                              -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                left outer join 
(not(if-missing-or-null(neq(lowercase($$21), $#1), false))) [cardinality: 0.0, 
op-cost: 0.0, total-cost: 0.0]
+                                -- NESTED_LOOP  |PARTITIONED|
+                                  exchange [cardinality: 0.0, op-cost: 0.0, 
total-cost: 0.0]
+                                  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                    running-aggregate [$$23] <- 
[create-query-uid()] [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+                                    -- RUNNING_AGGREGATE  |PARTITIONED|
+                                      assign [$$22, $$21] <- 
[$$d.getField("id"), $$d.getField("department")] [cardinality: 0.0, op-cost: 
0.0, total-cost: 0.0]
+                                      -- ASSIGN  |PARTITIONED|
+                                        exchange [cardinality: 0.0, op-cost: 
0.0, total-cost: 0.0]
+                                        -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                          data-scan []<-[$$d] <- 
test.Department [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+                                          -- DATASOURCE_SCAN  |PARTITIONED|
+                                            exchange [cardinality: 0.0, 
op-cost: 0.0, total-cost: 0.0]
+                                            -- ONE_TO_ONE_EXCHANGE  
|PARTITIONED|
+                                              empty-tuple-source [cardinality: 
0.0, op-cost: 0.0, total-cost: 0.0]
+                                              -- EMPTY_TUPLE_SOURCE  
|PARTITIONED|
+                                  exchange [cardinality: 0.0, op-cost: 0.0, 
total-cost: 0.0]
+                                  -- BROADCAST_EXCHANGE  |PARTITIONED|
+                                    assign [$$24] <- [true] [cardinality: 0.0, 
op-cost: 0.0, total-cost: 0.0]
+                                    -- ASSIGN  |UNPARTITIONED|
+                                      unnest $#1 <- scan-collection(array: [ 
"engineering", "accounting" ]) [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+                                      -- UNNEST  |UNPARTITIONED|
+                                        empty-tuple-source [cardinality: 0.0, 
op-cost: 0.0, total-cost: 0.0]
+                                        -- EMPTY_TUPLE_SOURCE  |UNPARTITIONED|
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results_cbo/column/filter/not-in_every/not-in_every.101.plan
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results_cbo/column/filter/not-in_every/not-in_every.101.plan
new file mode 100644
index 0000000000..f4aae0ba91
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results_cbo/column/filter/not-in_every/not-in_every.101.plan
@@ -0,0 +1,37 @@
+distribute result [$$d] [cardinality: 2.1, op-cost: 0.0, total-cost: 2.1]
+-- DISTRIBUTE_RESULT  |PARTITIONED|
+  exchange [cardinality: 2.1, op-cost: 0.0, total-cost: 2.1]
+  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+    project ([$$d]) [cardinality: 2.1, op-cost: 0.0, total-cost: 2.1]
+    -- STREAM_PROJECT  |PARTITIONED|
+      exchange [cardinality: 2.1, op-cost: 0.0, total-cost: 2.1]
+      -- SORT_MERGE_EXCHANGE [$$20(ASC) ]  |PARTITIONED|
+        order (ASC, $$20) [cardinality: 2.1, op-cost: 0.0, total-cost: 2.1]
+        -- STABLE_SORT [$$20(ASC)]  |PARTITIONED|
+          exchange [cardinality: 2.1, op-cost: 0.0, total-cost: 2.1]
+          -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+            project ([$$d, $$20]) [cardinality: 2.1, op-cost: 0.0, total-cost: 
2.1]
+            -- STREAM_PROJECT  |PARTITIONED|
+              select ($$18) [cardinality: 2.1, op-cost: 0.0, total-cost: 2.1]
+              -- STREAM_SELECT  |PARTITIONED|
+                project ([$$20, $$d, $$18]) [cardinality: 6.0, op-cost: 0.0, 
total-cost: 2.1]
+                -- STREAM_PROJECT  |PARTITIONED|
+                  subplan {
+                            aggregate [$$18] <- [empty-stream()] [cardinality: 
0.0, op-cost: 0.0, total-cost: 0.0]
+                            -- AGGREGATE  |LOCAL|
+                              select (not(if-missing-or-null(neq($$21, "1"), 
false))) [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+                              -- STREAM_SELECT  |LOCAL|
+                                nested tuple source [cardinality: 0.0, 
op-cost: 0.0, total-cost: 0.0]
+                                -- NESTED_TUPLE_SOURCE  |LOCAL|
+                         } [cardinality: 6.0, op-cost: 0.0, total-cost: 2.1]
+                  -- SUBPLAN  |PARTITIONED|
+                    assign [$$21] <- [$$d.getField("a")] [cardinality: 6.0, 
op-cost: 0.0, total-cost: 2.1]
+                    -- ASSIGN  |PARTITIONED|
+                      exchange [cardinality: 6.0, op-cost: 0.0, total-cost: 
2.1]
+                      -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                        data-scan []<-[$$20, $$d] <- test.ColumnDataset 
[cardinality: 6.0, op-cost: 2.1, total-cost: 2.1]
+                        -- DATASOURCE_SCAN  |PARTITIONED|
+                          exchange [cardinality: 0.0, op-cost: 0.0, 
total-cost: 0.0]
+                          -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                            empty-tuple-source [cardinality: 0.0, op-cost: 
0.0, total-cost: 0.0]
+                            -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results_cbo/column/filter/not-in_every/not-in_every.201.plan
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results_cbo/column/filter/not-in_every/not-in_every.201.plan
new file mode 100644
index 0000000000..a768c38290
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results_cbo/column/filter/not-in_every/not-in_every.201.plan
@@ -0,0 +1,55 @@
+distribute result [$$d] [cardinality: 6.0, op-cost: 0.0, total-cost: 6.0]
+-- DISTRIBUTE_RESULT  |PARTITIONED|
+  exchange [cardinality: 6.0, op-cost: 0.0, total-cost: 6.0]
+  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+    project ([$$d]) [cardinality: 6.0, op-cost: 0.0, total-cost: 6.0]
+    -- STREAM_PROJECT  |PARTITIONED|
+      exchange [cardinality: 6.0, op-cost: 0.0, total-cost: 6.0]
+      -- SORT_MERGE_EXCHANGE [$$24(ASC) ]  |PARTITIONED|
+        project ([$$d, $$24]) [cardinality: 6.0, op-cost: 0.0, total-cost: 6.0]
+        -- STREAM_PROJECT  |PARTITIONED|
+          select ($$18) [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+          -- STREAM_SELECT  |PARTITIONED|
+            exchange [cardinality: 6.0, op-cost: 0.0, total-cost: 6.0]
+            -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+              group by ([$$24 := $$20]) decor ([$$d]) {
+                        aggregate [$$18] <- [empty-stream()] [cardinality: 
0.0, op-cost: 0.0, total-cost: 0.0]
+                        -- AGGREGATE  |LOCAL|
+                          select (not(is-missing($$23))) [cardinality: 0.0, 
op-cost: 0.0, total-cost: 0.0]
+                          -- STREAM_SELECT  |LOCAL|
+                            nested tuple source [cardinality: 0.0, op-cost: 
0.0, total-cost: 0.0]
+                            -- NESTED_TUPLE_SOURCE  |LOCAL|
+                     } [cardinality: 6.0, op-cost: 0.0, total-cost: 6.0]
+              -- PRE_CLUSTERED_GROUP_BY[$$20]  |PARTITIONED|
+                exchange [cardinality: 6.0, op-cost: 0.0, total-cost: 6.0]
+                -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                  order (ASC, $$20) [cardinality: 6.0, op-cost: 0.0, 
total-cost: 6.0]
+                  -- STABLE_SORT [$$20(ASC)]  |PARTITIONED|
+                    exchange [cardinality: 6.0, op-cost: 0.0, total-cost: 6.0]
+                    -- HASH_PARTITION_EXCHANGE [$$20]  |PARTITIONED|
+                      project ([$$d, $$23, $$20]) [cardinality: 6.0, op-cost: 
0.0, total-cost: 6.0]
+                      -- STREAM_PROJECT  |PARTITIONED|
+                        exchange [cardinality: 6.0, op-cost: 0.0, total-cost: 
6.0]
+                        -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                          left outer join (not(if-missing-or-null(neq($$21, 
$#1), false))) [cardinality: 2.1, op-cost: 6.0, total-cost: 17.0]
+                          -- NESTED_LOOP  |PARTITIONED|
+                            exchange [cardinality: 6.0, op-cost: 0.0, 
total-cost: 6.0]
+                            -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                              assign [$$21] <- [$$d.getField("a")] 
[cardinality: 6.0, op-cost: 0.0, total-cost: 6.0]
+                              -- ASSIGN  |PARTITIONED|
+                                exchange [cardinality: 6.0, op-cost: 0.0, 
total-cost: 6.0]
+                                -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                  data-scan []<-[$$20, $$d] <- 
test.ColumnDataset [cardinality: 6.0, op-cost: 6.0, total-cost: 6.0]
+                                  -- DATASOURCE_SCAN  |PARTITIONED|
+                                    exchange [cardinality: 0.0, op-cost: 0.0, 
total-cost: 0.0]
+                                    -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                      empty-tuple-source [cardinality: 0.0, 
op-cost: 0.0, total-cost: 0.0]
+                                      -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
+                            exchange [cardinality: 0.0, op-cost: 0.0, 
total-cost: 0.0]
+                            -- BROADCAST_EXCHANGE  |PARTITIONED|
+                              assign [$$23] <- [true] [cardinality: 0.0, 
op-cost: 0.0, total-cost: 0.0]
+                              -- ASSIGN  |UNPARTITIONED|
+                                unnest $#1 <- scan-collection(array: [ "1", 
"2", "3" ]) [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+                                -- UNNEST  |UNPARTITIONED|
+                                  empty-tuple-source [cardinality: 0.0, 
op-cost: 0.0, total-cost: 0.0]
+                                  -- EMPTY_TUPLE_SOURCE  |UNPARTITIONED|
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results_cbo/column/filter/not-in_every/not-in_every.301.plan
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results_cbo/column/filter/not-in_every/not-in_every.301.plan
new file mode 100644
index 0000000000..9ed9fc91bb
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results_cbo/column/filter/not-in_every/not-in_every.301.plan
@@ -0,0 +1,39 @@
+distribute result [$$d] [cardinality: 2.1, op-cost: 0.0, total-cost: 2.1]
+-- DISTRIBUTE_RESULT  |PARTITIONED|
+  exchange [cardinality: 2.1, op-cost: 0.0, total-cost: 2.1]
+  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+    project ([$$d]) [cardinality: 2.1, op-cost: 0.0, total-cost: 2.1]
+    -- STREAM_PROJECT  |PARTITIONED|
+      exchange [cardinality: 2.1, op-cost: 0.0, total-cost: 2.1]
+      -- SORT_MERGE_EXCHANGE [$$28(ASC) ]  |PARTITIONED|
+        order (ASC, $$28) [cardinality: 2.1, op-cost: 0.0, total-cost: 2.1]
+        -- STABLE_SORT [$$28(ASC)]  |PARTITIONED|
+          exchange [cardinality: 2.1, op-cost: 0.0, total-cost: 2.1]
+          -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+            project ([$$d, $$28]) [cardinality: 2.1, op-cost: 0.0, total-cost: 
2.1]
+            -- STREAM_PROJECT  |PARTITIONED|
+              select ($$26) [cardinality: 2.1, op-cost: 0.0, total-cost: 2.1]
+              -- STREAM_SELECT  |PARTITIONED|
+                project ([$$28, $$d, $$26]) [cardinality: 6.0, op-cost: 0.0, 
total-cost: 2.1]
+                -- STREAM_PROJECT  |PARTITIONED|
+                  subplan {
+                            aggregate [$$26] <- [empty-stream()] [cardinality: 
0.0, op-cost: 0.0, total-cost: 0.0]
+                            -- AGGREGATE  |LOCAL|
+                              select (not(if-missing-or-null(ge($$x, 100), 
false))) [cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+                              -- STREAM_SELECT  |LOCAL|
+                                unnest $$x <- scan-collection($$29) 
[cardinality: 0.0, op-cost: 0.0, total-cost: 0.0]
+                                -- UNNEST  |LOCAL|
+                                  nested tuple source [cardinality: 0.0, 
op-cost: 0.0, total-cost: 0.0]
+                                  -- NESTED_TUPLE_SOURCE  |LOCAL|
+                         } [cardinality: 6.0, op-cost: 0.0, total-cost: 2.1]
+                  -- SUBPLAN  |PARTITIONED|
+                    assign [$$29] <- [$$d.getField("array")] [cardinality: 
6.0, op-cost: 0.0, total-cost: 2.1]
+                    -- ASSIGN  |PARTITIONED|
+                      exchange [cardinality: 6.0, op-cost: 0.0, total-cost: 
2.1]
+                      -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                        data-scan []<-[$$28, $$d] <- test.ColumnDataset 
[cardinality: 6.0, op-cost: 2.1, total-cost: 2.1]
+                        -- DATASOURCE_SCAN  |PARTITIONED|
+                          exchange [cardinality: 0.0, op-cost: 0.0, 
total-cost: 0.0]
+                          -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                            empty-tuple-source [cardinality: 0.0, op-cost: 
0.0, total-cost: 0.0]
+                            -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results_cbo/column/pushdown/array-access-pushdown/array-access-pushdown.010.plan
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results_cbo/column/pushdown/array-access-pushdown/array-access-pushdown.010.plan
index 633350a2cc..d0bf0f0ccc 100644
--- 
a/asterixdb/asterix-app/src/test/resources/runtimets/results_cbo/column/pushdown/array-access-pushdown/array-access-pushdown.010.plan
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results_cbo/column/pushdown/array-access-pushdown/array-access-pushdown.010.plan
@@ -33,7 +33,7 @@ distribute result [$$50] [cardinality: 2.1, op-cost: 0.0, 
total-cost: 2.1]
                     -- STREAM_PROJECT  |PARTITIONED|
                       exchange [cardinality: 2.0, op-cost: 0.0, total-cost: 
2.1]
                       -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                        data-scan []<-[$$49, $$p] <- test.ColumnDataset 
project ({entities:{urls:[{display_url:any}]}}) filter on: 
not(if-missing-or-null(eq(scan-collection($$p.getField("entities").getField("urls")).getField("display_url"),
 "string"), false)) [cardinality: 2.0, op-cost: 2.1, total-cost: 2.1]
+                        data-scan []<-[$$49, $$p] <- test.ColumnDataset 
project ({entities:{urls:[{display_url:any}]}}) [cardinality: 2.0, op-cost: 
2.1, total-cost: 2.1]
                         -- DATASOURCE_SCAN  |PARTITIONED|
                           exchange [cardinality: 0.0, op-cost: 0.0, 
total-cost: 0.0]
                           -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_external_dataset_s3.xml
 
b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_external_dataset_s3.xml
index b22eed001d..c248cc2b2f 100644
--- 
a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_external_dataset_s3.xml
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_external_dataset_s3.xml
@@ -256,6 +256,12 @@
         <output-dir compare="Text">embed-multiple-values</output-dir>
       </compilation-unit>
     </test-case>
+    <test-case FilePath="external-dataset/common/dynamic-prefixes">
+      <compilation-unit name="not-in">
+        <placeholder name="adapter" value="S3" />
+        <output-dir compare="Text">not-in</output-dir>
+      </compilation-unit>
+    </test-case>
     <test-case FilePath="external-dataset/common/dynamic-prefixes/parquet">
       <compilation-unit name="one-field">
         <placeholder name="adapter" value="S3" />
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml 
b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
index 1800d47e1b..8ad67a3f93 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
@@ -16285,6 +16285,11 @@
         <output-dir compare="Text">filter/007</output-dir>
       </compilation-unit>
     </test-case>
+    <test-case FilePath="column">
+      <compilation-unit name="filter/not-in_every">
+        <output-dir compare="Text">filter/not-in_every</output-dir>
+      </compilation-unit>
+    </test-case>
     <test-case FilePath="column">
       <compilation-unit name="big-object">
         <output-dir compare="Text">big-object</output-dir>
diff --git 
a/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/base/OperatorAnnotations.java
 
b/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/base/OperatorAnnotations.java
index 3b44a972f2..7ca9dc71c7 100644
--- 
a/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/base/OperatorAnnotations.java
+++ 
b/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/base/OperatorAnnotations.java
@@ -20,19 +20,28 @@ package org.apache.hyracks.algebricks.core.algebra.base;
 
 public interface OperatorAnnotations {
     // hints
-    public static final String USE_HASH_GROUP_BY = "USE_HASH_GROUP_BY"; // -->
-    public static final String USE_EXTERNAL_GROUP_BY = 
"USE_EXTERNAL_GROUP_BY"; // -->
-    public static final String USE_STATIC_RANGE = "USE_STATIC_RANGE"; // -->
-    public static final String USE_DYNAMIC_RANGE = "USE_DYNAMIC_RANGE";
+    String USE_HASH_GROUP_BY = "USE_HASH_GROUP_BY"; // -->
+    String USE_EXTERNAL_GROUP_BY = "USE_EXTERNAL_GROUP_BY"; // -->
+    String USE_STATIC_RANGE = "USE_STATIC_RANGE"; // -->
+    String USE_DYNAMIC_RANGE = "USE_DYNAMIC_RANGE";
     // Boolean
-    public static final String CARDINALITY = "CARDINALITY"; // -->
+    String CARDINALITY = "CARDINALITY"; // -->
     // Integer
-    public static final String MAX_NUMBER_FRAMES = "MAX_NUMBER_FRAMES"; // -->
+    String MAX_NUMBER_FRAMES = "MAX_NUMBER_FRAMES"; // -->
     // Integer
-    public static final String OP_INPUT_CARDINALITY = "INPUT_CARDINALITY";
-    public static final String OP_OUTPUT_CARDINALITY = "OUTPUT_CARDINALITY";
-    public static final String OP_COST_TOTAL = "TOTAL_COST";
-    public static final String OP_COST_LOCAL = "OP_COST";
-    public static final String OP_LEFT_EXCHANGE_COST = "LEFT_EXCHANGE_COST";
-    public static final String OP_RIGHT_EXCHANGE_COST = "RIGHT_EXCHANGE_COST";
+    String OP_INPUT_CARDINALITY = "INPUT_CARDINALITY";
+    String OP_OUTPUT_CARDINALITY = "OUTPUT_CARDINALITY";
+    String OP_COST_TOTAL = "TOTAL_COST";
+    String OP_COST_LOCAL = "OP_COST";
+    String OP_LEFT_EXCHANGE_COST = "LEFT_EXCHANGE_COST";
+    String OP_RIGHT_EXCHANGE_COST = "RIGHT_EXCHANGE_COST";
+
+    /**
+     * An annotation to indicate that a SELECT predicate should not be pushed 
to data-scan.
+     * <p>
+     * Returns TRUE if it is disallowed, FALSE otherwise.
+     * <p>
+     * If the annotation is missing (i.e., {@code null}), it should mean FALSE.
+     */
+    String DISALLOW_FILTER_PUSHDOWN_TO_SCAN = 
"DISALLOW_FILTER_PUSHDOWN_TO_SCAN";
 }

Reply via email to