merge from master
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/AqlExpressionToPlanTranslator.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/AqlExpressionToPlanTranslator.java
index f769db3..e07c1d0 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/AqlExpressionToPlanTranslator.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/AqlExpressionToPlanTranslator.java
@@ -92,6 +92,7 @@
 import edu.uci.ics.asterix.om.base.AString;
 import edu.uci.ics.asterix.om.constants.AsterixConstantValue;
 import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions.FunctionNamespace;
 import edu.uci.ics.asterix.om.functions.AsterixFunctionInfo;
 import edu.uci.ics.asterix.om.types.BuiltinType;
 import edu.uci.ics.asterix.om.types.IAType;
@@ -506,10 +507,14 @@
         if (builtinAquafi != null) {
             fi = builtinAquafi;
         } else {
-            fi = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, functionName, arity);
+            fi = new FunctionIdentifier(FunctionNamespace.ASTERIX_PUBLIC.name(), functionName, arity);
             afi = AsterixBuiltinFunctions.lookupFunction(fi);
             if (afi == null) {
-                return null;
+                fi = new FunctionIdentifier(FunctionNamespace.ASTERIX_PRIVATE.name(), functionName, arity);
+                afi = AsterixBuiltinFunctions.lookupFunction(fi);
+                if (afi == null) {
+                    return null;
+                }
             }
         }
         if (AsterixBuiltinFunctions.isBuiltinAggregateFunction(fi)) {
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/AqlPlusExpressionToPlanTranslator.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/AqlPlusExpressionToPlanTranslator.java
index 9f28113..92add99 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/AqlPlusExpressionToPlanTranslator.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/AqlPlusExpressionToPlanTranslator.java
@@ -89,6 +89,7 @@
 import edu.uci.ics.asterix.om.base.AString;
 import edu.uci.ics.asterix.om.constants.AsterixConstantValue;
 import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions.FunctionNamespace;
 import edu.uci.ics.asterix.om.functions.AsterixFunctionInfo;
 import edu.uci.ics.asterix.om.types.ARecordType;
 import edu.uci.ics.asterix.om.types.BuiltinType;
@@ -464,10 +465,14 @@
         if (builtinAquafi != null) {
             fi = builtinAquafi;
         } else {
-            fi = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, signature.getName());
+            fi = new FunctionIdentifier(FunctionNamespace.ASTERIX_PUBLIC.name(), signature.getName());
             FunctionIdentifier builtinAsterixFi = AsterixBuiltinFunctions.getBuiltinFunctionIdentifier(fi);
             if (builtinAsterixFi != null) {
                 fi = builtinAsterixFi;
+            } else {
+                fi = new FunctionIdentifier(FunctionNamespace.ASTERIX_PRIVATE.name(), signature.getName());
+                builtinAsterixFi = AsterixBuiltinFunctions.getBuiltinFunctionIdentifier(fi);
+                fi = builtinAsterixFi;
             }
         }
         AbstractFunctionCallExpression f;
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/CompiledStatements.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/CompiledStatements.java
index 6cf8d28..a91f2eb 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/CompiledStatements.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/CompiledStatements.java
@@ -35,10 +35,10 @@
 import edu.uci.ics.asterix.aql.expression.WhereClause;
 import edu.uci.ics.asterix.aql.literal.StringLiteral;
 import edu.uci.ics.asterix.common.config.DatasetConfig.IndexType;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
 import edu.uci.ics.asterix.common.functions.FunctionSignature;
 import edu.uci.ics.asterix.metadata.declared.AqlMetadataProvider;
 import edu.uci.ics.asterix.metadata.entities.Dataset;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
 import edu.uci.ics.asterix.om.types.ARecordType;
 import edu.uci.ics.asterix.om.types.IAType;
 import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
@@ -495,8 +495,8 @@
             LiteralExpr argumentLiteral = new LiteralExpr(new StringLiteral(arg));
             arguments.add(argumentLiteral);
 
-            CallExpr callExpression = new CallExpr(new FunctionSignature(FunctionConstants.ASTERIX_NS, "dataset", 1),
-                    arguments);
+            CallExpr callExpression = new CallExpr(new FunctionSignature(
+                    AsterixBuiltinFunctions.FunctionNamespace.ASTERIX_PUBLIC.name(), "dataset", 1), arguments);
             List<Clause> clauseList = new ArrayList<Clause>();
             Clause forClause = new ForClause(var, callExpression);
             clauseList.add(forClause);
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/APIFramework.java b/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/APIFramework.java
index 438bc74..e1114eb 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/APIFramework.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/APIFramework.java
@@ -181,7 +181,7 @@
                 }
             }
         }
-        AqlRewriter rw = new AqlRewriter(declaredFunctions, q, metadataProvider.getMetadataTxnContext());
+        AqlRewriter rw = new AqlRewriter(declaredFunctions, q, metadataProvider);
         rw.rewrite();
         Query rwQ = rw.getExpr();
         return new Pair(rwQ, rw.getVarCounter());
diff --git a/asterix-app/src/main/resources/asterix-build-configuration.xml b/asterix-app/src/main/resources/asterix-build-configuration.xml
index 20ffb37..3e1b4b2 100644
--- a/asterix-app/src/main/resources/asterix-build-configuration.xml
+++ b/asterix-app/src/main/resources/asterix-build-configuration.xml
@@ -11,6 +11,6 @@
   <property>
      <name>log.level</name>
      <value>WARNING</value>
-     <description></description>
+     <description>Log level for running tests/build</description>
   </property>
 </asterixConfiguration>
diff --git a/asterix-app/src/test/resources/optimizerts/ignore.txt b/asterix-app/src/test/resources/optimizerts/ignore.txt
index babe741..34d7259 100644
--- a/asterix-app/src/test/resources/optimizerts/ignore.txt
+++ b/asterix-app/src/test/resources/optimizerts/ignore.txt
@@ -1 +1,4 @@
-distinct_aggregate.aql
\ No newline at end of file
+distinct_aggregate.aql
+unnest_list_in_subplan.aql
+fj-phase2-with-hints.aql
+fj-dblp-csx.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_1/dblp-1_1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_1/dblp-1_1.3.query.aql
index bc6490d..c3b22f0 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_1/dblp-1_1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_1/dblp-1_1.3.query.aql
@@ -1,5 +1,6 @@
 use dataverse fuzzyjoin;
 
+set import-private-functions 'true';
             //
             // -- - Stage 1 - --
             //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.1.1/dblp-1_2.1.1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.1.1/dblp-1_2.1.1.3.query.aql
index e6a2e36..5f0ede9 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.1.1/dblp-1_2.1.1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.1.1/dblp-1_2.1.1.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse fuzzyjoin;
+set import-private-functions 'true';
 
             //
             // -- - Stage 1 - --
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.1/dblp-1_2.1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.1/dblp-1_2.1.3.query.aql
index e6a2e36..dd0f1ba 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.1/dblp-1_2.1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2.1/dblp-1_2.1.3.query.aql
@@ -1,5 +1,5 @@
 use dataverse fuzzyjoin;
-
+set import-private-functions 'true';
             //
             // -- - Stage 1 - --
             //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2/dblp-1_2.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2/dblp-1_2.3.query.aql
index aa6a746..6d3d69b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2/dblp-1_2.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-1_2/dblp-1_2.3.query.aql
@@ -1,5 +1,5 @@
 use dataverse fuzzyjoin;
-
+set import-private-functions 'true';
             //
             // -- - Stage 1 - --
             //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.1_5.3.1/dblp-2.1_5.3.1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.1_5.3.1/dblp-2.1_5.3.1.3.query.aql
index 70de806..adcb9c7 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.1_5.3.1/dblp-2.1_5.3.1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.1_5.3.1/dblp-2.1_5.3.1.3.query.aql
@@ -1,5 +1,5 @@
 use dataverse fuzzyjoin;
-
+set import-private-functions 'true';
     //
     // -- - Stage 2 - --
     //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.2/dblp-2.2.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.2/dblp-2.2.3.query.aql
index 03add70..b7a71e9 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.2/dblp-2.2.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.2/dblp-2.2.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse fuzzyjoin;
+set import-private-functions 'true';
 
     //
     // -- - Stage 2 - --
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_1/dblp-2_1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_1/dblp-2_1.3.query.aql
index 977a2a9..621f40e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_1/dblp-2_1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_1/dblp-2_1.3.query.aql
@@ -1,5 +1,5 @@
 use dataverse fuzzyjoin;
-
+set import-private-functions 'true';
     //
     // -- - Stage 2 - --
     //
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_2/dblp-2_2.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_2/dblp-2_2.3.query.aql
index 275a4cf..ddcded7 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_2/dblp-2_2.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_2/dblp-2_2.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse fuzzyjoin;
+set import-private-functions 'true';
 
     //
     // -- - Stage 2 - --
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_3/dblp-2_3.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_3/dblp-2_3.3.query.aql
index 8f75103..cfa6079 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_3/dblp-2_3.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_3/dblp-2_3.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse fuzzyjoin;
+set import-private-functions 'true';
 
     //
     // -- - Stage 2 - --
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_4/dblp-2_4.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_4/dblp-2_4.3.query.aql
index abb7736..a1eca39 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_4/dblp-2_4.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_4/dblp-2_4.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse fuzzyjoin;
+set import-private-functions 'true';
 
     //
     // -- - Stage 2 - --
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.1/dblp-2_5.1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.1/dblp-2_5.1.3.query.aql
index 1950989..1bf3ea3 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.1/dblp-2_5.1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.1/dblp-2_5.1.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse fuzzyjoin;
+set import-private-functions 'true';
 
     //
     // -- - Stage 2 - --
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.2/dblp-2_5.2.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.2/dblp-2_5.2.3.query.aql
index f6b4832..ad5fbad 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.2/dblp-2_5.2.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.2/dblp-2_5.2.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse fuzzyjoin;
+set import-private-functions 'true';
 
     //
     // -- - Stage 2 - --
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3.1/dblp-2_5.3.1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3.1/dblp-2_5.3.1.3.query.aql
index 6ea3207..666e91b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3.1/dblp-2_5.3.1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3.1/dblp-2_5.3.1.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse fuzzyjoin;
+set import-private-functions 'true';
 
     //
     // -- - Stage 2 - --
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3/dblp-2_5.3.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3/dblp-2_5.3.3.query.aql
index 6ea3207..666e91b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3/dblp-2_5.3.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3/dblp-2_5.3.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse fuzzyjoin;
+set import-private-functions 'true';
 
     //
     // -- - Stage 2 - --
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5/dblp-2_5.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5/dblp-2_5.3.query.aql
index 81013bb..b14940f 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5/dblp-2_5.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5/dblp-2_5.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse fuzzyjoin;
+set import-private-functions 'true';
 
     //
     // -- - Stage 2 - --
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.1/dblp-3_1.1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.1/dblp-3_1.1.3.query.aql
index 039ed1b..c6260c2 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.1/dblp-3_1.1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.1/dblp-3_1.1.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse fuzzyjoin;
+set import-private-functions 'true';
 
 //
 // -- - Stage 3 - --
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.2/dblp-3_1.2.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.2/dblp-3_1.2.3.query.aql
index 2c2d349..cac9513 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.2/dblp-3_1.2.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.2/dblp-3_1.2.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse fuzzyjoin;
+set import-private-functions 'true';
 
 //
 // -- - Stage 3 - --
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1/dblp-3_1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1/dblp-3_1.3.query.aql
index 0d1976b..9763760 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1/dblp-3_1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1/dblp-3_1.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse fuzzyjoin;
+set import-private-functions 'true';
 
 //
 // -- - Stage 3 - --
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_1/dblp-csx-2_1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_1/dblp-csx-2_1.3.query.aql
index 2d3a1f2..51266cd 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_1/dblp-csx-2_1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_1/dblp-csx-2_1.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse fuzzyjoin;
+set import-private-functions 'true';
 
     //
     // -- - Stage 2 - --
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_2/dblp-csx-2_2.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_2/dblp-csx-2_2.3.query.aql
index 8847306..1482237 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_2/dblp-csx-2_2.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_2/dblp-csx-2_2.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse fuzzyjoin;
+set import-private-functions 'true';
 
     //
     // -- - Stage 2 - --
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_3/dblp-csx-2_3.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_3/dblp-csx-2_3.3.query.aql
index 4438e50..07846e7 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_3/dblp-csx-2_3.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_3/dblp-csx-2_3.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse fuzzyjoin;
+set import-private-functions 'true';
 
     //
     // -- - Stage 2 - --
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_4/dblp-csx-2_4.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_4/dblp-csx-2_4.3.query.aql
index e2fc8d1..6a6826a 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_4/dblp-csx-2_4.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_4/dblp-csx-2_4.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse fuzzyjoin;
+set import-private-functions 'true';
 
     //
     // -- - Stage 2 - --
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.1/dblp-csx-2_5.1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.1/dblp-csx-2_5.1.3.query.aql
index d6e7183..b92449f 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.1/dblp-csx-2_5.1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.1/dblp-csx-2_5.1.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse fuzzyjoin;
+set import-private-functions 'true';
 
     //
     // -- - Stage 2 - --
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.2/dblp-csx-2_5.2.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.2/dblp-csx-2_5.2.3.query.aql
index f379cf4..cab57b4 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.2/dblp-csx-2_5.2.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.2/dblp-csx-2_5.2.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse fuzzyjoin;
+set import-private-functions 'true';
 
     //
     // -- - Stage 2 - --
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3.1/dblp-csx-2_5.3.1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3.1/dblp-csx-2_5.3.1.3.query.aql
index de3c8e8..5ef887e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3.1/dblp-csx-2_5.3.1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3.1/dblp-csx-2_5.3.1.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse fuzzyjoin;
+set import-private-functions 'true';
 
     //
     // -- - Stage 2 - --
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3/dblp-csx-2_5.3.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3/dblp-csx-2_5.3.3.query.aql
index 803db8f..65b86d6 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3/dblp-csx-2_5.3.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3/dblp-csx-2_5.3.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse fuzzyjoin;
+set import-private-functions 'true';
 
     //
     // -- - Stage 2 - --
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5/dblp-csx-2_5.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5/dblp-csx-2_5.3.query.aql
index 60ea2ee..c562ba9 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5/dblp-csx-2_5.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5/dblp-csx-2_5.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse fuzzyjoin;
+set import-private-functions 'true';
 
     //
     // -- - Stage 2 - --
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_1/dblp-csx-3_1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_1/dblp-csx-3_1.3.query.aql
index 8757f02..a8e5821 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_1/dblp-csx-3_1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_1/dblp-csx-3_1.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse fuzzyjoin;
+set import-private-functions 'true';
 
 //
 // -- - Stage 3 - --
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_2/dblp-csx-3_2.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_2/dblp-csx-3_2.3.query.aql
index 7d40888..e643523 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_2/dblp-csx-3_2.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_2/dblp-csx-3_2.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse fuzzyjoin;
+set import-private-functions 'true';
 
 //
 // -- - Stage 3 - --
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_3/dblp-csx-3_3.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_3/dblp-csx-3_3.3.query.aql
index 85ace1c..2dae3af 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_3/dblp-csx-3_3.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_3/dblp-csx-3_3.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse fuzzyjoin;
+set import-private-functions 'true';
 
 //
 // -- - Stage 3 - --
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_4/dblp-csx-3_4.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_4/dblp-csx-3_4.3.query.aql
index 3574534..3f5a623 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_4/dblp-csx-3_4.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_4/dblp-csx-3_4.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse fuzzyjoin;
+set import-private-functions 'true';
 
 //
 // -- - Stage 3 - --
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.1/dblp-csx-3_5.1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.1/dblp-csx-3_5.1.3.query.aql
index 6a6dc0c..832ec5c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.1/dblp-csx-3_5.1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.1/dblp-csx-3_5.1.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse fuzzyjoin;
+set import-private-functions 'true';
 
 //
 // -- - Stage 3 - --
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.2/dblp-csx-3_5.2.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.2/dblp-csx-3_5.2.3.query.aql
index 5359b9f..e17ad08 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.2/dblp-csx-3_5.2.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.2/dblp-csx-3_5.2.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse fuzzyjoin;
+set import-private-functions 'true';
 
 //
 // -- - Stage 3 - --
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3.1/dblp-csx-3_5.3.1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3.1/dblp-csx-3_5.3.1.3.query.aql
index f0dbf23..52456d7 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3.1/dblp-csx-3_5.3.1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3.1/dblp-csx-3_5.3.1.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse fuzzyjoin;
+set import-private-functions 'true';
 
 //
 // -- - Stage 3 - --
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3/dblp-csx-3_5.3.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3/dblp-csx-3_5.3.3.query.aql
index 40aba87..ba532b9 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3/dblp-csx-3_5.3.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3/dblp-csx-3_5.3.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse fuzzyjoin;
+set import-private-functions 'true';
 
 //
 // -- - Stage 3 - --
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4.1/dblp-csx-3_5.4.1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4.1/dblp-csx-3_5.4.1.3.query.aql
index 103af68..f68ef0e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4.1/dblp-csx-3_5.4.1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4.1/dblp-csx-3_5.4.1.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse fuzzyjoin;
+set import-private-functions 'true';
 
 //
 // -- - Stage 3 - --
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4/dblp-csx-3_5.4.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4/dblp-csx-3_5.4.3.query.aql
index 2199203..ecc30bc 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4/dblp-csx-3_5.4.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4/dblp-csx-3_5.4.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse fuzzyjoin;
+set import-private-functions 'true';
 
 //
 // -- - Stage 3 - --
diff --git a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5/dblp-csx-3_5.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5/dblp-csx-3_5.3.query.aql
index 44807b2..9b80d4d 100644
--- a/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5/dblp-csx-3_5.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5/dblp-csx-3_5.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse fuzzyjoin;
+set import-private-functions 'true';
 
 //
 // -- - Stage 3 - --
diff --git a/asterix-app/src/test/resources/runtimets/queries/index-selection/fuzzy-inverted-index-ngram-jaccard/fuzzy-inverted-index-ngram-jaccard.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/index-selection/fuzzy-inverted-index-ngram-jaccard/fuzzy-inverted-index-ngram-jaccard.3.query.aql
index 79b65bb..dc18182 100644
--- a/asterix-app/src/test/resources/runtimets/queries/index-selection/fuzzy-inverted-index-ngram-jaccard/fuzzy-inverted-index-ngram-jaccard.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/index-selection/fuzzy-inverted-index-ngram-jaccard/fuzzy-inverted-index-ngram-jaccard.3.query.aql
@@ -1,6 +1,7 @@
 use dataverse test;
+set import-private-functions 'true';
 
 for $o in dataset('DBLP')
 let $jacc := similarity-jaccard-check(gram-tokens($o.title, 3, false), gram-tokens("Transactions for Cooperative Environments", 3, false), 0.5f)
 where $jacc[0]
-return $o
\ No newline at end of file
+return $o
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard-inline/ngram-jaccard-inline.4.query.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard-inline/ngram-jaccard-inline.4.query.aql
index dcd5245..1851f7c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard-inline/ngram-jaccard-inline.4.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard-inline/ngram-jaccard-inline.4.query.aql
@@ -7,6 +7,7 @@
  */
 
 use dataverse test;
+set import-private-functions 'true';
 
 for $a in dataset('DBLP')
 for $b in dataset('CSX')
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard/ngram-jaccard.4.query.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard/ngram-jaccard.4.query.aql
index 4364545..8bd1d9c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard/ngram-jaccard.4.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ngram-jaccard/ngram-jaccard.4.query.aql
@@ -6,6 +6,7 @@
  */
 
 use dataverse test;
+set import-private-functions 'true';
 
 for $a in dataset('DBLP')
 for $b in dataset('CSX')
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance-inline/olist-edit-distance-inline.4.query.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance-inline/olist-edit-distance-inline.4.query.aql
index d904c09..1a4be9b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance-inline/olist-edit-distance-inline.4.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance-inline/olist-edit-distance-inline.4.query.aql
@@ -7,6 +7,7 @@
  */
 
 use dataverse test;
+set import-private-functions 'true';
 
 for $a in dataset('Customers')
 for $b in dataset('Customers2')
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance/olist-edit-distance.4.query.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance/olist-edit-distance.4.query.aql
index b9221da..545db4a 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance/olist-edit-distance.4.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-edit-distance/olist-edit-distance.4.query.aql
@@ -6,6 +6,7 @@
  */
 
 use dataverse test;
+set import-private-functions 'true';
 
 for $a in dataset('Customers')
 for $b in dataset('Customers2')
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard-inline/olist-jaccard-inline.4.query.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard-inline/olist-jaccard-inline.4.query.aql
index 8dda04e..159b30e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard-inline/olist-jaccard-inline.4.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard-inline/olist-jaccard-inline.4.query.aql
@@ -7,6 +7,7 @@
  */
 
 use dataverse test;
+set import-private-functions 'true';
 
 for $a in dataset('Customers')
 for $b in dataset('Customers2')
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard/olist-jaccard.4.query.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard/olist-jaccard.4.query.aql
index 0af3efe..dd4f610 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard/olist-jaccard.4.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/olist-jaccard/olist-jaccard.4.query.aql
@@ -6,6 +6,7 @@
  */
 
 use dataverse test;
+set import-private-functions 'true';
 
 for $a in dataset('Customers')
 for $b in dataset('Customers2')
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard-inline/ulist-jaccard-inline.4.query.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard-inline/ulist-jaccard-inline.4.query.aql
index b7b056e..260a871 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard-inline/ulist-jaccard-inline.4.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard-inline/ulist-jaccard-inline.4.query.aql
@@ -7,6 +7,7 @@
  */
 
 use dataverse test;
+set import-private-functions 'true';
 
 for $a in dataset('Customers')
 for $b in dataset('Customers2')
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard/ulist-jaccard.4.query.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard/ulist-jaccard.4.query.aql
index 57fd37c..2fe6e28 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard/ulist-jaccard.4.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/ulist-jaccard/ulist-jaccard.4.query.aql
@@ -6,6 +6,7 @@
  */
 
 use dataverse test;
+set import-private-functions 'true';
 
 for $a in dataset('Customers')
 for $b in dataset('Customers2')
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard-inline/word-jaccard-inline.4.query.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard-inline/word-jaccard-inline.4.query.aql
index 6faa6a7..8debbfd 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard-inline/word-jaccard-inline.4.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard-inline/word-jaccard-inline.4.query.aql
@@ -7,6 +7,7 @@
  */
 
 use dataverse test;
+set import-private-functions 'true';
 
 for $a in dataset('DBLP')
 for $b in dataset('CSX')
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard/word-jaccard.4.query.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard/word-jaccard.4.query.aql
index 3db8b5f..a8684e0 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard/word-jaccard.4.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join-noeqjoin/word-jaccard/word-jaccard.4.query.aql
@@ -6,6 +6,7 @@
  */
 
 use dataverse test;
+set import-private-functions 'true';
 
 for $a in dataset('DBLP')
 for $b in dataset('CSX')
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard-inline/ngram-jaccard-inline.4.query.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard-inline/ngram-jaccard-inline.4.query.aql
index e7fc13e..4068296 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard-inline/ngram-jaccard-inline.4.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard-inline/ngram-jaccard-inline.4.query.aql
@@ -6,6 +6,7 @@
  */
 
 use dataverse test;
+set import-private-functions 'true';
 
 for $a in dataset('DBLP')
 for $b in dataset('CSX')
diff --git a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard/ngram-jaccard.4.query.aql b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard/ngram-jaccard.4.query.aql
index b237130..b64e7e1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard/ngram-jaccard.4.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/inverted-index-join/ngram-jaccard/ngram-jaccard.4.query.aql
@@ -5,6 +5,7 @@
  */
 
 use dataverse test;
+set import-private-functions 'true';
 
 for $a in dataset('DBLP')
 for $b in dataset('CSX')
diff --git a/asterix-app/src/test/resources/runtimets/queries/misc/range_01/range_01.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/misc/range_01/range_01.3.query.aql
index 439c244..a2bcb99 100644
--- a/asterix-app/src/test/resources/runtimets/queries/misc/range_01/range_01.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/misc/range_01/range_01.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse test;
+set import-private-functions 'true';
 
 for $x in range(20,30)
 return $x
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/closed-record-constructor_01/closed-record-constructor_01.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/closed-record-constructor_01/closed-record-constructor_01.3.query.aql
index 4ef8508..b4f18bf 100644
--- a/asterix-app/src/test/resources/runtimets/queries/records/closed-record-constructor_01/closed-record-constructor_01.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/records/closed-record-constructor_01/closed-record-constructor_01.3.query.aql
@@ -1,3 +1,4 @@
 use dataverse test;
+set import-private-functions 'true';
 
 closed-record-constructor("foo1", 10, "bar1", 20, "foo2", 30, "bar2", 40)
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/closed-record-constructor_02/closed-record-constructor_02.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/closed-record-constructor_02/closed-record-constructor_02.3.query.aql
index c6e3756..040a7fb 100644
--- a/asterix-app/src/test/resources/runtimets/queries/records/closed-record-constructor_02/closed-record-constructor_02.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/records/closed-record-constructor_02/closed-record-constructor_02.3.query.aql
@@ -1,3 +1,4 @@
 use dataverse test;
+set import-private-functions 'true';
 
 closed-record-constructor("foo1", 10, "bar1", closed-record-constructor("bar1.1", 10, "bar1.2", 20, "bar1.3", 30, "bar1.4", closed-record-constructor("bar1.4.1", 10, "bar1.4.2", 20, "bar1.4.3", 30, "bar1.4.4", 40), "foo2", 30, "bar2", 40), "foo2", 30, "bar2", 40)
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/closed-record-constructor_03/closed-record-constructor_03.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/closed-record-constructor_03/closed-record-constructor_03.3.query.aql
index 7285a75..416d22e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/records/closed-record-constructor_03/closed-record-constructor_03.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/records/closed-record-constructor_03/closed-record-constructor_03.3.query.aql
@@ -1,3 +1,4 @@
 use dataverse test;
+set import-private-functions 'true';
 
 {"foo1": 10, "bar1": {"bar1.1": 10, "bar1.2": 20, "bar1.3": 30, "bar1.4": {"bar1.4.1": 10, "bar1.4.2": 20 } }, "foo2": 30, "bar2": 40}
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/field-access-by-index_01/field-access-by-index_01.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/field-access-by-index_01/field-access-by-index_01.3.query.aql
index d25edc6..b5ff5ed 100644
--- a/asterix-app/src/test/resources/runtimets/queries/records/field-access-by-index_01/field-access-by-index_01.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/records/field-access-by-index_01/field-access-by-index_01.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse test;
+set import-private-functions 'true';
 
 let $x := { "foo1": 10, "bar1": 20, "foo2": 30, "bar2": 40 }
 return field-access-by-index($x,2)
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/open-record-constructor_01/open-record-constructor_01.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/open-record-constructor_01/open-record-constructor_01.3.query.aql
index d6c8701..43a8e19 100644
--- a/asterix-app/src/test/resources/runtimets/queries/records/open-record-constructor_01/open-record-constructor_01.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/records/open-record-constructor_01/open-record-constructor_01.3.query.aql
@@ -1,3 +1,4 @@
 use dataverse test;
+set import-private-functions 'true';
 
 open-record-constructor("foo1", 10, "bar1", 20, "foo2", 30, "bar2", 40)
diff --git a/asterix-app/src/test/resources/runtimets/queries/records/open-record-constructor_02/open-record-constructor_02.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/open-record-constructor_02/open-record-constructor_02.3.query.aql
index 972ecb2..9b1ea45 100644
--- a/asterix-app/src/test/resources/runtimets/queries/records/open-record-constructor_02/open-record-constructor_02.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/records/open-record-constructor_02/open-record-constructor_02.3.query.aql
@@ -1,3 +1,4 @@
 use dataverse test;
+set import-private-functions 'true';
 
 open-record-constructor("foo1", 10, "bar1", closed-record-constructor("bar1.1", 10, "bar1.2", 20, "bar1.3", 30, "bar1.4", closed-record-constructor("bar1.4.1", 10, "bar1.4.2", 20, "bar1.4.3", 30, "bar1.4.4", 40), "foo2", 30, "bar2", 40), "foo2", 30, "bar2", 40)
diff --git a/asterix-app/src/test/resources/runtimets/queries/similarity/edit-distance-list-is-filterable/edit-distance-list-is-filterable.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/similarity/edit-distance-list-is-filterable/edit-distance-list-is-filterable.3.query.aql
index 97fbd61..d2dd7e8 100644
--- a/asterix-app/src/test/resources/runtimets/queries/similarity/edit-distance-list-is-filterable/edit-distance-list-is-filterable.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/similarity/edit-distance-list-is-filterable/edit-distance-list-is-filterable.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse test;
+set import-private-functions 'true';
 
 let $a := []
 let $b := [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
diff --git a/asterix-app/src/test/resources/runtimets/queries/similarity/edit-distance-string-is-filterable/edit-distance-string-is-filterable.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/similarity/edit-distance-string-is-filterable/edit-distance-string-is-filterable.3.query.aql
index 9d55ce7..e78037f 100644
--- a/asterix-app/src/test/resources/runtimets/queries/similarity/edit-distance-string-is-filterable/edit-distance-string-is-filterable.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/similarity/edit-distance-string-is-filterable/edit-distance-string-is-filterable.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse test;
+set import-private-functions 'true';
 
 let $a := ""
 let $b := "abcdefghij"
diff --git a/asterix-app/src/test/resources/runtimets/queries/similarity/prefix-len-jaccard/prefix-len-jaccard.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/similarity/prefix-len-jaccard/prefix-len-jaccard.3.query.aql
index 1f61b15..693f83d 100644
--- a/asterix-app/src/test/resources/runtimets/queries/similarity/prefix-len-jaccard/prefix-len-jaccard.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/similarity/prefix-len-jaccard/prefix-len-jaccard.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse test;
+set import-private-functions 'true';
 
 for $l in [1]
 return [
diff --git a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-prefix-check/similarity-jaccard-prefix-check.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-prefix-check/similarity-jaccard-prefix-check.3.query.aql
index 46c0389..6863929 100644
--- a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-prefix-check/similarity-jaccard-prefix-check.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-prefix-check/similarity-jaccard-prefix-check.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse test;
+set import-private-functions 'true';
 
 for $l in [1]
 return [
diff --git a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-prefix/similarity-jaccard-prefix.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-prefix/similarity-jaccard-prefix.3.query.aql
index 10db026..18de7bf 100644
--- a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-prefix/similarity-jaccard-prefix.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-prefix/similarity-jaccard-prefix.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse test;
+set import-private-functions 'true';
 
 for $l in [1]
 return [
diff --git a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted-check_ints/similarity-jaccard-sorted-check_ints.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted-check_ints/similarity-jaccard-sorted-check_ints.3.query.aql
index 31c8b1b..2e29289 100644
--- a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted-check_ints/similarity-jaccard-sorted-check_ints.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted-check_ints/similarity-jaccard-sorted-check_ints.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse test;
+set import-private-functions 'true';
 
 let $a := [ ]
 let $b := [1, 2, 3, 4, 5]
diff --git a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted-check_query/similarity-jaccard-sorted-check_query.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted-check_query/similarity-jaccard-sorted-check_query.3.query.aql
index a8089ec..69a9a31 100644
--- a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted-check_query/similarity-jaccard-sorted-check_query.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted-check_query/similarity-jaccard-sorted-check_query.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse test;
+set import-private-functions 'true';
 
 for $paper in dataset('DBLP')
 let $paper_tokens := word-tokens($paper.title)
diff --git a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted-check_strings/similarity-jaccard-sorted-check_strings.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted-check_strings/similarity-jaccard-sorted-check_strings.3.query.aql
index 326b626..9f2bf71 100644
--- a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted-check_strings/similarity-jaccard-sorted-check_strings.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted-check_strings/similarity-jaccard-sorted-check_strings.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse test;
+set import-private-functions 'true';
 
 let $a := [ ]
 let $b := ["abc", "bcd", "cde", "def", "efg"]
diff --git a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted_ints/similarity-jaccard-sorted_ints.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted_ints/similarity-jaccard-sorted_ints.3.query.aql
index 0915bd6..61d4372 100644
--- a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted_ints/similarity-jaccard-sorted_ints.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted_ints/similarity-jaccard-sorted_ints.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse test;
+set import-private-functions 'true';
 
 let $a := [ ]
 let $b := [1, 2, 3, 4, 5]
diff --git a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted_query/similarity-jaccard-sorted_query.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted_query/similarity-jaccard-sorted_query.3.query.aql
index 6d6e2c8..9f1aa77 100644
--- a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted_query/similarity-jaccard-sorted_query.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted_query/similarity-jaccard-sorted_query.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse test;
+set import-private-functions 'true';
 
 for $paper in dataset('DBLP')
 let $paper_tokens := word-tokens($paper.title)
diff --git a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted_strings/similarity-jaccard-sorted_strings.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted_strings/similarity-jaccard-sorted_strings.3.query.aql
index 2271db0..907538f 100644
--- a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted_strings/similarity-jaccard-sorted_strings.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard-sorted_strings/similarity-jaccard-sorted_strings.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse test;
+set import-private-functions 'true';
 
 let $a := [ ]
 let $b := ["abc", "bcd", "cde", "def", "efg"]
diff --git a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard_ints/similarity-jaccard_ints.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard_ints/similarity-jaccard_ints.3.query.aql
index a76a82a..8bfb1e0 100644
--- a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard_ints/similarity-jaccard_ints.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard_ints/similarity-jaccard_ints.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse test;
+set import-private-functions 'true';
 
 let $a := [ ]
 let $b := [1, 2, 3, 4, 5]
diff --git a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard_query/similarity-jaccard_query.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard_query/similarity-jaccard_query.3.query.aql
index 86cc50f..a731d94 100644
--- a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard_query/similarity-jaccard_query.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard_query/similarity-jaccard_query.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse test;
+set import-private-functions 'true';
 
 for $paper in dataset('DBLP')
 let $paper_tokens := word-tokens($paper.title)
diff --git a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard_strings/similarity-jaccard_strings.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard_strings/similarity-jaccard_strings.3.query.aql
index b7c627e..3db4369 100644
--- a/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard_strings/similarity-jaccard_strings.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/similarity/similarity-jaccard_strings/similarity-jaccard_strings.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse test;
+set import-private-functions 'true';
 
 let $a := [ ]
 let $b := ["abc", "bcd", "cde", "def", "efg"]
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/string-equal1/string-equal1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/string/string-equal1/string-equal1.3.query.aql
index 954ac57..3e3e57a 100644
--- a/asterix-app/src/test/resources/runtimets/queries/string/string-equal1/string-equal1.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/string/string-equal1/string-equal1.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse test;
+set import-private-functions 'true';
 
 let $c1 := string-equal("test","tess")
 return {"result1": $c1}
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/string-equal2/string-equal2.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/string/string-equal2/string-equal2.3.query.aql
index 66af45d..77b837a 100644
--- a/asterix-app/src/test/resources/runtimets/queries/string/string-equal2/string-equal2.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/string/string-equal2/string-equal2.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse test;
+set import-private-functions 'true';
 
 let $c1 := string-equal("test","test")
 return {"result1": $c1}
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/string-equal3/string-equal3.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/string/string-equal3/string-equal3.3.query.aql
index fe3b341..87c0123 100644
--- a/asterix-app/src/test/resources/runtimets/queries/string/string-equal3/string-equal3.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/string/string-equal3/string-equal3.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse test;
+set import-private-functions 'true';
 
 let $c1 := string-equal("test11","test")
 return {"result1": $c1}
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/string-equal4/string-equal4.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/string/string-equal4/string-equal4.3.query.aql
index 2b5166c..1128cc5 100644
--- a/asterix-app/src/test/resources/runtimets/queries/string/string-equal4/string-equal4.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/string/string-equal4/string-equal4.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse test;
+set import-private-functions 'true';
 
 let $c1 := string-equal("","")
 let $c3 := string-equal(null,"")
diff --git a/asterix-app/src/test/resources/runtimets/queries/subset-collection/01/01.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/subset-collection/01/01.3.query.aql
index 05612a3..4341d92 100644
--- a/asterix-app/src/test/resources/runtimets/queries/subset-collection/01/01.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/subset-collection/01/01.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse test;
+set import-private-functions 'true';
 
 for $l in subset-collection([1], 0, 1)
 return $l
diff --git a/asterix-app/src/test/resources/runtimets/queries/subset-collection/02/02.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/subset-collection/02/02.3.query.aql
index 14b3e4e..666eb76 100644
--- a/asterix-app/src/test/resources/runtimets/queries/subset-collection/02/02.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/subset-collection/02/02.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse test;
+set import-private-functions 'true';
 
 for $l in subset-collection([1, 2, 3, 4], 1, 2)
 return $l
diff --git a/asterix-app/src/test/resources/runtimets/queries/subset-collection/03/03.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/subset-collection/03/03.3.query.aql
index 248bff3..aaaf487 100644
--- a/asterix-app/src/test/resources/runtimets/queries/subset-collection/03/03.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/subset-collection/03/03.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse test;
+set import-private-functions 'true';
 
 for $l in subset-collection([1, 2, 3, 4], 0, 0)
 return $l
diff --git a/asterix-app/src/test/resources/runtimets/queries/subset-collection/04/04.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/subset-collection/04/04.3.query.aql
index 0fde28a..1b41033 100644
--- a/asterix-app/src/test/resources/runtimets/queries/subset-collection/04/04.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/subset-collection/04/04.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse test;
+set import-private-functions 'true';
 
 for $l in [1]
 return subset-collection([1, 2, 3, 4], 1, 2)
diff --git a/asterix-app/src/test/resources/runtimets/queries/subset-collection/05/05.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/subset-collection/05/05.3.query.aql
index 2403754..7d369ef 100644
--- a/asterix-app/src/test/resources/runtimets/queries/subset-collection/05/05.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/subset-collection/05/05.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse test;
+set import-private-functions 'true';
 
 for $l in subset-collection(['a', 'b', 'c', 'd'], 1, 2)
 return $l
diff --git a/asterix-app/src/test/resources/runtimets/queries/subset-collection/06/06.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/subset-collection/06/06.3.query.aql
index c8e78af..e4dd90d 100644
--- a/asterix-app/src/test/resources/runtimets/queries/subset-collection/06/06.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/subset-collection/06/06.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse test;
+set import-private-functions 'true';
 
 for $l in subset-collection([1, 2, 3, 4], 2, 2)
 return $l
diff --git a/asterix-app/src/test/resources/runtimets/queries/subset-collection/07/07.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/subset-collection/07/07.3.query.aql
index 5166adf..d651d3c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/subset-collection/07/07.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/subset-collection/07/07.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse test;
+set import-private-functions 'true';
 
 for $l in subset-collection([1, 2, 3, 4], 2, 10)
 return $l
diff --git a/asterix-app/src/test/resources/runtimets/queries/temporal/calendar_duration/calendar_duration.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/temporal/calendar_duration/calendar_duration.3.query.aql
index 291d296..016f3b3 100644
--- a/asterix-app/src/test/resources/runtimets/queries/temporal/calendar_duration/calendar_duration.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/temporal/calendar_duration/calendar_duration.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse test;
+set import-private-functions 'true';
 
 let $t1 := datetime("1987-11-19T23:49:23.938")
 let $t2 := date("-1328-10-23")
diff --git a/asterix-app/src/test/resources/runtimets/queries/temporal/date_functions/date_functions.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/temporal/date_functions/date_functions.3.query.aql
index b748429..143a02b 100644
--- a/asterix-app/src/test/resources/runtimets/queries/temporal/date_functions/date_functions.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/temporal/date_functions/date_functions.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse test;
+set import-private-functions 'true';
 
 let $d1 := date-from-unix-time-in-days(15600)
 let $null1 := date-from-unix-time-in-days(null)
@@ -20,4 +21,4 @@
 let $null5 := subtract-date(null, $d2)
 let $null6 := subtract-date($d5, null)
 
-return { "date1": $d1, "date2": $d2, "date3": $d3, "date4": $d4, "date5": $d5, "duration1": $dr3, "duration2": $dr4, "c1": $c1, "c2": $c2, "null1": $null1, "null2": $null2, "null3": $null3, "null4": $null4, "null5": $null5, "null6": $null6 }
\ No newline at end of file
+return { "date1": $d1, "date2": $d2, "date3": $d3, "date4": $d4, "date5": $d5, "duration1": $dr3, "duration2": $dr4, "c1": $c1, "c2": $c2, "null1": $null1, "null2": $null2, "null3": $null3, "null4": $null4, "null5": $null5, "null6": $null6 }
diff --git a/asterix-app/src/test/resources/runtimets/queries/temporal/datetime_functions/datetime_functions.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/temporal/datetime_functions/datetime_functions.3.query.aql
index ea6c2a8..3d24549 100644
--- a/asterix-app/src/test/resources/runtimets/queries/temporal/datetime_functions/datetime_functions.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/temporal/datetime_functions/datetime_functions.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse test;
+set import-private-functions 'true';
 
 let $dt1 := datetime-from-unix-time-in-ms(956007429)
 let $null1 := datetime-from-unix-time-in-ms(null)
diff --git a/asterix-app/src/test/resources/runtimets/queries/temporal/duration_comps/duration_comps.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/temporal/duration_comps/duration_comps.3.query.aql
index 77fcc4f..d6f2346 100644
--- a/asterix-app/src/test/resources/runtimets/queries/temporal/duration_comps/duration_comps.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/temporal/duration_comps/duration_comps.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse test;
+set import-private-functions 'true';
 
 let $dr1 := duration("-P3D")
 let $dr2 := duration("P1D")
@@ -8,4 +9,4 @@
 let $dr6 := duration-from-months(months-of-year-month-duration($dr3))
 let $dr7 := duration-from-ms(ms-of-day-time-duration($dr1))
 
-return { "yearMonthGreaterComp" : year-month-duration-greater-than($dr4, $dr3), "dayTimeGreaterComp" : day-time-duration-greater-than($dr2, $dr1), "yearMonthLessComp" : year-month-duration-less-than($dr4, $dr3), "dayTimeLessComp" : day-time-duration-less-than($dr2, $dr1), "equal1": duration-equal($dr2, $dr5), "equal2": duration-equal($dr1, $dr5), "equal3": duration-equal($dr6, $dr3), "equal4": duration-equal($dr7, $dr1) }
\ No newline at end of file
+return { "yearMonthGreaterComp" : year-month-duration-greater-than($dr4, $dr3), "dayTimeGreaterComp" : day-time-duration-greater-than($dr2, $dr1), "yearMonthLessComp" : year-month-duration-less-than($dr4, $dr3), "dayTimeLessComp" : day-time-duration-less-than($dr2, $dr1), "equal1": duration-equal($dr2, $dr5), "equal2": duration-equal($dr1, $dr5), "equal3": duration-equal($dr6, $dr3), "equal4": duration-equal($dr7, $dr1) }
diff --git a/asterix-app/src/test/resources/runtimets/queries/temporal/time_functions/time_functions.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/temporal/time_functions/time_functions.3.query.aql
index c042df0..86a4a72 100644
--- a/asterix-app/src/test/resources/runtimets/queries/temporal/time_functions/time_functions.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/temporal/time_functions/time_functions.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse test;
+set import-private-functions 'true';
 
 let $t1 := time-from-unix-time-in-ms(1560074)
 let $null1 := time-from-unix-time-in-ms(null)
diff --git a/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-gram-tokens_01/counthashed-gram-tokens_01.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-gram-tokens_01/counthashed-gram-tokens_01.3.query.aql
index 7b2148c..59937c7 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-gram-tokens_01/counthashed-gram-tokens_01.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-gram-tokens_01/counthashed-gram-tokens_01.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse test;
+set import-private-functions 'true';
 
 let $txt := "Jürgen S. Generic's Car"
 let $tokens := counthashed-gram-tokens($txt, 3, false)
diff --git a/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-gram-tokens_02/counthashed-gram-tokens_02.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-gram-tokens_02/counthashed-gram-tokens_02.3.query.aql
index f871047..1b86c69 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-gram-tokens_02/counthashed-gram-tokens_02.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-gram-tokens_02/counthashed-gram-tokens_02.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse test;
+set import-private-functions 'true';
 
 let $txt := "Jürgen S. Generic's Car"
 let $tokens := counthashed-gram-tokens($txt, 3, true)
diff --git a/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-word-tokens_01/counthashed-word-tokens_01.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-word-tokens_01/counthashed-word-tokens_01.3.query.aql
index 3d44cfb..f124c3c 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-word-tokens_01/counthashed-word-tokens_01.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tokenizers/counthashed-word-tokens_01/counthashed-word-tokens_01.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse test;
+set import-private-functions 'true';
 
 let $txt := "Hello World, I would like to inform you of the importance of Foo Bar. Yes, Foo Bar. Jürgen."
 let $tokens := counthashed-word-tokens($txt)
diff --git a/asterix-app/src/test/resources/runtimets/queries/tokenizers/gram-tokens_01/gram-tokens_01.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/tokenizers/gram-tokens_01/gram-tokens_01.3.query.aql
index ae3a339..e25dc2a 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tokenizers/gram-tokens_01/gram-tokens_01.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tokenizers/gram-tokens_01/gram-tokens_01.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse test;
+set import-private-functions 'true';
 
 let $txt := "Jürgen S. Generic's Car"
 let $tokens := gram-tokens($txt, 3, false)
diff --git a/asterix-app/src/test/resources/runtimets/queries/tokenizers/gram-tokens_02/gram-tokens_02.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/tokenizers/gram-tokens_02/gram-tokens_02.3.query.aql
index 1fa90ca..4dbcf94 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tokenizers/gram-tokens_02/gram-tokens_02.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tokenizers/gram-tokens_02/gram-tokens_02.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse test;
+set import-private-functions 'true';
 
 let $txt := "Jürgen S. Generic's Car"
 let $tokens := gram-tokens($txt, 3, true)
diff --git a/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-gram-tokens_01/hashed-gram-tokens_01.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-gram-tokens_01/hashed-gram-tokens_01.3.query.aql
index 694ef83..66ebdc6 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-gram-tokens_01/hashed-gram-tokens_01.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-gram-tokens_01/hashed-gram-tokens_01.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse test;
+set import-private-functions 'true';
 
 let $txt := "Jürgen S. Generic's Car"
 let $tokens := hashed-gram-tokens($txt, 3, false)
diff --git a/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-gram-tokens_02/hashed-gram-tokens_02.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-gram-tokens_02/hashed-gram-tokens_02.3.query.aql
index 8e46d4a..4fdba79 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-gram-tokens_02/hashed-gram-tokens_02.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-gram-tokens_02/hashed-gram-tokens_02.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse test;
+set import-private-functions 'true';
 
 let $txt := "Jürgen S. Generic's Car"
 let $tokens := hashed-gram-tokens($txt, 3, true)
diff --git a/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-word-tokens_01/hashed-word-tokens_01.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-word-tokens_01/hashed-word-tokens_01.3.query.aql
index 62d8387..c87362e 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-word-tokens_01/hashed-word-tokens_01.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tokenizers/hashed-word-tokens_01/hashed-word-tokens_01.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse test;
+set import-private-functions 'true';
 
 let $txt := "Hello World, I would like to inform you of the importance of Foo Bar. Yes, Foo Bar. Jürgen."
 let $tokens := hashed-word-tokens($txt)
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q19_discounted_revenue/q19_discounted_revenue.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q19_discounted_revenue/q19_discounted_revenue.3.query.aql
index 3fd46d5..ec10939 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q19_discounted_revenue/q19_discounted_revenue.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q19_discounted_revenue/q19_discounted_revenue.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse tpch;
+set import-private-functions 'true';
 
 sum( 
 for $l in dataset('LineItem')
diff --git a/asterix-app/src/test/resources/runtimets/queries/tpch/q1_pricing_summary_report_nt/q1_pricing_summary_report_nt.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/tpch/q1_pricing_summary_report_nt/q1_pricing_summary_report_nt.3.query.aql
index b6d6c48..c27be0a 100644
--- a/asterix-app/src/test/resources/runtimets/queries/tpch/q1_pricing_summary_report_nt/q1_pricing_summary_report_nt.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/tpch/q1_pricing_summary_report_nt/q1_pricing_summary_report_nt.3.query.aql
@@ -1,4 +1,5 @@
 use dataverse tpch;
+set import-private-functions 'true';
  
 for $l in dataset('LineItem')
 where $l.l_shipdate <= '1998-09-02'
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/query-issue201/query-issue201.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/query-issue201/query-issue201.3.query.aql
index 6dc27e2..ac37c1a 100644
--- a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/query-issue201/query-issue201.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/query-issue201/query-issue201.3.query.aql
@@ -5,6 +5,7 @@
  * Date         : 26th November 2012
  */
 
+set import-private-functions 'true';
 
 let $x:=range(1,100)
 for $i in $x
diff --git a/asterix-app/src/test/resources/runtimets/testsuite.xml b/asterix-app/src/test/resources/runtimets/testsuite.xml
index 976f071..41d3922 100644
--- a/asterix-app/src/test/resources/runtimets/testsuite.xml
+++ b/asterix-app/src/test/resources/runtimets/testsuite.xml
@@ -1499,6 +1499,7 @@
   </test-group>
   -->
   <test-group name="fuzzyjoin">
+    <!-- internal function
     <test-case FilePath="fuzzyjoin">
       <compilation-unit name="dblp-1_1">
         <output-dir compare="Text">dblp-1_1</output-dir>
@@ -1519,6 +1520,8 @@
         <output-dir compare="Text">dblp-1_2</output-dir>
       </compilation-unit>
     </test-case>
+   -->
+    <!-- internal function
     <test-case FilePath="fuzzyjoin">
       <compilation-unit name="dblp-2.1_5.3.1">
         <output-dir compare="Text">dblp-2.1_5.3.1</output-dir>
@@ -1589,6 +1592,7 @@
         <output-dir compare="Text">dblp-3_1</output-dir>
       </compilation-unit>
     </test-case>
+    -->
     <test-case FilePath="fuzzyjoin">
       <compilation-unit name="dblp-aqlplus_1">
         <output-dir compare="Text">dblp-aqlplus_1</output-dir>
@@ -1600,6 +1604,7 @@
         <expected-error>edu.uci.ics.asterix.common.exceptions.AsterixException</expected-error>
       </compilation-unit>
     </test-case>
+   <!-- internal function
     <test-case FilePath="fuzzyjoin">
       <compilation-unit name="dblp-csx-2_1">
         <output-dir compare="Text">dblp-csx-2_1</output-dir>
@@ -1700,6 +1705,7 @@
         <output-dir compare="Text">dblp-csx-3_5</output-dir>
       </compilation-unit>
     </test-case>
+    -->
     <test-case FilePath="fuzzyjoin">
       <compilation-unit name="dblp-csx-aqlplus_1">
         <output-dir compare="Text">dblp-csx-aqlplus_1</output-dir>
@@ -1786,11 +1792,13 @@
         <output-dir compare="Text">fuzzy-inverted-index-ngram-edit-distance</output-dir>
       </compilation-unit>
     </test-case>
+    <!-- internal function
     <test-case FilePath="index-selection">
       <compilation-unit name="fuzzy-inverted-index-ngram-jaccard">
         <output-dir compare="Text">fuzzy-inverted-index-ngram-jaccard</output-dir>
       </compilation-unit>
     </test-case>
+    -->
     <test-case FilePath="index-selection">
       <compilation-unit name="fuzzy-inverted-index-olist-edit-distance-panic">
         <output-dir compare="Text">fuzzy-inverted-index-olist-edit-distance-panic</output-dir>
@@ -1836,11 +1844,13 @@
         <output-dir compare="Text">inverted-index-ngram-edit-distance</output-dir>
       </compilation-unit>
     </test-case>
+    <!-- internal function
     <test-case FilePath="index-selection">
       <compilation-unit name="inverted-index-ngram-jaccard">
         <output-dir compare="Text">inverted-index-ngram-jaccard</output-dir>
       </compilation-unit>
     </test-case>
+    -->
     <test-case FilePath="index-selection">
       <compilation-unit name="inverted-index-olist-edit-distance-panic">
         <output-dir compare="Text">inverted-index-olist-edit-distance-panic</output-dir>
@@ -1928,16 +1938,20 @@
         <output-dir compare="Text">ngram-edit-distance-inline</output-dir>
       </compilation-unit>
     </test-case>
+   <!-- internal function
     <test-case FilePath="inverted-index-join">
       <compilation-unit name="ngram-jaccard">
         <output-dir compare="Text">ngram-jaccard</output-dir>
       </compilation-unit>
     </test-case>
+   -->
+   <!-- internal function
     <test-case FilePath="inverted-index-join">
       <compilation-unit name="ngram-jaccard-inline">
         <output-dir compare="Text">ngram-jaccard-inline</output-dir>
       </compilation-unit>
     </test-case>
+    -->
     <test-case FilePath="inverted-index-join">
       <compilation-unit name="olist-edit-distance">
         <output-dir compare="Text">olist-edit-distance</output-dir>
@@ -1990,6 +2004,7 @@
         <output-dir compare="Text">ngram-edit-distance-inline</output-dir>
       </compilation-unit>
     </test-case>
+   <!-- internal function
     <test-case FilePath="inverted-index-join-noeqjoin">
       <compilation-unit name="ngram-jaccard">
         <output-dir compare="Text">ngram-jaccard</output-dir>
@@ -2000,6 +2015,7 @@
         <output-dir compare="Text">ngram-jaccard-inline</output-dir>
       </compilation-unit>
     </test-case>
+   -->
     <test-case FilePath="inverted-index-join-noeqjoin">
       <compilation-unit name="olist-edit-distance">
         <output-dir compare="Text">olist-edit-distance</output-dir>
@@ -2160,11 +2176,13 @@
         <output-dir compare="Text">nested-loop-join_01</output-dir>
       </compilation-unit>
     </test-case>
+   <!--
     <test-case FilePath="misc">
       <compilation-unit name="range_01">
         <output-dir compare="Text">range_01</output-dir>
       </compilation-unit>
     </test-case>
+   -->
     <test-case FilePath="misc">
       <compilation-unit name="tid_01">
         <output-dir compare="Text">tid_01</output-dir>
@@ -2794,6 +2812,7 @@
     </test-case>
   </test-group>
   <test-group name="records">
+    <!-- internal function
     <test-case FilePath="records">
       <compilation-unit name="closed-record-constructor_01">
         <output-dir compare="Text">closed-record-constructor_01</output-dir>
@@ -2809,21 +2828,25 @@
         <output-dir compare="Text">closed-record-constructor_03</output-dir>
       </compilation-unit>
     </test-case>
+    -->
     <test-case FilePath="records">
       <compilation-unit name="expFieldName">
         <output-dir compare="Text">expFieldName</output-dir>
       </compilation-unit>
     </test-case>
+    <!-- internal function
     <test-case FilePath="records">
       <compilation-unit name="field-access-by-index_01">
         <output-dir compare="Text">field-access-by-index_01</output-dir>
       </compilation-unit>
     </test-case>
+    -->
     <test-case FilePath="records">
       <compilation-unit name="field-access-on-open-field">
         <output-dir compare="Text">field-access-on-open-field</output-dir>
       </compilation-unit>
     </test-case>
+    <!-- internal function
     <test-case FilePath="records">
       <compilation-unit name="open-record-constructor_01">
         <output-dir compare="Text">open-record-constructor_01</output-dir>
@@ -2834,6 +2857,7 @@
         <output-dir compare="Text">open-record-constructor_02</output-dir>
       </compilation-unit>
     </test-case>
+    -->
     <test-case FilePath="records">
       <compilation-unit name="closed-closed-fieldname-conflict_issue173">
         <output-dir compare="Text">closed-closed-fieldname-conflict_issue173</output-dir>
@@ -2953,6 +2977,7 @@
         <output-dir compare="Text">edit-distance-check_strings</output-dir>
       </compilation-unit>
     </test-case>
+   <!-- internal function
     <test-case FilePath="similarity">
       <compilation-unit name="edit-distance-list-is-filterable">
         <output-dir compare="Text">edit-distance-list-is-filterable</output-dir>
@@ -2963,6 +2988,7 @@
         <output-dir compare="Text">edit-distance-string-is-filterable</output-dir>
       </compilation-unit>
     </test-case>
+    -->
     <test-case FilePath="similarity">
       <compilation-unit name="edit-distance_ints">
         <output-dir compare="Text">edit-distance_ints</output-dir>
@@ -2983,11 +3009,13 @@
         <output-dir compare="Text">fuzzyeq-similarity-jaccard</output-dir>
       </compilation-unit>
     </test-case>
+    <!-- internal function
     <test-case FilePath="similarity">
       <compilation-unit name="prefix-len-jaccard">
         <output-dir compare="Text">prefix-len-jaccard</output-dir>
       </compilation-unit>
     </test-case>
+    -->
     <test-case FilePath="similarity">
       <compilation-unit name="similarity-jaccard-check_ints">
         <output-dir compare="Text">similarity-jaccard-check_ints</output-dir>
@@ -3003,6 +3031,7 @@
         <output-dir compare="Text">similarity-jaccard-check_strings</output-dir>
       </compilation-unit>
     </test-case>
+    <!-- internal function
     <test-case FilePath="similarity">
       <compilation-unit name="similarity-jaccard-prefix-check">
         <output-dir compare="Text">similarity-jaccard-prefix-check</output-dir>
@@ -3028,6 +3057,8 @@
         <output-dir compare="Text">similarity-jaccard-sorted-check_strings</output-dir>
       </compilation-unit>
     </test-case>
+    -->
+   <!-- internal functions
     <test-case FilePath="similarity">
       <compilation-unit name="similarity-jaccard-sorted_ints">
         <output-dir compare="Text">similarity-jaccard-sorted_ints</output-dir>
@@ -3058,6 +3089,7 @@
         <output-dir compare="Text">similarity-jaccard_strings</output-dir>
       </compilation-unit>
     </test-case>
+   -->
   </test-group>
   <test-group name="spatial">
     <test-case FilePath="spatial">
@@ -3439,6 +3471,7 @@
         <output-dir compare="Text">string-concat1</output-dir>
       </compilation-unit>
     </test-case>
+   <!-- internal function
     <test-case FilePath="string">
       <compilation-unit name="string-equal1">
         <output-dir compare="Text">string-equal1</output-dir>
@@ -3459,6 +3492,7 @@
         <output-dir compare="Text">string-equal4</output-dir>
       </compilation-unit>
     </test-case>
+   -->
     <test-case FilePath="string">
       <compilation-unit name="string-join1">
         <output-dir compare="Text">string-join1</output-dir>
@@ -3597,6 +3631,7 @@
       </compilation-unit>
     </test-case>
   </test-group>
+  <!-- internal function
   <test-group name="subset-collection">
     <test-case FilePath="subset-collection">
       <compilation-unit name="01">
@@ -3613,13 +3648,11 @@
         <output-dir compare="Text">03</output-dir>
       </compilation-unit>
     </test-case>
-    <!--
     <test-case FilePath="subset-collection">
       <compilation-unit name="04">
         <output-dir compare="Text">04</output-dir>
       </compilation-unit>
     </test-case>
-    -->
     <test-case FilePath="subset-collection">
       <compilation-unit name="05">
         <output-dir compare="Text">05</output-dir>
@@ -3636,7 +3669,9 @@
       </compilation-unit>
     </test-case>
   </test-group>
+  -->
   <test-group name="tokenizers">
+   <!-- internal function
     <test-case FilePath="tokenizers">
       <compilation-unit name="counthashed-gram-tokens_01">
         <output-dir compare="Text">counthashed-gram-tokens_01</output-dir>
@@ -3652,6 +3687,8 @@
         <output-dir compare="Text">counthashed-word-tokens_01</output-dir>
       </compilation-unit>
     </test-case>
+    -->
+   <!-- internal function
     <test-case FilePath="tokenizers">
       <compilation-unit name="gram-tokens_01">
         <output-dir compare="Text">gram-tokens_01</output-dir>
@@ -3662,6 +3699,8 @@
         <output-dir compare="Text">gram-tokens_02</output-dir>
       </compilation-unit>
     </test-case>
+   -->
+   <!-- internal function
     <test-case FilePath="tokenizers">
       <compilation-unit name="hashed-gram-tokens_01">
         <output-dir compare="Text">hashed-gram-tokens_01</output-dir>
@@ -3677,6 +3716,7 @@
         <output-dir compare="Text">hashed-word-tokens_01</output-dir>
       </compilation-unit>
     </test-case>
+   -->
     <test-case FilePath="tokenizers">
       <compilation-unit name="word-tokens_01">
         <output-dir compare="Text">word-tokens_01</output-dir>
@@ -3749,11 +3789,13 @@
         <output-dir compare="Text">q18_large_volume_customer</output-dir>
       </compilation-unit>
     </test-case>
+    <!-- internal function
     <test-case FilePath="tpch">
       <compilation-unit name="q19_discounted_revenue">
         <output-dir compare="Text">q19_discounted_revenue</output-dir>
       </compilation-unit>
     </test-case>
+    -->
     <test-case FilePath="tpch">
       <compilation-unit name="q1_pricing_summary_report_nt">
         <output-dir compare="Text">q1_pricing_summary_report_nt</output-dir>
@@ -3935,11 +3977,13 @@
     </test-case>
   </test-group>
   <test-group name="user-defined-functions">
+   <!-- internal function
     <test-case FilePath="user-defined-functions">
       <compilation-unit name="query-issue201">
         <output-dir compare="Text">query-issue201</output-dir>
       </compilation-unit>
     </test-case>
+   -->
     <test-case FilePath="user-defined-functions">
       <compilation-unit name="udf01">
         <output-dir compare="Text">udf01</output-dir>
@@ -4202,6 +4246,7 @@
         <output-dir compare="Text">adjust_timezone</output-dir>
       </compilation-unit>
   	</test-case>
+       <!-- internal function
   	<test-case FilePath="temporal">
   		<compilation-unit name="calendar_duration">
         <output-dir compare="Text">calendar_duration</output-dir>
@@ -4217,11 +4262,14 @@
         <output-dir compare="Text">datetime_functions</output-dir>
       </compilation-unit>
   	</test-case>
-<!--   	<test-case FilePath="temporal">
-  		<compilation-unit name="insert_from_delimited_ds">
-        <output-dir compare="Text">insert_from_delimited_ds</output-dir>
-      </compilation-unit>
-  	</test-case> -->
+       -->
+        <!--
+   	<test-case FilePath="temporal">
+           <compilation-unit name="insert_from_delimited_ds">
+              <output-dir compare="Text">insert_from_delimited_ds</output-dir>
+           </compilation-unit>
+  	</test-case> 
+        -->
   	<test-case FilePath="temporal">
   		<compilation-unit name="insert_from_ext_ds">
         <output-dir compare="Text">insert_from_ext_ds</output-dir>
@@ -4232,21 +4280,25 @@
         <output-dir compare="Text">interval_functions</output-dir>
       </compilation-unit>
   	</test-case>
+        <!-- internal functions
   	<test-case FilePath="temporal">
   		<compilation-unit name="time_functions">
         <output-dir compare="Text">time_functions</output-dir>
       </compilation-unit>
   	</test-case>
+       -->
   	<test-case FilePath="constructor">
   		<compilation-unit name="interval">
         <output-dir compare="Text">interval</output-dir>
       </compilation-unit>
   	</test-case>
+        <!-- internal function
   	<test-case FilePath="temporal">
   		<compilation-unit name="duration_comps">
         <output-dir compare="Text">duration_comps</output-dir>
       </compilation-unit>
   	</test-case>
+       -->
   </test-group>
   <test-group name="leftouterjoin">
     <test-case FilePath="leftouterjoin">
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/rewrites/AqlRewriter.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/rewrites/AqlRewriter.java
index 84d8321..d581b06 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/rewrites/AqlRewriter.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/rewrites/AqlRewriter.java
@@ -66,10 +66,10 @@
 import edu.uci.ics.asterix.aql.expression.visitor.IAqlExpressionVisitor;
 import edu.uci.ics.asterix.aql.util.FunctionUtils;
 import edu.uci.ics.asterix.common.exceptions.AsterixException;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
 import edu.uci.ics.asterix.common.functions.FunctionSignature;
 import edu.uci.ics.asterix.metadata.MetadataManager;
 import edu.uci.ics.asterix.metadata.MetadataTransactionContext;
+import edu.uci.ics.asterix.metadata.declared.AqlMetadataProvider;
 import edu.uci.ics.asterix.metadata.entities.Function;
 import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
 import edu.uci.ics.asterix.om.functions.AsterixFunction;
@@ -82,6 +82,7 @@
     private final List<FunctionDecl> declaredFunctions;
     private final AqlRewritingContext context;
     private final MetadataTransactionContext mdTxnCtx;
+    private final AqlMetadataProvider metadataProvider;
 
     private enum DfsColor {
         WHITE,
@@ -89,11 +90,12 @@
         BLACK
     }
 
-    public AqlRewriter(List<FunctionDecl> declaredFunctions, Query topExpr, MetadataTransactionContext mdTxnCtx) {
+    public AqlRewriter(List<FunctionDecl> declaredFunctions, Query topExpr, AqlMetadataProvider metadataProvider) {
         this.topExpr = topExpr;
         context = new AqlRewritingContext(topExpr.getVarCounter());
         this.declaredFunctions = declaredFunctions;
-        this.mdTxnCtx = mdTxnCtx;
+        this.mdTxnCtx = metadataProvider.getMetadataTxnContext();
+        this.metadataProvider = metadataProvider;
     }
 
     public Query getExpr() {
@@ -169,8 +171,16 @@
                     buildOtherUdfs(functionDecl.getFuncBody(), functionDecls, declaredFunctions);
                 }
             } else {
+                String value = metadataProvider.getConfig().get(FunctionUtils.IMPORT_PRIVATE_FUNCTIONS);
+                boolean includePrivateFunctions = (value != null) ? Boolean.valueOf(value.toLowerCase()) : false;
+                signature.setNamespace(AsterixBuiltinFunctions.FunctionNamespace.ASTERIX_PUBLIC.name());
                 if (isBuiltinFunction(signature)) {
                     continue;
+                } else if (includePrivateFunctions) {
+                    signature.setNamespace(AsterixBuiltinFunctions.FunctionNamespace.ASTERIX_PRIVATE.name());
+                    if (isBuiltinFunction(signature)) {
+                        continue;
+                    }
                 } else {
                     throw new AsterixException(" unknown function " + signature);
                 }
@@ -190,14 +200,14 @@
 
     }
 
-    private boolean isBuiltinFunction(FunctionSignature functionSignature) {
-        if (AsterixBuiltinFunctions.isBuiltinCompilerFunction(new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-                functionSignature.getName(), functionSignature.getArity()))) {
+    private boolean isBuiltinFunction(FunctionSignature signature) {
+        if (AsterixBuiltinFunctions.isBuiltinCompilerFunction(new FunctionIdentifier(signature.getNamespace(),
+                signature.getName(), signature.getArity()))) {
             return true;
         }
 
         if (AsterixBuiltinFunctions.isBuiltinCompilerFunction(new FunctionIdentifier(
-                AlgebricksBuiltinFunctions.ALGEBRICKS_NS, functionSignature.getName(), functionSignature.getArity()))) {
+                AlgebricksBuiltinFunctions.ALGEBRICKS_NS, signature.getName(), signature.getArity()))) {
             return true;
         }
 
diff --git a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/util/FunctionUtils.java b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/util/FunctionUtils.java
index e3f3641..87525c9 100644
--- a/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/util/FunctionUtils.java
+++ b/asterix-aql/src/main/java/edu/uci/ics/asterix/aql/util/FunctionUtils.java
@@ -32,6 +32,8 @@
 
 public class FunctionUtils {
 
+    public static final String IMPORT_PRIVATE_FUNCTIONS = "import-private-functions";
+
     public static FunctionDecl getFunctionDecl(Function function) throws AsterixException {
         String functionBody = function.getFunctionBody();
         List<String> params = function.getParams();
diff --git a/asterix-common/src/main/java/edu/uci/ics/asterix/common/functions/FunctionSignature.java b/asterix-common/src/main/java/edu/uci/ics/asterix/common/functions/FunctionSignature.java
index 188593c..563b2cf 100644
--- a/asterix-common/src/main/java/edu/uci/ics/asterix/common/functions/FunctionSignature.java
+++ b/asterix-common/src/main/java/edu/uci/ics/asterix/common/functions/FunctionSignature.java
@@ -5,10 +5,10 @@
 import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
 
 public class FunctionSignature implements Serializable {
-    private final String namespace;
-    private final String name;
-    private final int arity;
-    private final String rep;
+    private  String namespace;
+    private  String name;
+    private  int arity;
+    private  String rep;
 
     public FunctionSignature(String namespace, String name, int arity) {
         this.namespace = namespace;
@@ -50,4 +50,16 @@
         return arity;
     }
 
+    public void setNamespace(String namespace) {
+        this.namespace = namespace;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public void setArity(int arity) {
+        this.arity = arity;
+    }
+
 }
diff --git a/asterix-events/src/main/java/edu/uci/ics/asterix/event/management/EventExecutor.java b/asterix-events/src/main/java/edu/uci/ics/asterix/event/management/EventExecutor.java
index 9f75973..d0c7ae0 100644
--- a/asterix-events/src/main/java/edu/uci/ics/asterix/event/management/EventExecutor.java
+++ b/asterix-events/src/main/java/edu/uci/ics/asterix/event/management/EventExecutor.java
@@ -24,6 +24,7 @@
 
 import org.apache.commons.io.IOUtils;
 
+import edu.uci.ics.asterix.common.config.AsterixProperties;
 import edu.uci.ics.asterix.event.driver.EventDriver;
 import edu.uci.ics.asterix.event.schema.cluster.Cluster;
 import edu.uci.ics.asterix.event.schema.cluster.Node;
@@ -32,95 +33,84 @@
 
 public class EventExecutor {
 
-	public static final String EVENTS_DIR = "events";
-	private static final String EXECUTE_SCRIPT = "execute.sh";
-	private static final String IP_LOCATION = "IP_LOCATION";
-	private static final String CLUSTER_ENV = "ENV";
-	private static final String SCRIPT = "SCRIPT";
-	private static final String ARGS = "ARGS";
-	private static final String DAEMON = "DAEMON";
+    public static final String EVENTS_DIR = "events";
+    private static final String EXECUTE_SCRIPT = "execute.sh";
+    private static final String IP_LOCATION = "IP_LOCATION";
+    private static final String CLUSTER_ENV = "ENV";
+    private static final String SCRIPT = "SCRIPT";
+    private static final String ARGS = "ARGS";
+    private static final String DAEMON = "DAEMON";
 
-	public void executeEvent(Node node, String script, List<String> args,
-			boolean isDaemon, Cluster cluster, Pattern pattern,
-			IOutputHandler outputHandler, EventrixClient client)
-			throws IOException {
-		List<String> pargs = new ArrayList<String>();
-		pargs.add("/bin/bash");
-		pargs.add(client.getEventsDir() + File.separator + "scripts"
-				+ File.separator + EXECUTE_SCRIPT);
-		StringBuffer envBuffer = new StringBuffer(IP_LOCATION + "="
-				+ node.getClusterIp() + " ");
-		boolean isMasterNode = node.getId().equals(
-				cluster.getMasterNode().getId());
+    public void executeEvent(Node node, String script, List<String> args, boolean isDaemon, Cluster cluster,
+            Pattern pattern, IOutputHandler outputHandler, EventrixClient client) throws IOException {
+        List<String> pargs = new ArrayList<String>();
+        pargs.add("/bin/bash");
+        pargs.add(client.getEventsDir() + File.separator + "scripts" + File.separator + EXECUTE_SCRIPT);
+        StringBuffer envBuffer = new StringBuffer(IP_LOCATION + "=" + node.getClusterIp() + " ");
+        boolean isMasterNode = node.getId().equals(cluster.getMasterNode().getId());
 
-		if (!node.getId().equals(EventDriver.CLIENT_NODE_ID)
-				&& cluster.getEnv() != null) {
-			for (Property p : cluster.getEnv().getProperty()) {
-				if (p.getKey().equals("JAVA_HOME")) {
-					String val = node.getJavaHome() == null ? p.getValue()
-							: node.getJavaHome();
-					envBuffer.append(p.getKey() + "=" + val + " ");
-				} else if (p.getKey().equals(EventUtil.NC_JAVA_OPTS)) {
-					if (!isMasterNode) {
-						StringBuilder builder = new StringBuilder();
-						builder.append("\"");
-						String javaOpts = p.getValue();
-						if (javaOpts != null) {
-							builder.append(javaOpts);
-						}
-						builder.append("\"");
-						envBuffer.append("JAVA_OPTS" + "=" + builder + " ");
-					}
-				} else if (p.getKey().equals(EventUtil.CC_JAVA_OPTS)) {
-					if (isMasterNode) {
-						StringBuilder builder = new StringBuilder();
-						builder.append("\"");
-						String javaOpts = p.getValue();
-						if (javaOpts != null) {
-							builder.append(javaOpts);
-						}
-						builder.append("\"");
-						envBuffer.append("JAVA_OPTS" + "=" + builder + " ");
-					}
-				} else if (p.getKey().equals("LOG_DIR")) {
-					String val = node.getLogDir() == null ? p.getValue() : node
-							.getLogDir();
-					envBuffer.append(p.getKey() + "=" + val + " ");
-				} else {
-					envBuffer.append(p.getKey() + "=" + p.getValue() + " ");
-				}
+        if (!node.getId().equals(EventDriver.CLIENT_NODE_ID) && cluster.getEnv() != null) {
+            for (Property p : cluster.getEnv().getProperty()) {
+                if (p.getKey().equals("JAVA_HOME")) {
+                    String val = node.getJavaHome() == null ? p.getValue() : node.getJavaHome();
+                    envBuffer.append(p.getKey() + "=" + val + " ");
+                } else if (p.getKey().equals(EventUtil.NC_JAVA_OPTS)) {
+                    if (!isMasterNode) {
+                        StringBuilder builder = new StringBuilder();
+                        builder.append("\"");
+                        String javaOpts = p.getValue();
+                        if (javaOpts != null) {
+                            builder.append(javaOpts);
+                        }
+                        builder.append("\"");
+                        envBuffer.append("JAVA_OPTS" + "=" + builder + " ");
+                    }
+                } else if (p.getKey().equals(EventUtil.CC_JAVA_OPTS)) {
+                    if (isMasterNode) {
+                        StringBuilder builder = new StringBuilder();
+                        builder.append("\"");
+                        String javaOpts = p.getValue();
+                        if (javaOpts != null) {
+                            builder.append(javaOpts);
+                        }
+                        builder.append("\"");
+                        envBuffer.append("JAVA_OPTS" + "=" + builder + " ");
+                    }
+                } else if (p.getKey().equals("LOG_DIR")) {
+                    String val = node.getLogDir() == null ? p.getValue() : node.getLogDir();
+                    envBuffer.append(p.getKey() + "=" + val + " ");
+                } else {
+                    envBuffer.append(p.getKey() + "=" + p.getValue() + " ");
+                }
 
-			}
-			pargs.add(cluster.getUsername() == null ? System
-					.getProperty("user.name") : cluster.getUsername());
-		}
+            }
+            pargs.add(cluster.getUsername() == null ? System.getProperty("user.name") : cluster.getUsername());
+        }
 
-		StringBuffer argBuffer = new StringBuffer();
-		if (args != null && args.size() > 0) {
-			for (String arg : args) {
-				argBuffer.append(arg + " ");
-			}
-		}
+        StringBuffer argBuffer = new StringBuffer();
+        if (args != null && args.size() > 0) {
+            for (String arg : args) {
+                argBuffer.append(arg + " ");
+            }
+        }
 
-		ProcessBuilder pb = new ProcessBuilder(pargs);
-		pb.environment().put(IP_LOCATION, node.getClusterIp());
-		pb.environment().put(CLUSTER_ENV, envBuffer.toString());
-		pb.environment().put(SCRIPT, script);
-		pb.environment().put(ARGS, argBuffer.toString());
-		pb.environment().put(DAEMON, isDaemon ? "true" : "false");
+        ProcessBuilder pb = new ProcessBuilder(pargs);
+        pb.environment().put(IP_LOCATION, node.getClusterIp());
+        pb.environment().put(CLUSTER_ENV, envBuffer.toString());
+        pb.environment().put(SCRIPT, script);
+        pb.environment().put(ARGS, argBuffer.toString());
+        pb.environment().put(DAEMON, isDaemon ? "true" : "false");
 
-		Process p = pb.start();
-		if (!isDaemon) {
-			BufferedInputStream bis = new BufferedInputStream(p
-					.getInputStream());
-			StringWriter writer = new StringWriter();
-			IOUtils.copy(bis, writer, "UTF-8");
-			String result = writer.getBuffer().toString();
-			OutputAnalysis analysis = outputHandler.reportEventOutput(pattern
-					.getEvent(), result);
-			if (!analysis.isExpected()) {
-				throw new IOException(analysis.getErrorMessage() + result);
-			}
-		}
-	}
+        Process p = pb.start();
+        if (!isDaemon) {
+            BufferedInputStream bis = new BufferedInputStream(p.getInputStream());
+            StringWriter writer = new StringWriter();
+            IOUtils.copy(bis, writer, "UTF-8");
+            String result = writer.getBuffer().toString();
+            OutputAnalysis analysis = outputHandler.reportEventOutput(pattern.getEvent(), result);
+            if (!analysis.isExpected()) {
+                throw new IOException(analysis.getErrorMessage() + result);
+            }
+        }
+    }
 }
diff --git a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/model/AsterixInstance.java b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/model/AsterixInstance.java
index 1eba89f..440e1fd 100644
--- a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/model/AsterixInstance.java
+++ b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/model/AsterixInstance.java
@@ -19,6 +19,7 @@
 import java.util.Date;
 import java.util.List;
 
+import edu.uci.ics.asterix.common.config.AsterixProperties;
 import edu.uci.ics.asterix.common.configuration.AsterixConfiguration;
 import edu.uci.ics.asterix.common.configuration.Property;
 import edu.uci.ics.asterix.event.schema.cluster.Cluster;
@@ -28,9 +29,7 @@
 
     private static final long serialVersionUID = 2874439550187520449L;
 
-    public static final String CC_JAVA_OPTS = "cc_java_opts";
-    public static final String NC_JAVA_OPTS = "nc_java_opts";
-
+  
     public enum State {
         ACTIVE,
         INACTIVE,
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixBuiltinFunctions.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixBuiltinFunctions.java
index bea62dc..c47b123 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixBuiltinFunctions.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixBuiltinFunctions.java
@@ -8,7 +8,6 @@
 
 import org.apache.commons.lang3.mutable.Mutable;
 
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
 import edu.uci.ics.asterix.om.typecomputer.base.IResultTypeComputer;
 import edu.uci.ics.asterix.om.typecomputer.impl.ABooleanTypeComputer;
 import edu.uci.ics.asterix.om.typecomputer.impl.ACircleTypeComputer;
@@ -102,6 +101,14 @@
         SI
     }
 
+    /*
+     * A function is categorized as public or private depending upon whether it can be used by the end-user in AQL queries.
+     */
+    public enum FunctionNamespace {
+        ASTERIX_PUBLIC,
+        ASTERIX_PRIVATE
+    }
+
     private static final FunctionInfoRepository finfoRepo = new FunctionInfoRepository();
 
     // it is supposed to be an identity mapping
@@ -117,419 +124,438 @@
     private final static Map<IFunctionInfo, IFunctionInfo> scalarToAggregateFunctionMap = new HashMap<IFunctionInfo, IFunctionInfo>();
     private static final Map<IFunctionInfo, SpatialFilterKind> spatialFilterFunctions = new HashMap<IFunctionInfo, SpatialFilterKind>();
 
-    public final static FunctionIdentifier TYPE_OF = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "type-of", 1);
-    public final static FunctionIdentifier GET_HANDLE = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "get-handle", 2);
-    public final static FunctionIdentifier GET_DATA = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "get-data",
-            2);
-    public final static FunctionIdentifier EMBED_TYPE = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "embed-type", 1);
+    public final static FunctionIdentifier TYPE_OF = new FunctionIdentifier(FunctionNamespace.ASTERIX_PRIVATE.name(),
+            "type-of", 1);
+    public final static FunctionIdentifier GET_HANDLE = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "get-handle", 2);
+    public final static FunctionIdentifier GET_DATA = new FunctionIdentifier(FunctionNamespace.ASTERIX_PRIVATE.name(),
+            "get-data", 2);
+    public final static FunctionIdentifier EMBED_TYPE = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "embed-type", 1);
 
-    public final static FunctionIdentifier GET_ITEM = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "get-item",
-            2);
-    public final static FunctionIdentifier ANY_COLLECTION_MEMBER = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "any-collection-member", 1);
-    public final static FunctionIdentifier LISTIFY = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "listify", 1);
+    public final static FunctionIdentifier GET_ITEM = new FunctionIdentifier(FunctionNamespace.ASTERIX_PRIVATE.name(),
+            "get-item", 2);
+    public final static FunctionIdentifier ANY_COLLECTION_MEMBER = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "any-collection-member", 1);
+    public final static FunctionIdentifier LISTIFY = new FunctionIdentifier(FunctionNamespace.ASTERIX_PRIVATE.name(),
+            "listify", 1);
     // public final static FunctionIdentifier BAGIFY = new
     // FunctionIdentifier(ASTERIX_NS, "bagify", 1, true);
-    public final static FunctionIdentifier LEN = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "len", 1);
+    public final static FunctionIdentifier LEN = new FunctionIdentifier(FunctionNamespace.ASTERIX_PUBLIC.name(), "len",
+            1);
 
-    public final static FunctionIdentifier CONCAT_NON_NULL = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "concat-non-null", FunctionIdentifier.VARARGS);
-    public final static FunctionIdentifier EMPTY_STREAM = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "empty-stream", 0);
-    public final static FunctionIdentifier NON_EMPTY_STREAM = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "non-empty-stream", 0);
+    public final static FunctionIdentifier CONCAT_NON_NULL = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "concat-non-null", FunctionIdentifier.VARARGS);
+    public final static FunctionIdentifier EMPTY_STREAM = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "empty-stream", 0);
+    public final static FunctionIdentifier NON_EMPTY_STREAM = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "non-empty-stream", 0);
     public final static FunctionIdentifier ORDERED_LIST_CONSTRUCTOR = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "ordered-list-constructor", FunctionIdentifier.VARARGS);
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "ordered-list-constructor", FunctionIdentifier.VARARGS);
     public final static FunctionIdentifier UNORDERED_LIST_CONSTRUCTOR = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "unordered-list-constructor", FunctionIdentifier.VARARGS);
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "unordered-list-constructor", FunctionIdentifier.VARARGS);
 
     // records
     public final static FunctionIdentifier CLOSED_RECORD_CONSTRUCTOR = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "closed-record-constructor", FunctionIdentifier.VARARGS);
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "closed-record-constructor", FunctionIdentifier.VARARGS);
     public final static FunctionIdentifier OPEN_RECORD_CONSTRUCTOR = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "open-record-constructor", FunctionIdentifier.VARARGS);
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "open-record-constructor", FunctionIdentifier.VARARGS);
     public final static FunctionIdentifier RECORD_TYPE_CONSTRUCTOR = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "record-type-constructor", FunctionIdentifier.VARARGS);
-    public final static FunctionIdentifier FIELD_ACCESS_BY_INDEX = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "field-access-by-index", 2);
-    public final static FunctionIdentifier FIELD_ACCESS_BY_NAME = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "field-access-by-name", 2);
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "record-type-constructor", FunctionIdentifier.VARARGS);
+    public final static FunctionIdentifier FIELD_ACCESS_BY_INDEX = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "field-access-by-index", 2);
+    public final static FunctionIdentifier FIELD_ACCESS_BY_NAME = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "field-access-by-name", 2);
 
-    public final static FunctionIdentifier NUMERIC_UNARY_MINUS = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "numeric-unary-minus", 1);
+    public final static FunctionIdentifier NUMERIC_UNARY_MINUS = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "numeric-unary-minus", 1);
 
-    public final static FunctionIdentifier NUMERIC_SUBTRACT = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "numeric-subtract", 2);
-    public final static FunctionIdentifier NUMERIC_MULTIPLY = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "numeric-multiply", 2);
-    public final static FunctionIdentifier NUMERIC_DIVIDE = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "numeric-divide", 2);
-    public final static FunctionIdentifier NUMERIC_MOD = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "numeric-mod", 2);
-    public final static FunctionIdentifier NUMERIC_IDIV = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "numeric-idiv", 2);
-    public final static FunctionIdentifier CARET = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "caret", 2);
+    public final static FunctionIdentifier NUMERIC_SUBTRACT = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "numeric-subtract", 2);
+    public final static FunctionIdentifier NUMERIC_MULTIPLY = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "numeric-multiply", 2);
+    public final static FunctionIdentifier NUMERIC_DIVIDE = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "numeric-divide", 2);
+    public final static FunctionIdentifier NUMERIC_MOD = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "numeric-mod", 2);
+    public final static FunctionIdentifier NUMERIC_IDIV = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "numeric-idiv", 2);
+    public final static FunctionIdentifier CARET = new FunctionIdentifier(FunctionNamespace.ASTERIX_PUBLIC.name(),
+            "caret", 2);
 
-    public final static FunctionIdentifier NUMERIC_ABS = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "numeric-abs", 1);
-    public final static FunctionIdentifier NUMERIC_CEILING = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "numeric-ceiling", 1);
-    public final static FunctionIdentifier NUMERIC_FLOOR = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "numeric-floor", 1);
-    public final static FunctionIdentifier NUMERIC_ROUND = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "numeric-round", 1);
+    public final static FunctionIdentifier NUMERIC_ABS = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "numeric-abs", 1);
+    public final static FunctionIdentifier NUMERIC_CEILING = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "numeric-ceiling", 1);
+    public final static FunctionIdentifier NUMERIC_FLOOR = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "numeric-floor", 1);
+    public final static FunctionIdentifier NUMERIC_ROUND = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "numeric-round", 1);
     public final static FunctionIdentifier NUMERIC_ROUND_HALF_TO_EVEN = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "numeric-round-half-to-even", 1);
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "numeric-round-half-to-even", 1);
     public final static FunctionIdentifier NUMERIC_ROUND_HALF_TO_EVEN2 = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "numeric-round-half-to-even", 2);
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "numeric-round-half-to-even", 2);
     // String funcitons
-    public final static FunctionIdentifier STRING_EQUAL = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "string-equal", 2);
-    public final static FunctionIdentifier STRING_START_WITH = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "start-with", 2);
-    public final static FunctionIdentifier STRING_END_WITH = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "end-with", 2);
-    public final static FunctionIdentifier STRING_MATCHES = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "matches", 2);
+    public final static FunctionIdentifier STRING_EQUAL = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "string-equal", 2);
+    public final static FunctionIdentifier STRING_START_WITH = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "start-with", 2);
+    public final static FunctionIdentifier STRING_END_WITH = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "end-with", 2);
+    public final static FunctionIdentifier STRING_MATCHES = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "matches", 2);
     public final static FunctionIdentifier STRING_MATCHES_WITH_FLAG = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "matches", 3);
-    public final static FunctionIdentifier STRING_LOWERCASE = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "lowercase", 1);
-    public final static FunctionIdentifier STRING_REPLACE = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "replace", 3);
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "matches", 3);
+    public final static FunctionIdentifier STRING_LOWERCASE = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "lowercase", 1);
+    public final static FunctionIdentifier STRING_REPLACE = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "replace", 3);
     public final static FunctionIdentifier STRING_REPLACE_WITH_FLAG = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "replace", 4);
-    public final static FunctionIdentifier STRING_LENGTH = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "string-length", 1);
-    public final static FunctionIdentifier SUBSTRING2 = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "replace", 4);
+    public final static FunctionIdentifier STRING_LENGTH = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "string-length", 1);
+    public final static FunctionIdentifier SUBSTRING2 = new FunctionIdentifier(FunctionNamespace.ASTERIX_PUBLIC.name(),
             "substring", 2);
-    public final static FunctionIdentifier SUBSTRING_BEFORE = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "substring-before", 2);
-    public final static FunctionIdentifier SUBSTRING_AFTER = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "substring-after", 2);
-    public final static FunctionIdentifier STRING_TO_CODEPOINT = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "string-to-codepoint", 1);
-    public final static FunctionIdentifier CODEPOINT_TO_STRING = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "codepoint-to-string", 1);
-    public final static FunctionIdentifier STRING_CONCAT = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "string-concat", 1);
-    public final static FunctionIdentifier STRING_JOIN = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "string-join", 2);
+    public final static FunctionIdentifier SUBSTRING_BEFORE = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "substring-before", 2);
+    public final static FunctionIdentifier SUBSTRING_AFTER = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "substring-after", 2);
+    public final static FunctionIdentifier STRING_TO_CODEPOINT = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "string-to-codepoint", 1);
+    public final static FunctionIdentifier CODEPOINT_TO_STRING = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "codepoint-to-string", 1);
+    public final static FunctionIdentifier STRING_CONCAT = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "string-concat", 1);
+    public final static FunctionIdentifier STRING_JOIN = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "string-join", 2);
 
-    public final static FunctionIdentifier DATASET = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "dataset", 1);
-    public final static FunctionIdentifier FEED_INGEST = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "feed-ingest", 1);
+    public final static FunctionIdentifier DATASET = new FunctionIdentifier(FunctionNamespace.ASTERIX_PUBLIC.name(),
+            "dataset", 1);
+    public final static FunctionIdentifier FEED_INGEST = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "feed-ingest", 1);
 
-    public final static FunctionIdentifier INDEX_SEARCH = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "index-search", FunctionIdentifier.VARARGS);
+    public final static FunctionIdentifier INDEX_SEARCH = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "index-search", FunctionIdentifier.VARARGS);
 
     public final static FunctionIdentifier MAKE_FIELD_INDEX_HANDLE = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "make-field-index-handle", 2);
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "make-field-index-handle", 2);
     public final static FunctionIdentifier MAKE_FIELD_NAME_HANDLE = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "make-field-name-handle", 1);
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "make-field-name-handle", 1);
 
-    public final static FunctionIdentifier SUBSTRING = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
+    public final static FunctionIdentifier SUBSTRING = new FunctionIdentifier(FunctionNamespace.ASTERIX_PUBLIC.name(),
             "substring", 3);
-    public final static FunctionIdentifier LIKE = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "like", 2);
-    public final static FunctionIdentifier CONTAINS = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "contains",
-            2);
-    public final static FunctionIdentifier STARTS_WITH = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "starts-with", 2);
-    public final static FunctionIdentifier ENDS_WITH = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
+    public final static FunctionIdentifier LIKE = new FunctionIdentifier(FunctionNamespace.ASTERIX_PUBLIC.name(),
+            "like", 2);
+    public final static FunctionIdentifier CONTAINS = new FunctionIdentifier(FunctionNamespace.ASTERIX_PUBLIC.name(),
+            "contains", 2);
+    public final static FunctionIdentifier STARTS_WITH = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "starts-with", 2);
+    public final static FunctionIdentifier ENDS_WITH = new FunctionIdentifier(FunctionNamespace.ASTERIX_PUBLIC.name(),
             "ends-with", 2);
 
-    public final static FunctionIdentifier AVG = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "agg-avg", 1);
-    public final static FunctionIdentifier COUNT = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "agg-count", 1);
-    public final static FunctionIdentifier SUM = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "agg-sum", 1);
-    public final static FunctionIdentifier LOCAL_SUM = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
+    public final static FunctionIdentifier AVG = new FunctionIdentifier(FunctionNamespace.ASTERIX_PRIVATE.name(),
+            "agg-avg", 1);
+    public final static FunctionIdentifier COUNT = new FunctionIdentifier(FunctionNamespace.ASTERIX_PRIVATE.name(),
+            "agg-count", 1);
+    public final static FunctionIdentifier SUM = new FunctionIdentifier(FunctionNamespace.ASTERIX_PRIVATE.name(),
+            "agg-sum", 1);
+    public final static FunctionIdentifier LOCAL_SUM = new FunctionIdentifier(FunctionNamespace.ASTERIX_PRIVATE.name(),
             "agg-local-sum", 1);
-    public final static FunctionIdentifier MAX = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "agg-max", 1);
-    public final static FunctionIdentifier LOCAL_MAX = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
+    public final static FunctionIdentifier MAX = new FunctionIdentifier(FunctionNamespace.ASTERIX_PRIVATE.name(),
+            "agg-max", 1);
+    public final static FunctionIdentifier LOCAL_MAX = new FunctionIdentifier(FunctionNamespace.ASTERIX_PRIVATE.name(),
             "agg-local-max", 1);
-    public final static FunctionIdentifier MIN = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "agg-min", 1);
-    public final static FunctionIdentifier LOCAL_MIN = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
+    public final static FunctionIdentifier MIN = new FunctionIdentifier(FunctionNamespace.ASTERIX_PRIVATE.name(),
+            "agg-min", 1);
+    public final static FunctionIdentifier LOCAL_MIN = new FunctionIdentifier(FunctionNamespace.ASTERIX_PRIVATE.name(),
             "agg-local-min", 1);
-    public final static FunctionIdentifier GLOBAL_AVG = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "agg-global-avg", 1);
-    public final static FunctionIdentifier LOCAL_AVG = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
+    public final static FunctionIdentifier GLOBAL_AVG = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "agg-global-avg", 1);
+    public final static FunctionIdentifier LOCAL_AVG = new FunctionIdentifier(FunctionNamespace.ASTERIX_PRIVATE.name(),
             "agg-local-avg", 1);
 
-    public final static FunctionIdentifier SCALAR_AVG = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "avg", 1);
-    public final static FunctionIdentifier SCALAR_COUNT = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "count",
-            1);
-    public final static FunctionIdentifier SCALAR_SUM = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "sum", 1);
-    public final static FunctionIdentifier SCALAR_MAX = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "max", 1);
-    public final static FunctionIdentifier SCALAR_MIN = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "min", 1);
-    public final static FunctionIdentifier SCALAR_GLOBAL_AVG = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "global-avg", 1);
-    public final static FunctionIdentifier SCALAR_LOCAL_AVG = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "local-avg", 1);
+    public final static FunctionIdentifier SCALAR_AVG = new FunctionIdentifier(FunctionNamespace.ASTERIX_PUBLIC.name(),
+            "avg", 1);
+    public final static FunctionIdentifier SCALAR_COUNT = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "count", 1);
+    public final static FunctionIdentifier SCALAR_SUM = new FunctionIdentifier(FunctionNamespace.ASTERIX_PUBLIC.name(),
+            "sum", 1);
+    public final static FunctionIdentifier SCALAR_MAX = new FunctionIdentifier(FunctionNamespace.ASTERIX_PUBLIC.name(),
+            "max", 1);
+    public final static FunctionIdentifier SCALAR_MIN = new FunctionIdentifier(FunctionNamespace.ASTERIX_PUBLIC.name(),
+            "min", 1);
+    public final static FunctionIdentifier SCALAR_GLOBAL_AVG = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "global-avg", 1);
+    public final static FunctionIdentifier SCALAR_LOCAL_AVG = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "local-avg", 1);
 
     // serializable aggregate functions
-    public final static FunctionIdentifier SERIAL_AVG = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "avg-serial", 1);
-    public final static FunctionIdentifier SERIAL_COUNT = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "count-serial", 1);
-    public final static FunctionIdentifier SERIAL_SUM = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "sum-serial", 1);
-    public final static FunctionIdentifier SERIAL_LOCAL_SUM = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "local-sum-serial", 1);
-    public final static FunctionIdentifier SERIAL_GLOBAL_AVG = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "global-avg-serial", 1);
-    public final static FunctionIdentifier SERIAL_LOCAL_AVG = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "local-avg-serial", 1);
+    public final static FunctionIdentifier SERIAL_AVG = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "avg-serial", 1);
+    public final static FunctionIdentifier SERIAL_COUNT = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "count-serial", 1);
+    public final static FunctionIdentifier SERIAL_SUM = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "sum-serial", 1);
+    public final static FunctionIdentifier SERIAL_LOCAL_SUM = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "local-sum-serial", 1);
+    public final static FunctionIdentifier SERIAL_GLOBAL_AVG = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "global-avg-serial", 1);
+    public final static FunctionIdentifier SERIAL_LOCAL_AVG = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "local-avg-serial", 1);
 
-    public final static FunctionIdentifier SCAN_COLLECTION = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "scan-collection", 1);
-    public final static FunctionIdentifier SUBSET_COLLECTION = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "subset-collection", 3);
+    public final static FunctionIdentifier SCAN_COLLECTION = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "scan-collection", 1);
+    public final static FunctionIdentifier SUBSET_COLLECTION = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "subset-collection", 3);
 
-    public final static FunctionIdentifier RANGE = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "range", 2);
+    public final static FunctionIdentifier RANGE = new FunctionIdentifier(FunctionNamespace.ASTERIX_PUBLIC.name(),
+            "range", 2);
 
     // fuzzy functions:
-    public final static FunctionIdentifier FUZZY_EQ = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "fuzzy-eq",
-            2);
+    public final static FunctionIdentifier FUZZY_EQ = new FunctionIdentifier(FunctionNamespace.ASTERIX_PRIVATE.name(),
+            "fuzzy-eq", 2);
 
-    public final static FunctionIdentifier PREFIX_LEN_JACCARD = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "prefix-len-jaccard", 2);
+    public final static FunctionIdentifier PREFIX_LEN_JACCARD = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "prefix-len-jaccard", 2);
 
-    public final static FunctionIdentifier SIMILARITY_JACCARD = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "similarity-jaccard", 2);
+    public final static FunctionIdentifier SIMILARITY_JACCARD = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "similarity-jaccard", 2);
     public final static FunctionIdentifier SIMILARITY_JACCARD_CHECK = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "similarity-jaccard-check", 3);
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "similarity-jaccard-check", 3);
     public final static FunctionIdentifier SIMILARITY_JACCARD_SORTED = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "similarity-jaccard-sorted", 2);
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "similarity-jaccard-sorted", 2);
     public final static FunctionIdentifier SIMILARITY_JACCARD_SORTED_CHECK = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "similarity-jaccard-sorted-check", 3);
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "similarity-jaccard-sorted-check", 3);
     public final static FunctionIdentifier SIMILARITY_JACCARD_PREFIX = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "similarity-jaccard-prefix", 6);
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "similarity-jaccard-prefix", 6);
     public final static FunctionIdentifier SIMILARITY_JACCARD_PREFIX_CHECK = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "similarity-jaccard-prefix-check", 6);
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "similarity-jaccard-prefix-check", 6);
 
-    public final static FunctionIdentifier EDIT_DISTANCE = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "edit-distance", 2);
-    public final static FunctionIdentifier EDIT_DISTANCE_CHECK = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "edit-distance-check", 3);
+    public final static FunctionIdentifier EDIT_DISTANCE = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "edit-distance", 2);
+    public final static FunctionIdentifier EDIT_DISTANCE_CHECK = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "edit-distance-check", 3);
     public final static FunctionIdentifier EDIT_DISTANCE_LIST_IS_FILTERABLE = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "edit-distance-list-is-filterable", 2);
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "edit-distance-list-is-filterable", 2);
     public final static FunctionIdentifier EDIT_DISTANCE_STRING_IS_FILTERABLE = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "edit-distance-string-is-filterable", 4);
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "edit-distance-string-is-filterable", 4);
 
     // tokenizers:
-    public final static FunctionIdentifier WORD_TOKENS = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "word-tokens", 1);
-    public final static FunctionIdentifier HASHED_WORD_TOKENS = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "hashed-word-tokens", 1);
+    public final static FunctionIdentifier WORD_TOKENS = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "word-tokens", 1);
+    public final static FunctionIdentifier HASHED_WORD_TOKENS = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "hashed-word-tokens", 1);
     public final static FunctionIdentifier COUNTHASHED_WORD_TOKENS = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "counthashed-word-tokens", 1);
-    public final static FunctionIdentifier GRAM_TOKENS = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "gram-tokens", 3);
-    public final static FunctionIdentifier HASHED_GRAM_TOKENS = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "hashed-gram-tokens", 3);
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "counthashed-word-tokens", 1);
+    public final static FunctionIdentifier GRAM_TOKENS = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "gram-tokens", 3);
+    public final static FunctionIdentifier HASHED_GRAM_TOKENS = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "hashed-gram-tokens", 3);
     public final static FunctionIdentifier COUNTHASHED_GRAM_TOKENS = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "counthashed-gram-tokens", 3);
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "counthashed-gram-tokens", 3);
 
-    public final static FunctionIdentifier TID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "tid", 0);
+    public final static FunctionIdentifier TID = new FunctionIdentifier(FunctionNamespace.ASTERIX_PUBLIC.name(), "tid",
+            0);
 
     // constructors:
-    public final static FunctionIdentifier BOOLEAN_CONSTRUCTOR = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "boolean", 1);
-    public final static FunctionIdentifier NULL_CONSTRUCTOR = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "null", 1);
-    public final static FunctionIdentifier STRING_CONSTRUCTOR = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "string", 1);
-    public final static FunctionIdentifier INT8_CONSTRUCTOR = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "int8", 1);
-    public final static FunctionIdentifier INT16_CONSTRUCTOR = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "int16", 1);
-    public final static FunctionIdentifier INT32_CONSTRUCTOR = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "int32", 1);
-    public final static FunctionIdentifier INT64_CONSTRUCTOR = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "int64", 1);
-    public final static FunctionIdentifier FLOAT_CONSTRUCTOR = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "float", 1);
-    public final static FunctionIdentifier DOUBLE_CONSTRUCTOR = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "double", 1);
-    public final static FunctionIdentifier POINT_CONSTRUCTOR = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "point", 1);
-    public final static FunctionIdentifier POINT3D_CONSTRUCTOR = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "point3d", 1);
-    public final static FunctionIdentifier LINE_CONSTRUCTOR = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "line", 1);
-    public final static FunctionIdentifier CIRCLE_CONSTRUCTOR = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "circle", 1);
-    public final static FunctionIdentifier RECTANGLE_CONSTRUCTOR = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "rectangle", 1);
-    public final static FunctionIdentifier POLYGON_CONSTRUCTOR = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "polygon", 1);
-    public final static FunctionIdentifier TIME_CONSTRUCTOR = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "time", 1);
-    public final static FunctionIdentifier DATE_CONSTRUCTOR = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "date", 1);
-    public final static FunctionIdentifier DATETIME_CONSTRUCTOR = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "datetime", 1);
-    public final static FunctionIdentifier DURATION_CONSTRUCTOR = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "duration", 1);
+    public final static FunctionIdentifier BOOLEAN_CONSTRUCTOR = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "boolean", 1);
+    public final static FunctionIdentifier NULL_CONSTRUCTOR = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "null", 1);
+    public final static FunctionIdentifier STRING_CONSTRUCTOR = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "string", 1);
+    public final static FunctionIdentifier INT8_CONSTRUCTOR = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "int8", 1);
+    public final static FunctionIdentifier INT16_CONSTRUCTOR = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "int16", 1);
+    public final static FunctionIdentifier INT32_CONSTRUCTOR = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "int32", 1);
+    public final static FunctionIdentifier INT64_CONSTRUCTOR = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "int64", 1);
+    public final static FunctionIdentifier FLOAT_CONSTRUCTOR = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "float", 1);
+    public final static FunctionIdentifier DOUBLE_CONSTRUCTOR = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "double", 1);
+    public final static FunctionIdentifier POINT_CONSTRUCTOR = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "point", 1);
+    public final static FunctionIdentifier POINT3D_CONSTRUCTOR = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "point3d", 1);
+    public final static FunctionIdentifier LINE_CONSTRUCTOR = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "line", 1);
+    public final static FunctionIdentifier CIRCLE_CONSTRUCTOR = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "circle", 1);
+    public final static FunctionIdentifier RECTANGLE_CONSTRUCTOR = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "rectangle", 1);
+    public final static FunctionIdentifier POLYGON_CONSTRUCTOR = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "polygon", 1);
+    public final static FunctionIdentifier TIME_CONSTRUCTOR = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "time", 1);
+    public final static FunctionIdentifier DATE_CONSTRUCTOR = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "date", 1);
+    public final static FunctionIdentifier DATETIME_CONSTRUCTOR = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "datetime", 1);
+    public final static FunctionIdentifier DURATION_CONSTRUCTOR = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "duration", 1);
     public final static FunctionIdentifier INTERVAL_CONSTRUCTOR_DATE = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "interval-from-date", 2);
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "interval-from-date", 2);
     public final static FunctionIdentifier INTERVAL_CONSTRUCTOR_TIME = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "interval-from-time", 2);
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "interval-from-time", 2);
     public final static FunctionIdentifier INTERVAL_CONSTRUCTOR_DATETIME = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "interval-from-datetime", 2);
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "interval-from-datetime", 2);
     public final static FunctionIdentifier INTERVAL_CONSTRUCTOR_START_FROM_DATE = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "interval-start-from-date", 2);
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "interval-start-from-date", 2);
     public final static FunctionIdentifier INTERVAL_CONSTRUCTOR_START_FROM_TIME = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "interval-start-from-time", 2);
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "interval-start-from-time", 2);
     public final static FunctionIdentifier INTERVAL_CONSTRUCTOR_START_FROM_DATETIME = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "interval-start-from-datetime", 2);
-    public final static FunctionIdentifier INTERVAL_BEFORE = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "interval-before", 2);
-    public final static FunctionIdentifier INTERVAL_AFTER = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "interval-after", 2);
-    public final static FunctionIdentifier INTERVAL_MEETS = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "interval-meets", 2);
-    public final static FunctionIdentifier INTERVAL_MET_BY = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "interval-met-by", 2);
-    public final static FunctionIdentifier INTERVAL_OVERLAPS = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "interval-overlaps", 2);
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "interval-start-from-datetime", 2);
+    public final static FunctionIdentifier INTERVAL_BEFORE = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "interval-before", 2);
+    public final static FunctionIdentifier INTERVAL_AFTER = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "interval-after", 2);
+    public final static FunctionIdentifier INTERVAL_MEETS = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "interval-meets", 2);
+    public final static FunctionIdentifier INTERVAL_MET_BY = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "interval-met-by", 2);
+    public final static FunctionIdentifier INTERVAL_OVERLAPS = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "interval-overlaps", 2);
     public final static FunctionIdentifier INTERVAL_OVERLAPPED_BY = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "interval-overlapped-by", 2);
-    public final static FunctionIdentifier OVERLAP = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "overlap", 2);
-    public final static FunctionIdentifier INTERVAL_STARTS = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "interval-starts", 2);
-    public final static FunctionIdentifier INTERVAL_STARTED_BY = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "interval-started-by", 2);
-    public final static FunctionIdentifier INTERVAL_COVERS = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "interval-covers", 2);
-    public final static FunctionIdentifier INTERVAL_COVERED_BY = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "interval-covered-by", 2);
-    public final static FunctionIdentifier INTERVAL_ENDS = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "interval-ends", 2);
-    public final static FunctionIdentifier INTERVAL_ENDED_BY = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "interval-ended-by", 2);
-    public final static FunctionIdentifier CURRENT_TIME = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "current-time", 0);
-    public final static FunctionIdentifier CURRENT_DATE = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "current-date", 0);
-    public final static FunctionIdentifier CURRENT_DATETIME = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "current-datetime", 0);
-    public final static FunctionIdentifier DURATION_EQUAL = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "duration-equal", 2);
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "interval-overlapped-by", 2);
+    public final static FunctionIdentifier OVERLAP = new FunctionIdentifier(FunctionNamespace.ASTERIX_PUBLIC.name(),
+            "overlap", 2);
+    public final static FunctionIdentifier INTERVAL_STARTS = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "interval-starts", 2);
+    public final static FunctionIdentifier INTERVAL_STARTED_BY = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "interval-started-by", 2);
+    public final static FunctionIdentifier INTERVAL_COVERS = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "interval-covers", 2);
+    public final static FunctionIdentifier INTERVAL_COVERED_BY = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "interval-covered-by", 2);
+    public final static FunctionIdentifier INTERVAL_ENDS = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "interval-ends", 2);
+    public final static FunctionIdentifier INTERVAL_ENDED_BY = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "interval-ended-by", 2);
+    public final static FunctionIdentifier CURRENT_TIME = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "current-time", 0);
+    public final static FunctionIdentifier CURRENT_DATE = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "current-date", 0);
+    public final static FunctionIdentifier CURRENT_DATETIME = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "current-datetime", 0);
+    public final static FunctionIdentifier DURATION_EQUAL = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "duration-equal", 2);
     public final static FunctionIdentifier YEAR_MONTH_DURATION_GREATER_THAN = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "year-month-duration-greater-than", 2);
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "year-month-duration-greater-than", 2);
     public final static FunctionIdentifier YEAR_MONTH_DURATION_LESS_THAN = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "year-month-duration-less-than", 2);
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "year-month-duration-less-than", 2);
     public final static FunctionIdentifier DAY_TIME_DURATION_GREATER_THAN = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "day-time-duration-greater-than", 2);
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "day-time-duration-greater-than", 2);
     public final static FunctionIdentifier DAY_TIME_DURATION_LESS_THAN = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "day-time-duration-less-than", 2);
-    public final static FunctionIdentifier DURATION_FROM_MONTHS = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "duration-from-months", 1);
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "day-time-duration-less-than", 2);
+    public final static FunctionIdentifier DURATION_FROM_MONTHS = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "duration-from-months", 1);
     public final static FunctionIdentifier MONTHS_OF_YEAR_MONTH_DURATION = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "months-of-year-month-duration", 1);
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "months-of-year-month-duration", 1);
     public final static FunctionIdentifier DURATION_FROM_MILLISECONDS = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "duration-from-ms", 1);
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "duration-from-ms", 1);
     public final static FunctionIdentifier MILLISECONDS_OF_DAY_TIME_DURATION = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "ms-of-day-time-duration", 1);
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "ms-of-day-time-duration", 1);
 
     // spatial
-    public final static FunctionIdentifier CREATE_POINT = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "create-point", 2);
-    public final static FunctionIdentifier CREATE_LINE = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "create-line", 2);
-    public final static FunctionIdentifier CREATE_POLYGON = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "create-polygon", FunctionIdentifier.VARARGS);
-    public final static FunctionIdentifier CREATE_CIRCLE = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "create-circle", 2);
-    public final static FunctionIdentifier CREATE_RECTANGLE = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "create-rectangle", 2);
-    public final static FunctionIdentifier SPATIAL_INTERSECT = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "spatial-intersect", 2);
-    public final static FunctionIdentifier SPATIAL_AREA = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "spatial-area", 1);
-    public final static FunctionIdentifier SPATIAL_DISTANCE = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "spatial-distance", 2);
-    public final static FunctionIdentifier CREATE_MBR = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
+    public final static FunctionIdentifier CREATE_POINT = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "create-point", 2);
+    public final static FunctionIdentifier CREATE_LINE = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "create-line", 2);
+    public final static FunctionIdentifier CREATE_POLYGON = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "create-polygon", FunctionIdentifier.VARARGS);
+    public final static FunctionIdentifier CREATE_CIRCLE = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "create-circle", 2);
+    public final static FunctionIdentifier CREATE_RECTANGLE = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "create-rectangle", 2);
+    public final static FunctionIdentifier SPATIAL_INTERSECT = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "spatial-intersect", 2);
+    public final static FunctionIdentifier SPATIAL_AREA = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "spatial-area", 1);
+    public final static FunctionIdentifier SPATIAL_DISTANCE = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "spatial-distance", 2);
+    public final static FunctionIdentifier CREATE_MBR = new FunctionIdentifier(FunctionNamespace.ASTERIX_PUBLIC.name(),
             "create-mbr", 3);
-    public final static FunctionIdentifier SPATIAL_CELL = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "spatial-cell", 4);
-    public final static FunctionIdentifier SWITCH_CASE = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "switch-case", FunctionIdentifier.VARARGS);
-    public final static FunctionIdentifier REG_EXP = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "reg-exp", 2);
+    public final static FunctionIdentifier SPATIAL_CELL = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "spatial-cell", 4);
+    public final static FunctionIdentifier SWITCH_CASE = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "switch-case", FunctionIdentifier.VARARGS);
+    public final static FunctionIdentifier REG_EXP = new FunctionIdentifier(FunctionNamespace.ASTERIX_PRIVATE.name(),
+            "reg-exp", 2);
 
-    public final static FunctionIdentifier INJECT_FAILURE = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "inject-failure", 2);
-    public final static FunctionIdentifier CAST_RECORD = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "cast-record", 1);
-    public final static FunctionIdentifier CAST_LIST = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
+    public final static FunctionIdentifier INJECT_FAILURE = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "inject-failure", 2);
+    public final static FunctionIdentifier CAST_RECORD = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "cast-record", 1);
+    public final static FunctionIdentifier CAST_LIST = new FunctionIdentifier(FunctionNamespace.ASTERIX_PUBLIC.name(),
             "cast-list", 1);
 
     // Spatial and temporal type accessors
     public static final FunctionIdentifier ACCESSOR_TEMPORAL_YEAR = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "year", 1);
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "year", 1);
     public static final FunctionIdentifier ACCESSOR_TEMPORAL_MONTH = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "month", 1);
-    public static final FunctionIdentifier ACCESSOR_TEMPORAL_DAY = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "day", 1);
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "month", 1);
+    public static final FunctionIdentifier ACCESSOR_TEMPORAL_DAY = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "day", 1);
     public static final FunctionIdentifier ACCESSOR_TEMPORAL_HOUR = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "hour", 1);
-    public static final FunctionIdentifier ACCESSOR_TEMPORAL_MIN = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "minute", 1);
-    public static final FunctionIdentifier ACCESSOR_TEMPORAL_SEC = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "second", 1);
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "hour", 1);
+    public static final FunctionIdentifier ACCESSOR_TEMPORAL_MIN = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "minute", 1);
+    public static final FunctionIdentifier ACCESSOR_TEMPORAL_SEC = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "second", 1);
     public static final FunctionIdentifier ACCESSOR_TEMPORAL_MILLISEC = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "millisecond", 1);
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "millisecond", 1);
     public static final FunctionIdentifier ACCESSOR_TEMPORAL_INTERVAL_START = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "get-interval-start", 1);
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "get-interval-start", 1);
     public static final FunctionIdentifier ACCESSOR_TEMPORAL_INTERVAL_END = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "get-interval-end", 1);
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "get-interval-end", 1);
 
     // Temporal functions
     public static final FunctionIdentifier DATE_FROM_UNIX_TIME_IN_DAYS = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "date-from-unix-time-in-days", 1);
-    public static final FunctionIdentifier DATE_FROM_DATETIME = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "date-from-datetime", 1);
-    public final static FunctionIdentifier ADD_DATE_DURATION = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "add-date-duration", 2);
-    public final static FunctionIdentifier SUBTRACT_DATE = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "subtract-date", 2);
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "date-from-unix-time-in-days", 1);
+    public static final FunctionIdentifier DATE_FROM_DATETIME = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "date-from-datetime", 1);
+    public final static FunctionIdentifier ADD_DATE_DURATION = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "add-date-duration", 2);
+    public final static FunctionIdentifier SUBTRACT_DATE = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "subtract-date", 2);
     public final static FunctionIdentifier TIME_FROM_UNIX_TIME_IN_MS = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "time-from-unix-time-in-ms", 1);
-    public final static FunctionIdentifier TIME_FROM_DATETIME = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "time-from-datetime", 1);
-    public final static FunctionIdentifier SUBTRACT_TIME = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "subtract-time", 2);
-    public final static FunctionIdentifier ADD_TIME_DURATION = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "add-time-duration", 2);
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "time-from-unix-time-in-ms", 1);
+    public final static FunctionIdentifier TIME_FROM_DATETIME = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "time-from-datetime", 1);
+    public final static FunctionIdentifier SUBTRACT_TIME = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "subtract-time", 2);
+    public final static FunctionIdentifier ADD_TIME_DURATION = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "add-time-duration", 2);
     public final static FunctionIdentifier DATETIME_FROM_UNIX_TIME_IN_MS = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "datetime-from-unix-time-in-ms", 1);
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "datetime-from-unix-time-in-ms", 1);
     public final static FunctionIdentifier DATETIME_FROM_DATE_TIME = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "datetime-from-date-time", 2);
-    public final static FunctionIdentifier SUBTRACT_DATETIME = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "subtract-datetime", 2);
-    public final static FunctionIdentifier ADD_DATETIME_DURATION = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "add-datetime-duration", 2);
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "datetime-from-date-time", 2);
+    public final static FunctionIdentifier SUBTRACT_DATETIME = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "subtract-datetime", 2);
+    public final static FunctionIdentifier ADD_DATETIME_DURATION = new FunctionIdentifier(
+            FunctionNamespace.ASTERIX_PRIVATE.name(), "add-datetime-duration", 2);
     public final static FunctionIdentifier CALENDAR_DURATION_FROM_DATETIME = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "calendar-duration-from-datetime", 2);
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "calendar-duration-from-datetime", 2);
     public final static FunctionIdentifier CALENDAR_DURATION_FROM_DATE = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "calendar-duration-from-date", 2);
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "calendar-duration-from-date", 2);
     public final static FunctionIdentifier ADJUST_TIME_FOR_TIMEZONE = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "adjust-time-for-timezone", 2);
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "adjust-time-for-timezone", 2);
     public final static FunctionIdentifier ADJUST_DATETIME_FOR_TIMEZONE = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "adjust-datetime-for-timezone", 2);
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "adjust-datetime-for-timezone", 2);
 
     public final static FunctionIdentifier GET_POINT_X_COORDINATE_ACCESSOR = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "get-x", 1);
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "get-x", 1);
     public final static FunctionIdentifier GET_POINT_Y_COORDINATE_ACCESSOR = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "get-y", 1);
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "get-y", 1);
     public final static FunctionIdentifier GET_CIRCLE_RADIUS_ACCESSOR = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "get-radius", 1);
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "get-radius", 1);
     public final static FunctionIdentifier GET_CIRCLE_CENTER_ACCESSOR = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "get-center", 1);
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "get-center", 1);
     public final static FunctionIdentifier GET_POINTS_LINE_RECTANGLE_POLYGON_ACCESSOR = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "get-points", 1);
+            FunctionNamespace.ASTERIX_PUBLIC.name(), "get-points", 1);
 
     public static final FunctionIdentifier EQ = AlgebricksBuiltinFunctions.EQ;
     public static final FunctionIdentifier LE = AlgebricksBuiltinFunctions.LE;
@@ -543,8 +569,8 @@
     public static final FunctionIdentifier NUMERIC_ADD = AlgebricksBuiltinFunctions.NUMERIC_ADD;
     public static final FunctionIdentifier IS_NULL = AlgebricksBuiltinFunctions.IS_NULL;
 
-    public static final FunctionIdentifier NOT_NULL = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "not-null",
-            1);
+    public static final FunctionIdentifier NOT_NULL = new FunctionIdentifier(FunctionNamespace.ASTERIX_PRIVATE.name(),
+            "not-null", 1);
 
     public static IFunctionInfo getAsterixFunctionInfo(FunctionIdentifier fid) {
         IFunctionInfo finfo = finfoRepo.get(fid);;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/scalar/ScalarAvgAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/scalar/ScalarAvgAggregateDescriptor.java
index ae2a485..fa8f930 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/scalar/ScalarAvgAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/scalar/ScalarAvgAggregateDescriptor.java
@@ -1,6 +1,6 @@
 package edu.uci.ics.asterix.runtime.aggregates.scalar;
 
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
 import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
@@ -8,7 +8,7 @@
 public class ScalarAvgAggregateDescriptor extends AbstractScalarAggregateDescriptor {
 
     private static final long serialVersionUID = 1L;
-    public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "avg", 1);
+    public final static FunctionIdentifier FID = AsterixBuiltinFunctions.SCALAR_AVG;
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
         public IFunctionDescriptor createFunctionDescriptor() {
             return new ScalarAvgAggregateDescriptor();
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/scalar/ScalarCountAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/scalar/ScalarCountAggregateDescriptor.java
index 6f3baa6..1f362c9 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/scalar/ScalarCountAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/scalar/ScalarCountAggregateDescriptor.java
@@ -1,6 +1,6 @@
 package edu.uci.ics.asterix.runtime.aggregates.scalar;
 
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
 import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
@@ -8,7 +8,7 @@
 public class ScalarCountAggregateDescriptor extends AbstractScalarAggregateDescriptor {
 
     private static final long serialVersionUID = 1L;
-    public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "count", 1);
+    public final static FunctionIdentifier FID = AsterixBuiltinFunctions.SCALAR_COUNT;
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
         public IFunctionDescriptor createFunctionDescriptor() {
             return new ScalarCountAggregateDescriptor();
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/scalar/ScalarMaxAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/scalar/ScalarMaxAggregateDescriptor.java
index a71eb3c..26cb74e 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/scalar/ScalarMaxAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/scalar/ScalarMaxAggregateDescriptor.java
@@ -1,6 +1,6 @@
 package edu.uci.ics.asterix.runtime.aggregates.scalar;
 
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
 import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
@@ -8,7 +8,7 @@
 public class ScalarMaxAggregateDescriptor extends AbstractScalarAggregateDescriptor {
 
     private static final long serialVersionUID = 1L;
-    public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "max", 1);
+    public final static FunctionIdentifier FID = AsterixBuiltinFunctions.SCALAR_MAX;
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
         public IFunctionDescriptor createFunctionDescriptor() {
             return new ScalarMaxAggregateDescriptor();
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/scalar/ScalarMinAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/scalar/ScalarMinAggregateDescriptor.java
index 4beae60..4d2bbd4 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/scalar/ScalarMinAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/scalar/ScalarMinAggregateDescriptor.java
@@ -1,6 +1,6 @@
 package edu.uci.ics.asterix.runtime.aggregates.scalar;
 
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
 import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
@@ -8,7 +8,7 @@
 public class ScalarMinAggregateDescriptor extends AbstractScalarAggregateDescriptor {
 
     private static final long serialVersionUID = 1L;
-    public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "min", 1);
+    public final static FunctionIdentifier FID = AsterixBuiltinFunctions.SCALAR_MIN;
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
         public IFunctionDescriptor createFunctionDescriptor() {
             return new ScalarMinAggregateDescriptor();
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/scalar/ScalarSumAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/scalar/ScalarSumAggregateDescriptor.java
index f3d9d1a..c82e3e2 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/scalar/ScalarSumAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/scalar/ScalarSumAggregateDescriptor.java
@@ -1,6 +1,6 @@
 package edu.uci.ics.asterix.runtime.aggregates.scalar;
 
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
 import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
@@ -8,7 +8,7 @@
 public class ScalarSumAggregateDescriptor extends AbstractScalarAggregateDescriptor {
 
     private static final long serialVersionUID = 1L;
-    public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "sum", 1);
+    public final static FunctionIdentifier FID = AsterixBuiltinFunctions.SCALAR_SUM;
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
         public IFunctionDescriptor createFunctionDescriptor() {
             return new ScalarSumAggregateDescriptor();
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableLocalSumAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableLocalSumAggregateDescriptor.java
index 6badf0f..c3ee985 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableLocalSumAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableLocalSumAggregateDescriptor.java
@@ -1,6 +1,6 @@
 package edu.uci.ics.asterix.runtime.aggregates.serializable.std;
 
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
 import edu.uci.ics.asterix.runtime.aggregates.base.AbstractSerializableAggregateFunctionDynamicDescriptor;
@@ -13,8 +13,7 @@
 public class SerializableLocalSumAggregateDescriptor extends AbstractSerializableAggregateFunctionDynamicDescriptor {
 
     private static final long serialVersionUID = 1L;
-    private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "local-sum-serial", 1);
+    private final static FunctionIdentifier FID = AsterixBuiltinFunctions.SERIAL_LOCAL_SUM;
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
         public IFunctionDescriptor createFunctionDescriptor() {
             return new SerializableLocalSumAggregateDescriptor();
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/LocalMaxAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/LocalMaxAggregateDescriptor.java
index 59287d5..e7346a8 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/LocalMaxAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/LocalMaxAggregateDescriptor.java
@@ -1,6 +1,6 @@
 package edu.uci.ics.asterix.runtime.aggregates.std;
 
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
 import edu.uci.ics.asterix.runtime.aggregates.base.AbstractAggregateFunctionDynamicDescriptor;
@@ -14,8 +14,8 @@
 public class LocalMaxAggregateDescriptor extends AbstractAggregateFunctionDynamicDescriptor {
 
     private static final long serialVersionUID = 1L;
-    private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "agg-local-max",
-            1);
+    private final static FunctionIdentifier FID = AsterixBuiltinFunctions.LOCAL_MAX;
+
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
         public IFunctionDescriptor createFunctionDescriptor() {
             return new LocalMaxAggregateDescriptor();
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/LocalMinAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/LocalMinAggregateDescriptor.java
index ca32e2f..9e6747d 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/LocalMinAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/LocalMinAggregateDescriptor.java
@@ -1,6 +1,7 @@
 package edu.uci.ics.asterix.runtime.aggregates.std;
 
 import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
 import edu.uci.ics.asterix.runtime.aggregates.base.AbstractAggregateFunctionDynamicDescriptor;
@@ -14,8 +15,7 @@
 public class LocalMinAggregateDescriptor extends AbstractAggregateFunctionDynamicDescriptor {
 
     private static final long serialVersionUID = 1L;
-    private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "agg-local-min",
-            1);
+    private final static FunctionIdentifier FID = AsterixBuiltinFunctions.LOCAL_MIN;
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
         public IFunctionDescriptor createFunctionDescriptor() {
             return new LocalMinAggregateDescriptor();
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/LocalSumAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/LocalSumAggregateDescriptor.java
index c133e09..01f6d28 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/LocalSumAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/LocalSumAggregateDescriptor.java
@@ -1,6 +1,7 @@
 package edu.uci.ics.asterix.runtime.aggregates.std;
 
 import edu.uci.ics.asterix.common.functions.FunctionConstants;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
 import edu.uci.ics.asterix.runtime.aggregates.base.AbstractAggregateFunctionDynamicDescriptor;
@@ -14,8 +15,7 @@
 public class LocalSumAggregateDescriptor extends AbstractAggregateFunctionDynamicDescriptor {
 
     private static final long serialVersionUID = 1L;
-    private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "agg-local-sum",
-            1);
+    private final static FunctionIdentifier FID = AsterixBuiltinFunctions.LOCAL_SUM;
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
         public IFunctionDescriptor createFunctionDescriptor() {
             return new LocalSumAggregateDescriptor();
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/stream/EmptyStreamAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/stream/EmptyStreamAggregateDescriptor.java
index 587a113..28d3c5e 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/stream/EmptyStreamAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/stream/EmptyStreamAggregateDescriptor.java
@@ -5,6 +5,7 @@
 import edu.uci.ics.asterix.common.functions.FunctionConstants;
 import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
 import edu.uci.ics.asterix.om.base.ABoolean;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
 import edu.uci.ics.asterix.om.types.BuiltinType;
@@ -23,8 +24,7 @@
 
     private static final long serialVersionUID = 1L;
 
-    public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "empty-stream", 0);
+    public final static FunctionIdentifier FID = AsterixBuiltinFunctions.EMPTY_STREAM;
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
         public IFunctionDescriptor createFunctionDescriptor() {
             return new EmptyStreamAggregateDescriptor();
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/CircleCenterAccessor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/CircleCenterAccessor.java
index 577a1fb..fe21cbb 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/CircleCenterAccessor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/CircleCenterAccessor.java
@@ -25,6 +25,7 @@
 import edu.uci.ics.asterix.om.base.AMutablePoint;
 import edu.uci.ics.asterix.om.base.ANull;
 import edu.uci.ics.asterix.om.base.APoint;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
 import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -43,7 +44,7 @@
 
     private static final long serialVersionUID = 1L;
 
-    private static final FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "get-center", 1);
+    private static final FunctionIdentifier FID = AsterixBuiltinFunctions.GET_CIRCLE_CENTER_ACCESSOR;
     private static final byte SER_CICLE_TAG = ATypeTag.CIRCLE.serialize();
     private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
 
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/CircleRadiusAccessor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/CircleRadiusAccessor.java
index ffaae9e..0669f4c 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/CircleRadiusAccessor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/CircleRadiusAccessor.java
@@ -24,6 +24,7 @@
 import edu.uci.ics.asterix.om.base.ADouble;
 import edu.uci.ics.asterix.om.base.AMutableDouble;
 import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
 import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -42,7 +43,7 @@
 
     private static final long serialVersionUID = 1L;
 
-    private static final FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "get-radius", 1);
+    private static final FunctionIdentifier FID = AsterixBuiltinFunctions.GET_CIRCLE_RADIUS_ACCESSOR;
     private static final byte SER_CICLE_TAG = ATypeTag.CIRCLE.serialize();
     private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
 
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/LineRectanglePolygonAccessor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/LineRectanglePolygonAccessor.java
index d7f87df..8dbdf75 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/LineRectanglePolygonAccessor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/LineRectanglePolygonAccessor.java
@@ -29,6 +29,7 @@
 import edu.uci.ics.asterix.om.base.AMutablePoint;
 import edu.uci.ics.asterix.om.base.ANull;
 import edu.uci.ics.asterix.om.base.APoint;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
 import edu.uci.ics.asterix.om.types.AOrderedListType;
@@ -49,7 +50,7 @@
 
     private static final long serialVersionUID = 1L;
 
-    private static final FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "get-points", 1);
+    private static final FunctionIdentifier FID = AsterixBuiltinFunctions.GET_POINTS_LINE_RECTANGLE_POLYGON_ACCESSOR;
     private static final byte SER_LINE_TAG = ATypeTag.LINE.serialize();
     private static final byte SER_RECTANGLE_TAG = ATypeTag.RECTANGLE.serialize();
     private static final byte SER_POLYGON_TAG = ATypeTag.POLYGON.serialize();
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/PointXCoordinateAccessor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/PointXCoordinateAccessor.java
index 7fcfd20..c42a1b4 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/PointXCoordinateAccessor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/PointXCoordinateAccessor.java
@@ -25,6 +25,7 @@
 import edu.uci.ics.asterix.om.base.ADouble;
 import edu.uci.ics.asterix.om.base.AMutableDouble;
 import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
 import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -43,7 +44,7 @@
 
     private static final long serialVersionUID = 1L;
 
-    private static final FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "get-x", 1);
+    private static final FunctionIdentifier FID = AsterixBuiltinFunctions.GET_POINT_X_COORDINATE_ACCESSOR;
     private static final byte SER_POINT_TAG = ATypeTag.POINT.serialize();
     private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
 
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/PointYCoordinateAccessor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/PointYCoordinateAccessor.java
index 1c47efa..02c6b30 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/PointYCoordinateAccessor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/PointYCoordinateAccessor.java
@@ -25,6 +25,7 @@
 import edu.uci.ics.asterix.om.base.ADouble;
 import edu.uci.ics.asterix.om.base.AMutableDouble;
 import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
 import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -43,7 +44,7 @@
 
     private static final long serialVersionUID = 1L;
 
-    private static final FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "get-y", 1);
+    private static final FunctionIdentifier FID = AsterixBuiltinFunctions.GET_POINT_Y_COORDINATE_ACCESSOR;
     private static final byte SER_POINT_TAG = ATypeTag.POINT.serialize();
     private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
 
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AIntervalFromDateConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AIntervalFromDateConstructorDescriptor.java
index 8daf9a6..4c8c60f 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AIntervalFromDateConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AIntervalFromDateConstructorDescriptor.java
@@ -17,7 +17,6 @@
 import java.io.DataOutput;
 import java.io.IOException;
 
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADateSerializerDeserializer;
 import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
 import edu.uci.ics.asterix.om.base.AInterval;
@@ -25,6 +24,7 @@
 import edu.uci.ics.asterix.om.base.ANull;
 import edu.uci.ics.asterix.om.base.temporal.ADateParserFactory;
 import edu.uci.ics.asterix.om.base.temporal.GregorianCalendarSystem;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
 import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -43,8 +43,7 @@
 public class AIntervalFromDateConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
 
     private static final long serialVersionUID = 1L;
-    public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "interval-from-date", 2);
+    public final static FunctionIdentifier FID = AsterixBuiltinFunctions.INTERVAL_CONSTRUCTOR_DATE;
     private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
     private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
     private final static byte SER_DATE_TYPE_TAG = ATypeTag.DATE.serialize();
@@ -123,7 +122,7 @@
                                         + ": expects NULL/STRING/DATE for the second argument, but got "
                                         + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(argOut1.getByteArray()[0]));
                             }
-                            
+
                             if (intervalEnd < intervalStart) {
                                 throw new AlgebricksException(FID.getName()
                                         + ": interval end must not be less than the interval start.");
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AIntervalFromDateTimeConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AIntervalFromDateTimeConstructorDescriptor.java
index 78d2e4a..42479f4 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AIntervalFromDateTimeConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AIntervalFromDateTimeConstructorDescriptor.java
@@ -25,6 +25,7 @@
 import edu.uci.ics.asterix.om.base.ANull;
 import edu.uci.ics.asterix.om.base.temporal.ADateParserFactory;
 import edu.uci.ics.asterix.om.base.temporal.ATimeParserFactory;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
 import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -43,8 +44,7 @@
 public class AIntervalFromDateTimeConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
 
     private static final long serialVersionUID = 1L;
-    public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "interval-from-datetime", 2);
+    public final static FunctionIdentifier FID = AsterixBuiltinFunctions.INTERVAL_CONSTRUCTOR_DATETIME;
     private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
     private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
     private final static byte SER_DATETIME_TYPE_TAG = ATypeTag.DATETIME.serialize();
@@ -145,7 +145,7 @@
                                         + ": expects NULL/STRING/DATETIME for the second argument, but got "
                                         + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(argOut1.getByteArray()[0]));
                             }
-                            
+
                             if (intervalEnd < intervalStart) {
                                 throw new AlgebricksException(FID.getName()
                                         + ": interval end must not be less than the interval start.");
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AIntervalFromTimeConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AIntervalFromTimeConstructorDescriptor.java
index 8816160..eb69037 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AIntervalFromTimeConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AIntervalFromTimeConstructorDescriptor.java
@@ -25,6 +25,7 @@
 import edu.uci.ics.asterix.om.base.ANull;
 import edu.uci.ics.asterix.om.base.temporal.ATimeParserFactory;
 import edu.uci.ics.asterix.om.base.temporal.GregorianCalendarSystem;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
 import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -43,8 +44,7 @@
 public class AIntervalFromTimeConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
 
     private static final long serialVersionUID = 1L;
-    public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "interval-from-time", 2);
+    public final static FunctionIdentifier FID = AsterixBuiltinFunctions.INTERVAL_CONSTRUCTOR_TIME;
     private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
     private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
     private final static byte SER_TIME_TYPE_TAG = ATypeTag.TIME.serialize();
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AIntervalStartFromDateConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AIntervalStartFromDateConstructorDescriptor.java
index 7ea8e90..c8a5d97 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AIntervalStartFromDateConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AIntervalStartFromDateConstructorDescriptor.java
@@ -17,7 +17,6 @@
 import java.io.DataOutput;
 import java.io.IOException;
 
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADateSerializerDeserializer;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADurationSerializerDeserializer;
 import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
@@ -29,6 +28,7 @@
 import edu.uci.ics.asterix.om.base.temporal.ADurationParserFactory;
 import edu.uci.ics.asterix.om.base.temporal.DurationArithmeticOperations;
 import edu.uci.ics.asterix.om.base.temporal.GregorianCalendarSystem;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
 import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -47,8 +47,7 @@
 public class AIntervalStartFromDateConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
 
     private static final long serialVersionUID = 1L;
-    public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "interval-start-from-date", 2);
+    public final static FunctionIdentifier FID = AsterixBuiltinFunctions.INTERVAL_CONSTRUCTOR_START_FROM_DATE;
     private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
     private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
     private final static byte SER_DATE_TYPE_TAG = ATypeTag.DATE.serialize();
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AIntervalStartFromDateTimeConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AIntervalStartFromDateTimeConstructorDescriptor.java
index f16dccb..0cdca36 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AIntervalStartFromDateTimeConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AIntervalStartFromDateTimeConstructorDescriptor.java
@@ -17,7 +17,6 @@
 import java.io.DataOutput;
 import java.io.IOException;
 
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADateTimeSerializerDeserializer;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADurationSerializerDeserializer;
 import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
@@ -29,6 +28,7 @@
 import edu.uci.ics.asterix.om.base.temporal.ADurationParserFactory;
 import edu.uci.ics.asterix.om.base.temporal.ATimeParserFactory;
 import edu.uci.ics.asterix.om.base.temporal.DurationArithmeticOperations;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
 import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -47,8 +47,7 @@
 public class AIntervalStartFromDateTimeConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
 
     private static final long serialVersionUID = 1L;
-    public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "interval-start-from-datetime", 2);
+    public final static FunctionIdentifier FID = AsterixBuiltinFunctions.INTERVAL_CONSTRUCTOR_START_FROM_DATETIME;
     private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
     private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
     private final static byte SER_DATETIME_TYPE_TAG = ATypeTag.DATETIME.serialize();
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AIntervalStartFromTimeConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AIntervalStartFromTimeConstructorDescriptor.java
index 35bfe17..a46a3bc 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AIntervalStartFromTimeConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AIntervalStartFromTimeConstructorDescriptor.java
@@ -17,7 +17,6 @@
 import java.io.DataOutput;
 import java.io.IOException;
 
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADurationSerializerDeserializer;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ATimeSerializerDeserializer;
 import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
@@ -29,6 +28,7 @@
 import edu.uci.ics.asterix.om.base.temporal.ATimeParserFactory;
 import edu.uci.ics.asterix.om.base.temporal.DurationArithmeticOperations;
 import edu.uci.ics.asterix.om.base.temporal.GregorianCalendarSystem;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
 import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -47,8 +47,7 @@
 public class AIntervalStartFromTimeConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
 
     private static final long serialVersionUID = 1L;
-    public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
-            "interval-start-from-time", 2);
+    public final static FunctionIdentifier FID = AsterixBuiltinFunctions.INTERVAL_CONSTRUCTOR_START_FROM_TIME;
     private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
     private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
     private final static byte SER_TIME_TYPE_TAG = ATypeTag.TIME.serialize();