[NO ISSUE] Stabelize SqlppExecutionColumnTest

- user model changes: no
- storage format changes: no
- interface changes: no

Details:
- Allow none correlated-prefix merge policies
  when creating columnar datasets.
- Enable cast-default-null tests without
  correlated-prefix merge policy

Change-Id: Ie9136d9e5de846f6c464ca3f527bc7e107d6b9c6
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/18009
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Wail Alkowaileet <wael.y.k@gmail.com>
Reviewed-by: Ali Alsuliman <ali.al.solaiman@gmail.com>
diff --git a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/runtime/SqlppExecutionColumnTest.java b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/runtime/SqlppExecutionColumnTest.java
index 1baedbe..9c5f7b5 100644
--- a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/runtime/SqlppExecutionColumnTest.java
+++ b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/runtime/SqlppExecutionColumnTest.java
@@ -28,6 +28,7 @@
 import org.apache.asterix.test.base.AsterixTestHelper;
 import org.apache.asterix.test.common.TestExecutor;
 import org.apache.asterix.testframework.context.TestCaseContext;
+import org.apache.asterix.testframework.xml.TestCase;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -62,10 +63,16 @@
     public static Collection<Object[]> tests() throws Exception {
         IGNORED = new HashSet<>(AsterixTestHelper.readTestListFile(new File(IGNORE_FILE)));
         Collection<Object[]> tests = LangExecutionUtil.tests("only_sqlpp.xml", "testsuite_sqlpp_column.xml");
-        return tests.stream().filter(t -> {
-            TestCaseContext ctx = (TestCaseContext) t[0];
-            return !IGNORED_GROUPS.contains(ctx.getTestCase().getFilePath()) && !IGNORED.contains(ctx.toString());
-        }).collect(Collectors.toList());
+        return tests.stream().filter(SqlppExecutionColumnTest::allow).collect(Collectors.toList());
+    }
+
+    private static boolean allow(Object[] test) {
+        TestCaseContext ctx = (TestCaseContext) test[0];
+        TestCase testCase = ctx.getTestCase();
+        boolean notIgnored = !IGNORED_GROUPS.contains(testCase.getFilePath()) && !IGNORED.contains(ctx.toString());
+        boolean noCorrelatedPrefix = testCase.getCompilationUnit().stream().noneMatch(cu -> cu.getPlaceholder().stream()
+                .anyMatch(ph -> ph.getValue().toLowerCase().contains("correlated-prefix")));
+        return notIgnored && noCorrelatedPrefix;
     }
 
     protected TestCaseContext tcCtx;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/ignore_column.txt b/asterixdb/asterix-app/src/test/resources/runtimets/ignore_column.txt
index 9d88127..34feb90 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/ignore_column.txt
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/ignore_column.txt
@@ -26,7 +26,6 @@
 distinct: record
 
 ##### Unsupported merge-policy (correlated-prefix) #####
-ddl: index-cast-null
 dml: using-correlated-prefix-merge-policy
 dml: using-correlated-prefix-merge-policy-with-feed
 dml: scan-delete-btree-correlated-secondary-index-nullable
diff --git a/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/validation/ColumnPropertiesValidationUtil.java b/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/validation/ColumnPropertiesValidationUtil.java
index 3fe6907..dd70d96 100644
--- a/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/validation/ColumnPropertiesValidationUtil.java
+++ b/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/validation/ColumnPropertiesValidationUtil.java
@@ -19,15 +19,18 @@
 package org.apache.asterix.column.validation;
 
 import java.util.List;
+import java.util.Set;
 
 import org.apache.asterix.common.config.DatasetConfig;
+import org.apache.asterix.common.context.CorrelatedPrefixMergePolicyFactory;
 import org.apache.asterix.common.exceptions.CompilationException;
 import org.apache.asterix.common.exceptions.ErrorCode;
-import org.apache.asterix.common.utils.StorageConstants;
 import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
 import org.apache.hyracks.api.exceptions.SourceLocation;
 
 public class ColumnPropertiesValidationUtil {
+    private static final Set<String> UNSUPPORTED_MERGE_POLICIES = Set.of(CorrelatedPrefixMergePolicyFactory.NAME);
+
     private ColumnPropertiesValidationUtil() {
     }
 
@@ -37,7 +40,7 @@
             return;
         }
 
-        if (!StorageConstants.DEFAULT_COMPACTION_POLICY_NAME.equals(mergePolicy)) {
+        if (UNSUPPORTED_MERGE_POLICIES.contains(mergePolicy.toLowerCase())) {
             throw CompilationException.create(ErrorCode.UNSUPPORTED_COLUMN_MERGE_POLICY, sourceLocation, mergePolicy);
         }