Merge branch 'gerrit/mad-hatter' into 'master'
Change-Id: I7e921b559f30adfab704143818dd7ee59e194eb4
diff --git a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/DisjunctivePredicateToJoinRule.java b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/DisjunctivePredicateToJoinRule.java
index 7bfe6a4..916fd75 100644
--- a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/DisjunctivePredicateToJoinRule.java
+++ b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/DisjunctivePredicateToJoinRule.java
@@ -162,7 +162,7 @@
IndexedNLJoinExpressionAnnotation.INSTANCE);
BroadcastExpressionAnnotation bcast = new BroadcastExpressionAnnotation();
bcast.setObject(BroadcastExpressionAnnotation.BroadcastSide.LEFT); // Broadcast the OR predicates branch.
- eqExp.getAnnotations().put(BroadcastExpressionAnnotation.BROADCAST_ANNOTATION_KEY, bcast);
+ eqExp.getAnnotations().put(bcast, bcast);
InnerJoinOperator jOp = new InnerJoinOperator(new MutableObject<>(eqExp));
jOp.setSourceLocation(sourceLoc);
diff --git a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/FuzzyJoinRule.java b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/FuzzyJoinRule.java
index dabfb82..cc91c06 100644
--- a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/FuzzyJoinRule.java
+++ b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/FuzzyJoinRule.java
@@ -106,7 +106,7 @@
//
// -- -- -- -
//
- + " where $token = /*+ bcast */ $tokenRanked " + "order by $i " + "return $i "
+ + " where $token = /*+ hash-bcast */ $tokenRanked " + "order by $i " + "return $i "
+ " for $prefixTokenRight in subset-collection($tokensRight, 0, prefix-len-%s(len($tokensRight), %ff)) "
+ " ), " + "( " + "##LEFT_1 " + "let $tokensUnrankedLeft := %s($$LEFT_1) "
+ " let $lenLeft := len($tokensUnrankedLeft) " + "let $tokensLeft := "
@@ -119,7 +119,7 @@
//
// -- -- -- -
//
- + " where $token = /*+ bcast */ $tokenRanked " + "order by $i " + "return $i "
+ + " where $token = /*+ hash-bcast */ $tokenRanked " + "order by $i " + "return $i "
// We use the input string $tokensUnrankedLeft instead of $tokensLeft to ensure it will not miss similar
// pairs when the prefix of S has been reduced in case of R ~= S, where some tokens are in S but not in R.
+ " let $actualPreLen := prefix-len-%s(len($tokensUnrankedLeft), %ff) - $lenLeft + len($tokensLeft) "
diff --git a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/subplan/InlineLeftNtsInSubplanJoinFlatteningVisitor.java b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/subplan/InlineLeftNtsInSubplanJoinFlatteningVisitor.java
index 8123fcc..12596ff 100644
--- a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/subplan/InlineLeftNtsInSubplanJoinFlatteningVisitor.java
+++ b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/subplan/InlineLeftNtsInSubplanJoinFlatteningVisitor.java
@@ -66,6 +66,7 @@
import org.apache.hyracks.algebricks.core.algebra.operators.logical.UnnestMapOperator;
import org.apache.hyracks.algebricks.core.algebra.operators.logical.UnnestOperator;
import org.apache.hyracks.algebricks.core.algebra.operators.logical.WindowOperator;
+import org.apache.hyracks.algebricks.core.algebra.operators.logical.visitors.BroadcastSideSwitchingVisitor;
import org.apache.hyracks.algebricks.core.algebra.operators.logical.visitors.VariableUtilities;
import org.apache.hyracks.algebricks.core.algebra.visitors.IQueryOperatorVisitor;
@@ -186,6 +187,7 @@
Mutable<ILogicalOperator> rightBranch = op.getInputs().get(1);
op.getInputs().set(0, rightBranch);
op.getInputs().set(1, leftBranch);
+ op.getCondition().getValue().accept(BroadcastSideSwitchingVisitor.getInstance(), null);
}
AbstractBinaryJoinOperator returnOp = op;
// After rewriting, the original inner join should become an left outer join.
@@ -419,5 +421,4 @@
joinOp.getInputs().set(1, new MutableObject<ILogicalOperator>(assignOp));
nullCheckVars.add(assignVar);
}
-
}
diff --git a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/LangExpressionToPlanTranslator.java b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/LangExpressionToPlanTranslator.java
index adc6853..5851467 100644
--- a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/LangExpressionToPlanTranslator.java
+++ b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/LangExpressionToPlanTranslator.java
@@ -116,8 +116,6 @@
import org.apache.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression;
import org.apache.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression.FunctionKind;
import org.apache.hyracks.algebricks.core.algebra.expressions.AggregateFunctionCallExpression;
-import org.apache.hyracks.algebricks.core.algebra.expressions.BroadcastExpressionAnnotation;
-import org.apache.hyracks.algebricks.core.algebra.expressions.BroadcastExpressionAnnotation.BroadcastSide;
import org.apache.hyracks.algebricks.core.algebra.expressions.ConstantExpression;
import org.apache.hyracks.algebricks.core.algebra.expressions.IExpressionAnnotation;
import org.apache.hyracks.algebricks.core.algebra.expressions.ScalarFunctionCallExpression;
@@ -1181,35 +1179,18 @@
// now look at the operator
if (i < nOps) {
OperatorType opType = ops.get(i);
- boolean isCmpOp = OperatorExpr.opIsComparison(opType);
AbstractFunctionCallExpression f = createFunctionCallExpressionForBuiltinOperator(opType, sourceLoc);
-
// chain the operators
if (i == 0) {
f.getArguments().add(new MutableObject<>(e));
currExpr = f;
- if (isCmpOp && op.isBroadcastOperand(i)) {
- BroadcastExpressionAnnotation bcast = new BroadcastExpressionAnnotation();
- bcast.setObject(BroadcastSide.LEFT);
- f.getAnnotations().put(BroadcastExpressionAnnotation.BROADCAST_ANNOTATION_KEY, bcast);
- }
} else {
currExpr.getArguments().add(new MutableObject<>(e));
f.getArguments().add(new MutableObject<>(currExpr));
currExpr = f;
- if (isCmpOp && i == 1 && op.isBroadcastOperand(i)) {
- BroadcastExpressionAnnotation bcast = new BroadcastExpressionAnnotation();
- bcast.setObject(BroadcastSide.RIGHT);
- f.getAnnotations().put(BroadcastExpressionAnnotation.BROADCAST_ANNOTATION_KEY, bcast);
- }
}
} else { // don't forget the last expression...
currExpr.getArguments().add(new MutableObject<>(e));
- if (i == 1 && op.isBroadcastOperand(i)) {
- BroadcastExpressionAnnotation bcast = new BroadcastExpressionAnnotation();
- bcast.setObject(BroadcastSide.RIGHT);
- currExpr.getAnnotations().put(BroadcastExpressionAnnotation.BROADCAST_ANNOTATION_KEY, bcast);
- }
}
}
diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/messaging/MessagingChannelInterfaceFactory.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/messaging/MessagingChannelInterfaceFactory.java
index abd401a..17e2744 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/messaging/MessagingChannelInterfaceFactory.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/messaging/MessagingChannelInterfaceFactory.java
@@ -93,6 +93,11 @@
}
return buffer;
}
+
+ @Override
+ public int getCreatedBuffersCount() {
+ return 0;
+ }
}
/**
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/results/basic/dataset_with_meta-1/dataset_with_meta-1.1.adm b/asterixdb/asterix-app/src/test/resources/metadata/results/basic/dataset_with_meta-1/dataset_with_meta-1.1.adm
index 74c4faa..4451bcc 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/results/basic/dataset_with_meta-1/dataset_with_meta-1.1.adm
+++ b/asterixdb/asterix-app/src/test/resources/metadata/results/basic/dataset_with_meta-1/dataset_with_meta-1.1.adm
@@ -1 +1 @@
-{ "DataverseName": "test", "DatasetName": "Book", "DatatypeDataverseName": "test", "DatatypeName": "LineType", "DatasetType": "INTERNAL", "GroupName": "test.Book", "CompactionPolicy": "concurrent", "CompactionPolicyProperties": [ { "Name": "max-component-count", "Value": "30" }, { "Name": "min-merge-component-count", "Value": "3" }, { "Name": "max-merge-component-count", "Value": "10" }, { "Name": "size-ratio", "Value": "1.2" } ], "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ [ "id" ] ], "PrimaryKey": [ [ "id" ] ], "Autogenerated": false }, "Hints": {{ }}, "Timestamp": "Sun Jun 30 09:05:04 PDT 2019", "DatasetId": 102, "PendingOp": 0, "MetatypeDataverseName": "test", "MetatypeName": "AuxiliaryType" }
+{ "DataverseName": "test", "DatasetName": "Book", "DatatypeDataverseName": "test", "DatatypeName": "LineType", "DatasetType": "INTERNAL", "GroupName": "test.Book", "CompactionPolicy": "concurrent", "CompactionPolicyProperties": [ { "Name": "max-component-count", "Value": "30" }, { "Name": "min-merge-component-count", "Value": "3" }, { "Name": "max-merge-component-count", "Value": "10" }, { "Name": "size-ratio", "Value": "1.2" } ], "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ [ "id" ] ], "PrimaryKey": [ [ "id" ] ], "Autogenerated": false }, "Hints": {{ }}, "Timestamp": "Sun Jun 30 09:05:04 PDT 2019", "DatasetId": 102, "PendingOp": 0, "MetatypeDataverseName": "test", "MetatypeName": "AuxiliaryType", "BlockLevelStorageCompression": { "DatasetCompressionScheme": "snappy" } }
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/results/basic/dataset_with_meta-2/dataset_with_meta-2.1.adm b/asterixdb/asterix-app/src/test/resources/metadata/results/basic/dataset_with_meta-2/dataset_with_meta-2.1.adm
index f91c42a..010207b 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/results/basic/dataset_with_meta-2/dataset_with_meta-2.1.adm
+++ b/asterixdb/asterix-app/src/test/resources/metadata/results/basic/dataset_with_meta-2/dataset_with_meta-2.1.adm
@@ -1 +1 @@
-{ "DataverseName": "test", "DatasetName": "Book", "DatatypeDataverseName": "test", "DatatypeName": "LineType", "DatasetType": "INTERNAL", "GroupName": "test.Book", "CompactionPolicy": "concurrent", "CompactionPolicyProperties": [ { "Name": "max-component-count", "Value": "30" }, { "Name": "min-merge-component-count", "Value": "3" }, { "Name": "max-merge-component-count", "Value": "10" }, { "Name": "size-ratio", "Value": "1.2" } ], "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ [ "id" ] ], "PrimaryKey": [ [ "id" ] ], "Autogenerated": false }, "Hints": {{ }}, "Timestamp": "Sun Jun 30 09:05:04 PDT 2019", "DatasetId": 103, "PendingOp": 0, "MetatypeDataverseName": "meta", "MetatypeName": "AuxiliaryType" }
+{ "DataverseName": "test", "DatasetName": "Book", "DatatypeDataverseName": "test", "DatatypeName": "LineType", "DatasetType": "INTERNAL", "GroupName": "test.Book", "CompactionPolicy": "concurrent", "CompactionPolicyProperties": [ { "Name": "max-component-count", "Value": "30" }, { "Name": "min-merge-component-count", "Value": "3" }, { "Name": "max-merge-component-count", "Value": "10" }, { "Name": "size-ratio", "Value": "1.2" } ], "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ [ "id" ] ], "PrimaryKey": [ [ "id" ] ], "Autogenerated": false }, "Hints": {{ }}, "Timestamp": "Sun Jun 30 09:05:04 PDT 2019", "DatasetId": 103, "PendingOp": 0, "MetatypeDataverseName": "meta", "MetatypeName": "AuxiliaryType", "BlockLevelStorageCompression": { "DatasetCompressionScheme": "snappy" } }
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/results/basic/dataset_with_meta-3/dataset_with_meta-2.3.adm b/asterixdb/asterix-app/src/test/resources/metadata/results/basic/dataset_with_meta-3/dataset_with_meta-2.3.adm
index 57346ae..83b80db 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/results/basic/dataset_with_meta-3/dataset_with_meta-2.3.adm
+++ b/asterixdb/asterix-app/src/test/resources/metadata/results/basic/dataset_with_meta-3/dataset_with_meta-2.3.adm
@@ -1 +1 @@
-{ "DataverseName": "test", "DatasetName": "Book", "DatatypeDataverseName": "test", "DatatypeName": "LineType", "DatasetType": "INTERNAL", "GroupName": "test.Book", "CompactionPolicy": "concurrent", "CompactionPolicyProperties": [ { "Name": "max-component-count", "Value": "30" }, { "Name": "min-merge-component-count", "Value": "3" }, { "Name": "max-merge-component-count", "Value": "10" }, { "Name": "size-ratio", "Value": "1.2" } ], "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ [ "id" ] ], "PrimaryKey": [ [ "id" ] ], "Autogenerated": false }, "Hints": {{ }}, "Timestamp": "Tue Jun 21 15:54:26 PDT 2016", "DatasetId": 103, "PendingOp": 0, "MetatypeDataverseName": "test", "MetatypeName": "LineType" }
+{ "DataverseName": "test", "DatasetName": "Book", "DatatypeDataverseName": "test", "DatatypeName": "LineType", "DatasetType": "INTERNAL", "GroupName": "test.Book", "CompactionPolicy": "concurrent", "CompactionPolicyProperties": [ { "Name": "max-component-count", "Value": "30" }, { "Name": "min-merge-component-count", "Value": "3" }, { "Name": "max-merge-component-count", "Value": "10" }, { "Name": "size-ratio", "Value": "1.2" } ], "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ [ "id" ] ], "PrimaryKey": [ [ "id" ] ], "Autogenerated": false }, "Hints": {{ }}, "Timestamp": "Tue Jun 21 15:54:26 PDT 2016", "DatasetId": 103, "PendingOp": 0, "MetatypeDataverseName": "test", "MetatypeName": "LineType", "BlockLevelStorageCompression": { "DatasetCompressionScheme": "snappy" } }
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/results/basic/dataset_with_meta-4/dataset_with_meta-4.3.adm b/asterixdb/asterix-app/src/test/resources/metadata/results/basic/dataset_with_meta-4/dataset_with_meta-4.3.adm
index ea31b65..f6e8f81 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/results/basic/dataset_with_meta-4/dataset_with_meta-4.3.adm
+++ b/asterixdb/asterix-app/src/test/resources/metadata/results/basic/dataset_with_meta-4/dataset_with_meta-4.3.adm
@@ -1 +1 @@
-{ "DataverseName": "test", "DatasetName": "Book", "DatatypeDataverseName": "test", "DatatypeName": "LineType", "DatasetType": "INTERNAL", "GroupName": "test.Book", "CompactionPolicy": "concurrent", "CompactionPolicyProperties": [ { "Name": "max-component-count", "Value": "30" }, { "Name": "min-merge-component-count", "Value": "3" }, { "Name": "max-merge-component-count", "Value": "10" }, { "Name": "size-ratio", "Value": "1.2" } ], "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ [ "id" ] ], "PrimaryKey": [ [ "id" ] ], "Autogenerated": false, "KeySourceIndicator": [ 1 ] }, "Hints": {{ }}, "Timestamp": "Tue Jun 21 15:54:26 PDT 2016", "DatasetId": 104, "PendingOp": 0, "MetatypeDataverseName": "test", "MetatypeName": "LineType" }
+{ "DataverseName": "test", "DatasetName": "Book", "DatatypeDataverseName": "test", "DatatypeName": "LineType", "DatasetType": "INTERNAL", "GroupName": "test.Book", "CompactionPolicy": "concurrent", "CompactionPolicyProperties": [ { "Name": "max-component-count", "Value": "30" }, { "Name": "min-merge-component-count", "Value": "3" }, { "Name": "max-merge-component-count", "Value": "10" }, { "Name": "size-ratio", "Value": "1.2" } ], "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ [ "id" ] ], "PrimaryKey": [ [ "id" ] ], "Autogenerated": false, "KeySourceIndicator": [ 1 ] }, "Hints": {{ }}, "Timestamp": "Tue Jun 21 15:54:26 PDT 2016", "DatasetId": 104, "PendingOp": 0, "MetatypeDataverseName": "test", "MetatypeName": "LineType", "BlockLevelStorageCompression": { "DatasetCompressionScheme": "snappy" } }
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/results/basic/dataset_with_meta-5/dataset_with_meta-5.3.adm b/asterixdb/asterix-app/src/test/resources/metadata/results/basic/dataset_with_meta-5/dataset_with_meta-5.3.adm
index b294dd8..370134f 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/results/basic/dataset_with_meta-5/dataset_with_meta-5.3.adm
+++ b/asterixdb/asterix-app/src/test/resources/metadata/results/basic/dataset_with_meta-5/dataset_with_meta-5.3.adm
@@ -1 +1 @@
-{ "DataverseName": "test", "DatasetName": "Book", "DatatypeDataverseName": "test", "DatatypeName": "LineType", "DatasetType": "INTERNAL", "GroupName": "test.Book", "CompactionPolicy": "concurrent", "CompactionPolicyProperties": [ { "Name": "max-component-count", "Value": "30" }, { "Name": "min-merge-component-count", "Value": "3" }, { "Name": "max-merge-component-count", "Value": "10" }, { "Name": "size-ratio", "Value": "1.2" } ], "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ [ "key" ] ], "PrimaryKey": [ [ "key" ] ], "Autogenerated": false, "KeySourceIndicator": [ 1 ] }, "Hints": {{ }}, "Timestamp": "Tue Jun 21 15:54:26 PDT 2016", "DatasetId": 105, "PendingOp": 0, "MetatypeDataverseName": "test", "MetatypeName": "AuxiliaryType" }
+{ "DataverseName": "test", "DatasetName": "Book", "DatatypeDataverseName": "test", "DatatypeName": "LineType", "DatasetType": "INTERNAL", "GroupName": "test.Book", "CompactionPolicy": "concurrent", "CompactionPolicyProperties": [ { "Name": "max-component-count", "Value": "30" }, { "Name": "min-merge-component-count", "Value": "3" }, { "Name": "max-merge-component-count", "Value": "10" }, { "Name": "size-ratio", "Value": "1.2" } ], "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ [ "key" ] ], "PrimaryKey": [ [ "key" ] ], "Autogenerated": false, "KeySourceIndicator": [ 1 ] }, "Hints": {{ }}, "Timestamp": "Tue Jun 21 15:54:26 PDT 2016", "DatasetId": 105, "PendingOp": 0, "MetatypeDataverseName": "test", "MetatypeName": "AuxiliaryType", "BlockLevelStorageCompression": { "DatasetCompressionScheme": "snappy" } }
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/results/basic/issue_251_dataset_hint_2/issue_251_dataset_hint_2.1.adm b/asterixdb/asterix-app/src/test/resources/metadata/results/basic/issue_251_dataset_hint_2/issue_251_dataset_hint_2.1.adm
index 5a70c8e..3d5d29a 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/results/basic/issue_251_dataset_hint_2/issue_251_dataset_hint_2.1.adm
+++ b/asterixdb/asterix-app/src/test/resources/metadata/results/basic/issue_251_dataset_hint_2/issue_251_dataset_hint_2.1.adm
@@ -1 +1 @@
-{ "DataverseName": "test", "DatasetName": "Book", "DatatypeDataverseName": "test", "DatatypeName": "LineType", "DatasetType": "INTERNAL", "GroupName": "test.Book", "CompactionPolicy": "concurrent", "CompactionPolicyProperties": [ { "Name": "max-component-count", "Value": "30" }, { "Name": "min-merge-component-count", "Value": "3" }, { "Name": "max-merge-component-count", "Value": "10" }, { "Name": "size-ratio", "Value": "1.2" } ], "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ [ "id" ] ], "PrimaryKey": [ [ "id" ] ], "Autogenerated": false }, "Hints": {{ { "Name": "CARDINALITY", "Value": "2000" } }}, "Timestamp": "Tue Jun 21 15:54:28 PDT 2016", "DatasetId": 114, "PendingOp": 0 }
+{ "DataverseName": "test", "DatasetName": "Book", "DatatypeDataverseName": "test", "DatatypeName": "LineType", "DatasetType": "INTERNAL", "GroupName": "test.Book", "CompactionPolicy": "concurrent", "CompactionPolicyProperties": [ { "Name": "max-component-count", "Value": "30" }, { "Name": "min-merge-component-count", "Value": "3" }, { "Name": "max-merge-component-count", "Value": "10" }, { "Name": "size-ratio", "Value": "1.2" } ], "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ [ "id" ] ], "PrimaryKey": [ [ "id" ] ], "Autogenerated": false }, "Hints": {{ { "Name": "CARDINALITY", "Value": "2000" } }}, "Timestamp": "Tue Jun 21 15:54:28 PDT 2016", "DatasetId": 114, "PendingOp": 0, "BlockLevelStorageCompression": { "DatasetCompressionScheme": "snappy" } }
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/results/basic/issue_251_dataset_hint_3/issue_251_dataset_hint_3.1.adm b/asterixdb/asterix-app/src/test/resources/metadata/results/basic/issue_251_dataset_hint_3/issue_251_dataset_hint_3.1.adm
index fc1dcf5..6fc4f6f 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/results/basic/issue_251_dataset_hint_3/issue_251_dataset_hint_3.1.adm
+++ b/asterixdb/asterix-app/src/test/resources/metadata/results/basic/issue_251_dataset_hint_3/issue_251_dataset_hint_3.1.adm
@@ -1 +1 @@
-{ "DataverseName": "test", "DatasetName": "Book", "DatatypeDataverseName": "test", "DatatypeName": "LineType", "DatasetType": "INTERNAL", "GroupName": "test.Book", "CompactionPolicy": "concurrent", "CompactionPolicyProperties": [ { "Name": "max-component-count", "Value": "30" }, { "Name": "min-merge-component-count", "Value": "3" }, { "Name": "max-merge-component-count", "Value": "10" }, { "Name": "size-ratio", "Value": "1.2" } ], "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ [ "id" ] ], "PrimaryKey": [ [ "id" ] ], "Autogenerated": false }, "Hints": {{ { "Name": "CARDINALITY", "Value": "2000" } }}, "Timestamp": "Tue Jun 21 15:54:28 PDT 2016", "DatasetId": 115, "PendingOp": 0 }
+{ "DataverseName": "test", "DatasetName": "Book", "DatatypeDataverseName": "test", "DatatypeName": "LineType", "DatasetType": "INTERNAL", "GroupName": "test.Book", "CompactionPolicy": "concurrent", "CompactionPolicyProperties": [ { "Name": "max-component-count", "Value": "30" }, { "Name": "min-merge-component-count", "Value": "3" }, { "Name": "max-merge-component-count", "Value": "10" }, { "Name": "size-ratio", "Value": "1.2" } ], "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ [ "id" ] ], "PrimaryKey": [ [ "id" ] ], "Autogenerated": false }, "Hints": {{ { "Name": "CARDINALITY", "Value": "2000" } }}, "Timestamp": "Tue Jun 21 15:54:28 PDT 2016", "DatasetId": 115, "PendingOp": 0, "BlockLevelStorageCompression": { "DatasetCompressionScheme": "snappy" } }
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/results/basic/issue_251_dataset_hint_4/issue_251_dataset_hint_4.1.adm b/asterixdb/asterix-app/src/test/resources/metadata/results/basic/issue_251_dataset_hint_4/issue_251_dataset_hint_4.1.adm
index 9620d17..ba7b9ca 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/results/basic/issue_251_dataset_hint_4/issue_251_dataset_hint_4.1.adm
+++ b/asterixdb/asterix-app/src/test/resources/metadata/results/basic/issue_251_dataset_hint_4/issue_251_dataset_hint_4.1.adm
@@ -1 +1 @@
-{ "DataverseName": "test", "DatasetName": "Book", "DatatypeDataverseName": "test", "DatatypeName": "LineType", "DatasetType": "INTERNAL", "GroupName": "test.Book", "CompactionPolicy": "concurrent", "CompactionPolicyProperties": [ { "Name": "max-component-count", "Value": "30" }, { "Name": "min-merge-component-count", "Value": "3" }, { "Name": "max-merge-component-count", "Value": "10" }, { "Name": "size-ratio", "Value": "1.2" } ], "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ [ "id" ] ], "PrimaryKey": [ [ "id" ] ], "Autogenerated": false }, "Hints": {{ }}, "Timestamp": "Tue Jun 21 15:54:28 PDT 2016", "DatasetId": 116, "PendingOp": 0 }
+{ "DataverseName": "test", "DatasetName": "Book", "DatatypeDataverseName": "test", "DatatypeName": "LineType", "DatasetType": "INTERNAL", "GroupName": "test.Book", "CompactionPolicy": "concurrent", "CompactionPolicyProperties": [ { "Name": "max-component-count", "Value": "30" }, { "Name": "min-merge-component-count", "Value": "3" }, { "Name": "max-merge-component-count", "Value": "10" }, { "Name": "size-ratio", "Value": "1.2" } ], "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ [ "id" ] ], "PrimaryKey": [ [ "id" ] ], "Autogenerated": false }, "Hints": {{ }}, "Timestamp": "Tue Jun 21 15:54:28 PDT 2016", "DatasetId": 116, "PendingOp": 0, "BlockLevelStorageCompression": { "DatasetCompressionScheme": "snappy" } }
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/results/basic/meta02/meta02.1.adm b/asterixdb/asterix-app/src/test/resources/metadata/results/basic/meta02/meta02.1.adm
index 4ca2cef..4e8131d 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/results/basic/meta02/meta02.1.adm
+++ b/asterixdb/asterix-app/src/test/resources/metadata/results/basic/meta02/meta02.1.adm
@@ -1 +1 @@
-{ "DataverseName": "testdv", "DatasetName": "dst01", "DatatypeDataverseName": "testdv", "DatatypeName": "testtype", "DatasetType": "INTERNAL", "GroupName": "testdv.dst01", "CompactionPolicy": "concurrent", "CompactionPolicyProperties": [ { "Name": "max-component-count", "Value": "30" }, { "Name": "min-merge-component-count", "Value": "3" }, { "Name": "max-merge-component-count", "Value": "10" }, { "Name": "size-ratio", "Value": "1.2" } ], "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ [ "id" ] ], "PrimaryKey": [ [ "id" ] ], "Autogenerated": false }, "Hints": {{ }}, "Timestamp": "Tue Jun 21 15:54:27 PDT 2016", "DatasetId": 108, "PendingOp": 0 }
+{ "DataverseName": "testdv", "DatasetName": "dst01", "DatatypeDataverseName": "testdv", "DatatypeName": "testtype", "DatasetType": "INTERNAL", "GroupName": "testdv.dst01", "CompactionPolicy": "concurrent", "CompactionPolicyProperties": [ { "Name": "max-component-count", "Value": "30" }, { "Name": "min-merge-component-count", "Value": "3" }, { "Name": "max-merge-component-count", "Value": "10" }, { "Name": "size-ratio", "Value": "1.2" } ], "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ [ "id" ] ], "PrimaryKey": [ [ "id" ] ], "Autogenerated": false }, "Hints": {{ }}, "Timestamp": "Tue Jun 21 15:54:27 PDT 2016", "DatasetId": 108, "PendingOp": 0, "BlockLevelStorageCompression": { "DatasetCompressionScheme": "snappy" } }
diff --git a/asterixdb/asterix-app/src/test/resources/metadata/results/basic/meta09/meta09.1.adm b/asterixdb/asterix-app/src/test/resources/metadata/results/basic/meta09/meta09.1.adm
index 45160b5..088cc71 100644
--- a/asterixdb/asterix-app/src/test/resources/metadata/results/basic/meta09/meta09.1.adm
+++ b/asterixdb/asterix-app/src/test/resources/metadata/results/basic/meta09/meta09.1.adm
@@ -1 +1 @@
-{ "DataverseName": "test", "DatasetName": "t1", "DatatypeDataverseName": "test", "DatatypeName": "testtype", "DatasetType": "INTERNAL", "GroupName": "test.t1", "CompactionPolicy": "concurrent", "CompactionPolicyProperties": [ { "Name": "max-component-count", "Value": "30" }, { "Name": "min-merge-component-count", "Value": "3" }, { "Name": "max-merge-component-count", "Value": "10" }, { "Name": "size-ratio", "Value": "1.2" } ], "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ [ "id" ] ], "PrimaryKey": [ [ "id" ] ], "Autogenerated": false }, "Hints": {{ }}, "Timestamp": "Tue Jun 21 15:54:27 PDT 2016", "DatasetId": 110, "PendingOp": 0 }
+{ "DataverseName": "test", "DatasetName": "t1", "DatatypeDataverseName": "test", "DatatypeName": "testtype", "DatasetType": "INTERNAL", "GroupName": "test.t1", "CompactionPolicy": "concurrent", "CompactionPolicyProperties": [ { "Name": "max-component-count", "Value": "30" }, { "Name": "min-merge-component-count", "Value": "3" }, { "Name": "max-merge-component-count", "Value": "10" }, { "Name": "size-ratio", "Value": "1.2" } ], "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ [ "id" ] ], "PrimaryKey": [ [ "id" ] ], "Autogenerated": false }, "Hints": {{ }}, "Timestamp": "Tue Jun 21 15:54:27 PDT 2016", "DatasetId": 110, "PendingOp": 0, "BlockLevelStorageCompression": { "DatasetCompressionScheme": "snappy" } }
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/fj-dblp-csx.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/fj-dblp-csx.aql
index a79afdb..c86c8b9 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/fj-dblp-csx.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/fj-dblp-csx.aql
@@ -65,7 +65,7 @@
/*+ inmem 16 16384 */
order by count($id), $tokenGroupped
return $tokenGroupped
- where $token = /*+ bcast */ $tokenRanked
+ where $token = /*+ hash-bcast */ $tokenRanked
order by $i
return $i
for $prefixTokenDBLP in subset-collection($tokensDBLP, 0, prefix-len-jaccard(len($tokensDBLP), .8f))
@@ -88,7 +88,7 @@
/*+ inmem 16 16384 */
order by count($id), $tokenGroupped
return $tokenGroupped
- where $token = /*+ bcast */ $tokenRanked
+ where $token = /*+ hash-bcast */ $tokenRanked
order by $i
return $i
let $actualPrefixLen := prefix-len-jaccard(len($unrankedTokensCSX), .8f) - len($unrankedTokensCSX) + len($tokensCSX)
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/fj-phase2-with-hints.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/fj-phase2-with-hints.aql
index 47533a7..6e52a08 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/fj-phase2-with-hints.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/fj-phase2-with-hints.aql
@@ -55,7 +55,7 @@
/*+ inmem 1 302 */
order by count($paper), $tokenGroupped
return $tokenGroupped
- where $token = /*+ bcast */ $tokenRanked
+ where $token = /*+ hash-bcast */ $tokenRanked
order by $i
return $i
order by $paperDBLP.id
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/hints/broadcast_hint_1.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/hints/broadcast_hint_1.sqlpp
index 02ba35d..f33230c 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/hints/broadcast_hint_1.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/hints/broadcast_hint_1.sqlpp
@@ -42,5 +42,5 @@
select t1.c_4 as c0, t2.c_4 as c1
from t1 join t2
-on t1.c_1 = t2.c_1 and t1.c_2 /*+ bcast */ = t2.c_2 and t1.c_3 = t2.c_3
+on t1.c_1 = t2.c_1 and t1.c_2 /*+ hash-bcast */ = t2.c_2 and t1.c_3 = t2.c_3
;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/hints/broadcast_hint_2.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/hints/broadcast_hint_2.sqlpp
index 1feb21f..8d0279c 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/hints/broadcast_hint_2.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/hints/broadcast_hint_2.sqlpp
@@ -42,5 +42,5 @@
select t1.c_4 as c0, t2.c_4 as c1
from t1 join t2
-on t1.c_1 /*+ bcast */ = t2.c_1 and t1.c_2 /*+ bcast */ = t2.c_2 and t1.c_3 /*+ bcast */ = t2.c_3
+on t1.c_1 /*+ hash-bcast */ = t2.c_1 and t1.c_2 /*+ hash-bcast */ = t2.c_2 and t1.c_3 /*+ bcast */ = t2.c_3
;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/hints/broadcast_hint_3.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/hints/broadcast_hint_3.sqlpp
index a3fd4f6..f48433e 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/hints/broadcast_hint_3.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/hints/broadcast_hint_3.sqlpp
@@ -18,7 +18,7 @@
*/
/*
* Description : Test broadcast join hint
-* Incompatible broadcast sides -> no broadcast
+* Different operand order in where clause -> Successful broadcast
* Expected Res : Success
* Date : 09/22/2017
*/
@@ -42,5 +42,5 @@
select t1.c_4 as c0, t2.c_4 as c1
from t1 join t2
-on t1.c_1 /*+ bcast */ = t2.c_1 and t1.c_2 /*+ bcast */ = t2.c_2 and t2.c_3 /*+ bcast */ = t1.c_3
+on t1.c_1 /*+ hash-bcast */ = t2.c_1 and t1.c_2 /*+ hash-bcast */ = t2.c_2 and t2.c_3 /*+ hash-bcast */ = t1.c_3
;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/joins/nested_query_with_bcast.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/joins/nested_query_with_bcast.sqlpp
index 8e7a6e0..2232406 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/joins/nested_query_with_bcast.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/joins/nested_query_with_bcast.sqlpp
@@ -38,4 +38,4 @@
create dataset countryDataset(Country) primary key country_code;
create dataset tweetDataset(TweetType) primary key id;
-insert into targetDataset (select object_merge(x, {"full-country" : (select value c.country_name from countryDataset c where c.country_code /*+ bcast */ = x.country )}) from tweetDataset x);
\ No newline at end of file
+insert into targetDataset (select object_merge(x, {"full-country" : (select value c.country_name from countryDataset c where c.country_code /*+ hash-bcast */ = x.country )}) from tweetDataset x);
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-similarity-join-dual-order.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-similarity-join-dual-order.aql
index d3da872..ca88a9e 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-similarity-join-dual-order.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-similarity-join-dual-order.aql
@@ -65,7 +65,7 @@
/*+ inmem 1 302 */ order by $r.rc * $l.lc
return $r.rt
- where $tokenUnranked = /*+ bcast */ $tokenRanked
+ where $tokenUnranked = /*+ hash-bcast */ $tokenRanked
order by $i
return $i
for $prefixTokenRight in subset-collection($tokensRight, 0, prefix-len-jaccard(len($tokensRight), .8f))
@@ -96,7 +96,7 @@
/*+ inmem 1 302 */ order by $r.rc * $l.lc
return $r.rt
- where $tokenUnranked = /*+ bcast */ $tokenRanked
+ where $tokenUnranked = /*+ hash-bcast */ $tokenRanked
order by $i
return $i
let $actualPrefixLen := prefix-len-jaccard(len($tokensUnrankedLeft), .8f) - len($tokensUnrankedLeft) + len($tokensLeft)
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-similarity-join-right-ahead.aql b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-similarity-join-right-ahead.aql
index 661ce00..20f6912 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-similarity-join-right-ahead.aql
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/similarity/jaccard-similarity-join-right-ahead.aql
@@ -55,7 +55,7 @@
/*+ hash */ group by $tokenRightGrouped := $orderTokenRight with $rightId
/*+ inmem 1 302 */ order by count($rightId)
return $tokenRightGrouped
- where $tokenUnranked = /*+ bcast */ $tokenRanked
+ where $tokenUnranked = /*+ hash-bcast */ $tokenRanked
order by $i
return $i
for $prefixTokenRight in subset-collection($tokensRight, 0, prefix-len-jaccard(len($tokensRight), .8f))
@@ -76,7 +76,7 @@
/*+ hash */ group by $tokenRightGrouped := $orderTokenRight with $rightId
/*+ inmem 1 302 */ order by count($rightId)
return $tokenRightGrouped
- where $tokenUnranked = /*+ bcast */ $tokenRanked
+ where $tokenUnranked = /*+ hash-bcast */ $tokenRanked
order by $i
return $i
let $actualPrefixLen := prefix-len-jaccard(len($tokensUnrankedLeft), .8f) - len($tokensUnrankedLeft) + len($tokensLeft)
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/tpch/q12_shipping_broadcast.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/tpch/q12_shipping_broadcast.sqlpp
index 9add5d3..bc86998 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/tpch/q12_shipping_broadcast.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/tpch/q12_shipping_broadcast.sqlpp
@@ -48,7 +48,7 @@
END) low_line_count
FROM LineItem l,
Orders o
-WHERE l.l_orderkey /*+ bcast */ = o.o_orderkey AND l.l_commitdate < l.l_receiptdate AND
+WHERE l.l_orderkey /*+ hash-bcast */ = o.o_orderkey AND l.l_commitdate < l.l_receiptdate AND
l.l_shipdate < l.l_commitdate AND l.l_receiptdate >= '1994-01-01' AND
l.l_receiptdate < '1995-01-01' AND (l.l_shipmode = 'MAIL' OR l.l_shipmode = 'SHIP')
GROUP BY l.l_shipmode
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/tpch/q12_shipping_broadcast_ps.sqlpp b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/tpch/q12_shipping_broadcast_ps.sqlpp
index 6c55128..e9a53c2 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/queries/tpch/q12_shipping_broadcast_ps.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/queries/tpch/q12_shipping_broadcast_ps.sqlpp
@@ -46,7 +46,7 @@
END) low_line_count
FROM LineItem l,
Orders o
-WHERE l.l_orderkey /*+ bcast */ = o.o_orderkey AND l.l_commitdate < l.l_receiptdate AND
+WHERE l.l_orderkey /*+ hash-bcast */ = o.o_orderkey AND l.l_commitdate < l.l_receiptdate AND
l.l_shipdate < l.l_commitdate AND l.l_receiptdate >= '1994-01-01' AND
l.l_receiptdate < '1995-01-01' AND (l.l_shipmode = 'MAIL' OR l.l_shipmode = 'SHIP')
GROUP BY l.l_shipmode
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/results/hints/broadcast_hint_3.plan b/asterixdb/asterix-app/src/test/resources/optimizerts/results/hints/broadcast_hint_3.plan
index 1e45c0c..8ff31de 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/results/hints/broadcast_hint_3.plan
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/results/hints/broadcast_hint_3.plan
@@ -5,7 +5,7 @@
-- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- HYBRID_HASH_JOIN [$$37, $$40, $$41][$$38, $$39, $$42] |PARTITIONED|
- -- HASH_PARTITION_EXCHANGE [$$37, $$40, $$41] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
@@ -13,7 +13,7 @@
-- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- HASH_PARTITION_EXCHANGE [$$38, $$39, $$42] |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/results/joins/nested_query_with_bcast.plan b/asterixdb/asterix-app/src/test/resources/optimizerts/results/joins/nested_query_with_bcast.plan
index cb1184e..68222ed 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/results/joins/nested_query_with_bcast.plan
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/results/joins/nested_query_with_bcast.plan
@@ -20,17 +20,17 @@
}
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- STABLE_SORT [$$36(ASC)] |PARTITIONED|
- -- HASH_PARTITION_EXCHANGE [$$36] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- HYBRID_HASH_JOIN [$$39][$$37] |PARTITIONED|
- -- HASH_PARTITION_EXCHANGE [$$39] |PARTITIONED|
+ -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- ASSIGN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- DATASOURCE_SCAN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
-- EMPTY_TUPLE_SOURCE |PARTITIONED|
- -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
+ -- BROADCAST_EXCHANGE |PARTITIONED|
-- STREAM_PROJECT |PARTITIONED|
-- ASSIGN |PARTITIONED|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_2_1/basic-1_2_1.5.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_2_1/basic-1_2_1.5.query.aql
index 9696695..7ae1beb 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_2_1/basic-1_2_1.5.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_2_1/basic-1_2_1.5.query.aql
@@ -39,7 +39,7 @@
for $token in $tokenUnrankedLeft
let $index :=
for $tokenRanked at $i in $rankedTokens
- where $token = /*+ bcast */ $tokenRanked
+ where $token = /*+ hash-bcast */ $tokenRanked
return $i
order by $index
return $index
@@ -54,7 +54,7 @@
let $lenLeft := len($tokenUnrankedLeft)
for $token in $tokenUnrankedLeft
for $tokenRanked at $i in $rankedTokens
- where $token = /*+ bcast */ $tokenRanked
+ where $token = /*+ hash-bcast */ $tokenRanked
order by $i
return $i
)
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_2_1/basic-1_2_1.6.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_2_1/basic-1_2_1.6.query.aql
index 310caa9..caed85c 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_2_1/basic-1_2_1.6.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_2_1/basic-1_2_1.6.query.aql
@@ -38,7 +38,7 @@
for $token in $tokenUnrankedLeft
let $index :=
for $tokenRanked at $i in $rankedTokens
- where $token = /*+ bcast */ $tokenRanked
+ where $token = /*+ hash-bcast */ $tokenRanked
return $i
order by $index
return $index
@@ -51,7 +51,7 @@
let $tokenUnrankedRight := word-tokens($right.authors)
for $token in $tokenUnrankedRight
for $tokenRanked at $i in $rankedTokens
- where $token = /*+ bcast */ $tokenRanked
+ where $token = /*+ hash-bcast */ $tokenRanked
order by $i
return $i
)
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_2_1/basic-1_2_1.7.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_2_1/basic-1_2_1.7.query.aql
index 4e51613..82e6189 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_2_1/basic-1_2_1.7.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_2_1/basic-1_2_1.7.query.aql
@@ -38,7 +38,7 @@
/*+ inmem 1 302 */
order by count($id), $tokenGrouped
return $tokenGrouped
- where $tokenUnranked = /*+ bcast */ $tokenRanked
+ where $tokenUnranked = /*+ hash-bcast */ $tokenRanked
return $i
order by $index[0]
return $index[0]
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_2_2/basic-1_2_2.3.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_2_2/basic-1_2_2.3.query.aql
index 510c1f0..10bc05f 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_2_2/basic-1_2_2.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_2_2/basic-1_2_2.3.query.aql
@@ -39,7 +39,7 @@
/*+ inmem 1 302 */
order by count($id), $tokenGrouped
return $tokenGrouped
- where $tokenUnranked = /*+ bcast */ $tokenRanked
+ where $tokenUnranked = /*+ hash-bcast */ $tokenRanked
order by $i
return $i
for $prefixTokenDBLP in subset-collection($tokensDBLP, 0, prefix-len-jaccard(len($tokensDBLP), .8f))
@@ -62,7 +62,7 @@
/*+ inmem 1 302 */
order by count($id), $tokenGrouped
return $tokenGrouped
- where $tokenUnranked = /*+ bcast */ $tokenRanked
+ where $tokenUnranked = /*+ hash-bcast */ $tokenRanked
order by $i
return $i
for $prefixTokenCSX in subset-collection($tokensCSX, 0, prefix-len-jaccard(len($tokensCSX), .8f))
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_2_2/basic-1_2_2.4.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_2_2/basic-1_2_2.4.query.aql
index b903881..3d440dd 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_2_2/basic-1_2_2.4.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_2_2/basic-1_2_2.4.query.aql
@@ -39,7 +39,7 @@
/*+ inmem 1 302 */
order by count($id), $tokenGrouped
return $tokenGrouped
- where $tokenUnranked = /*+ bcast */ $tokenRanked
+ where $tokenUnranked = /*+ hash-bcast */ $tokenRanked
order by $i
return $i
for $prefixTokenDBLP in subset-collection($tokensDBLP, 0, prefix-len-jaccard(len($tokensDBLP), .8f))
@@ -62,7 +62,7 @@
/*+ inmem 1 302 */
order by count($id), $tokenGrouped
return $tokenGrouped
- where $tokenUnranked = /*+ bcast */ $tokenRanked
+ where $tokenUnranked = /*+ hash-bcast */ $tokenRanked
order by $i
return $i
let $actualPrefixLen := prefix-len-jaccard(len($tokensUnrankedCSX), .8f) - len($tokensUnrankedCSX) + len($tokensCSX)
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_2_2/basic-1_2_2.5.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_2_2/basic-1_2_2.5.query.aql
index 119520a..fb0391c 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_2_2/basic-1_2_2.5.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_2_2/basic-1_2_2.5.query.aql
@@ -39,7 +39,7 @@
/*+ inmem 1 302 */
order by count($id), $tokenGrouped
return $tokenGrouped
- where $tokenUnranked = /*+ bcast */ $tokenRanked
+ where $tokenUnranked = /*+ hash-bcast */ $tokenRanked
order by $i
return $i
for $prefixTokenDBLP in subset-collection($tokensDBLP, 0, prefix-len-jaccard(len($tokensDBLP), .8f))
@@ -62,7 +62,7 @@
/*+ inmem 1 302 */
order by count($id), $tokenGrouped
return $tokenGrouped
- where $tokenUnranked = /*+ bcast */ $tokenRanked
+ where $tokenUnranked = /*+ hash-bcast */ $tokenRanked
order by $i
return $i
let $actualPrefixLen := prefix-len-jaccard(len($tokensUnrankedCSX), .8f) - len($tokensUnrankedCSX) + len($tokensCSX)
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_2_2/basic-1_2_2.6.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_2_2/basic-1_2_2.6.query.aql
index 465cda9..92cea6f 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_2_2/basic-1_2_2.6.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_2_2/basic-1_2_2.6.query.aql
@@ -38,7 +38,7 @@
/*+ inmem 1 302 */
order by count($id), $tokenGrouped
return $tokenGrouped
- where $tokenUnranked = /*+ bcast */ $tokenRanked
+ where $tokenUnranked = /*+ hash-bcast */ $tokenRanked
order by $i
return $i
for $prefixTokenDBLP in subset-collection($tokensDBLP, 0, prefix-len-jaccard(len($tokensDBLP), .8f))
@@ -61,7 +61,7 @@
/*+ inmem 1 302 */
order by count($id), $tokenGrouped
return $tokenGrouped
- where $tokenUnranked = /*+ bcast */ $tokenRanked
+ where $tokenUnranked = /*+ hash-bcast */ $tokenRanked
order by $i
return $i
let $actualPrefixLen := prefix-len-jaccard(len($tokensUnrankedCSX), .8f) - len($tokensUnrankedCSX) + len($tokensCSX)
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_2_3/basic-1_2_3.3.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_2_3/basic-1_2_3.3.query.aql
index 009c2b9..dc4bf72 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_2_3/basic-1_2_3.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_2_3/basic-1_2_3.3.query.aql
@@ -69,10 +69,10 @@
let $sstr := for $t in word-tokens($d.sstr) order by $t return $t
let $rlen := len(for $t in word-tokens($d.rstr) order by $t return $t)
let $slen := len(for $t in word-tokens($d.sstr) order by $t return $t)
- let $orstr := for $t in word-tokens($d.rstr) for $token at $i in $orderedTokens where $t /*+ bcast */ = $token order by $i return $i
- let $osstr := for $t in word-tokens($d.sstr) for $token at $i in $orderedTokens where $t /*+ bcast */ = $token order by $i return $i
- let $lorstr := len(for $t in word-tokens($d.rstr) for $token at $i in $orderedTokens where $t /*+ bcast */ = $token order by $i return $i)
- let $losstr := len(for $t in word-tokens($d.sstr) for $token at $i in $orderedTokens where $t /*+ bcast */ = $token order by $i return $i)
+ let $orstr := for $t in word-tokens($d.rstr) for $token at $i in $orderedTokens where $t /*+ hash-bcast */ = $token order by $i return $i
+ let $osstr := for $t in word-tokens($d.sstr) for $token at $i in $orderedTokens where $t /*+ hash-bcast */ = $token order by $i return $i
+ let $lorstr := len(for $t in word-tokens($d.rstr) for $token at $i in $orderedTokens where $t /*+ hash-bcast */ = $token order by $i return $i)
+ let $losstr := len(for $t in word-tokens($d.sstr) for $token at $i in $orderedTokens where $t /*+ hash-bcast */ = $token order by $i return $i)
return {
"rid": $rid,
"sid": $sid,
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_2_4/basic-1_2_4.3.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_2_4/basic-1_2_4.3.query.aql
index b6976bd..9a82b6e 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_2_4/basic-1_2_4.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_2_4/basic-1_2_4.3.query.aql
@@ -41,7 +41,7 @@
/*+ inmem 1 302 */
order by count($id), $tokenGrouped
return $tokenGrouped
- where $tokenUnranked = /*+ bcast */ $tokenRanked
+ where $tokenUnranked = /*+ hash-bcast */ $tokenRanked
order by $i
return $i
@@ -60,7 +60,7 @@
/*+ inmem 1 302 */
order by count($id), $tokenGrouped
return $tokenGrouped
- where $tokenUnranked = /*+ bcast */ $tokenRanked
+ where $tokenUnranked = /*+ hash-bcast */ $tokenRanked
order by $i
return $i
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_2_7/basic-1_2_7.3.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_2_7/basic-1_2_7.3.query.aql
index 597e8a1..a8aee97 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_2_7/basic-1_2_7.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_2_7/basic-1_2_7.3.query.aql
@@ -69,10 +69,10 @@
let $sstr := for $t in word-tokens($d.sstr) order by $t return $t
let $rlen := len(for $t in word-tokens($d.rstr) order by $t return $t)
let $slen := len(for $t in word-tokens($d.sstr) order by $t return $t)
- let $orstr := for $t in word-tokens($d.rstr) for $token at $i in $orderedTokens where $t /*+ bcast */ = $token order by $i return $i
- let $osstr := for $t in word-tokens($d.sstr) for $token at $i in $orderedTokens where $t /*+ bcast */ = $token order by $i return $i
- let $lorstr := len(for $t in word-tokens($d.rstr) for $token at $i in $orderedTokens where $t /*+ bcast */ = $token order by $i return $i)
- let $losstr := len(for $t in word-tokens($d.sstr) for $token at $i in $orderedTokens where $t /*+ bcast */ = $token order by $i return $i)
+ let $orstr := for $t in word-tokens($d.rstr) for $token at $i in $orderedTokens where $t /*+ hash-bcast */ = $token order by $i return $i
+ let $osstr := for $t in word-tokens($d.sstr) for $token at $i in $orderedTokens where $t /*+ hash-bcast */ = $token order by $i return $i
+ let $lorstr := len(for $t in word-tokens($d.rstr) for $token at $i in $orderedTokens where $t /*+ hash-bcast */ = $token order by $i return $i)
+ let $losstr := len(for $t in word-tokens($d.sstr) for $token at $i in $orderedTokens where $t /*+ hash-bcast */ = $token order by $i return $i)
return {
"rid": $rid,
"sid": $sid,
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_3_1/basic-1_3_1.5.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_3_1/basic-1_3_1.5.query.aql
index ad93db1..f8d75e6 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_3_1/basic-1_3_1.5.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_3_1/basic-1_3_1.5.query.aql
@@ -37,7 +37,7 @@
/*+ hash */ group by $tokenRightGrouped := $orderTokenRight with $rightId
/*+ inmem 1 302 */ order by count($rightId)
return $tokenRightGrouped
- where $tokenUnranked = /*+ bcast */ $tokenRanked
+ where $tokenUnranked = /*+ hash-bcast */ $tokenRanked
order by $i
return $i
for $prefixTokenRight in subset-collection($tokensRight, 0, prefix-len-jaccard(len($tokensRight), .8f))
@@ -58,7 +58,7 @@
/*+ hash */ group by $tokenRightGrouped := $orderTokenRight with $rightId
/*+ inmem 1 302 */ order by count($rightId)
return $tokenRightGrouped
- where $tokenUnranked = /*+ bcast */ $tokenRanked
+ where $tokenUnranked = /*+ hash-bcast */ $tokenRanked
order by $i
return $i
let $actualPrefixLen := prefix-len-jaccard(len($tokensUnrankedLeft), .8f) - len($tokensUnrankedLeft) + len($tokensLeft)
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_3_1/basic-1_3_1.6.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_3_1/basic-1_3_1.6.query.aql
index 5594de3..273c270 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_3_1/basic-1_3_1.6.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/basic-1_3_1/basic-1_3_1.6.query.aql
@@ -47,7 +47,7 @@
/*+ inmem 1 302 */ order by $r.rc * $l.lc
return $r.rt
- where $tokenUnranked = /*+ bcast */ $tokenRanked
+ where $tokenUnranked = /*+ hash-bcast */ $tokenRanked
order by $i
return $i
for $prefixTokenRight in subset-collection($tokensRight, 0, prefix-len-jaccard(len($tokensRight), .8f))
@@ -78,7 +78,7 @@
/*+ inmem 1 302 */ order by $r.rc * $l.lc
return $r.rt
- where $tokenUnranked = /*+ bcast */ $tokenRanked
+ where $tokenUnranked = /*+ hash-bcast */ $tokenRanked
order by $i
return $i
let $actualPrefixLen := prefix-len-jaccard(len($tokensUnrankedLeft), .8f) - len($tokensUnrankedLeft) + len($tokensLeft)
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.1_5.3.1/dblp-2.1_5.3.1.3.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.1_5.3.1/dblp-2.1_5.3.1.3.query.aql
index f227271..c189503 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.1_5.3.1/dblp-2.1_5.3.1.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.1_5.3.1/dblp-2.1_5.3.1.3.query.aql
@@ -39,7 +39,7 @@
/*+ inmem 1 302 */
order by count($id), $tokenGroupped
return $tokenGroupped
- where $tokenUnranked = /*+ bcast*/ $tokenRanked
+ where $tokenUnranked = /*+ hash-bcast*/ $tokenRanked
order by $i
return $i
for $prefixTokenDBLP in subset-collection(
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.2/dblp-2.2.3.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.2/dblp-2.2.3.query.aql
index ab85714..84a1d4f 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.2/dblp-2.2.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2.2/dblp-2.2.3.query.aql
@@ -29,7 +29,7 @@
let $tokensDBLP :=
for $tokenUnranked in $tokensUnrankedDBLP
for $tokenRanked in dataset('TOKENSRANKEDADM')
- where $tokenUnranked = /*+ bcast*/ $tokenRanked.token
+ where $tokenUnranked = /*+ hash-bcast*/ $tokenRanked.token
order by $tokenRanked.rank
return $tokenRanked.rank
for $prefixTokenDBLP in subset-collection(
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.2/dblp-2_5.2.3.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.2/dblp-2_5.2.3.query.aql
index 3bf04f9..335b0c5 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.2/dblp-2_5.2.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.2/dblp-2_5.2.3.query.aql
@@ -39,7 +39,7 @@
group by $tokenGrouped := $token with $id
order by count($id), $tokenGrouped
return $tokenGrouped
- where $tokenUnranked = /*+ bcast*/ $tokenRanked
+ where $tokenUnranked = /*+ hash-bcast*/ $tokenRanked
order by $i
return $i
order by $idDBLP
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3.1/dblp-2_5.3.1.3.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3.1/dblp-2_5.3.1.3.query.aql
index d07f2ff..2c76d3f 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3.1/dblp-2_5.3.1.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3.1/dblp-2_5.3.1.3.query.aql
@@ -40,7 +40,7 @@
/*+ inmem 1 302 */
order by count($id), $tokenGrouped
return $tokenGrouped
- where $tokenUnranked = /*+ bcast*/ $tokenRanked
+ where $tokenUnranked = /*+ hash-bcast*/ $tokenRanked
order by $i
return $i
order by $idDBLP
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3/dblp-2_5.3.3.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3/dblp-2_5.3.3.query.aql
index d07f2ff..2c76d3f 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3/dblp-2_5.3.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-2_5.3/dblp-2_5.3.3.query.aql
@@ -40,7 +40,7 @@
/*+ inmem 1 302 */
order by count($id), $tokenGrouped
return $tokenGrouped
- where $tokenUnranked = /*+ bcast*/ $tokenRanked
+ where $tokenUnranked = /*+ hash-bcast*/ $tokenRanked
order by $i
return $i
order by $idDBLP
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.2/dblp-3_1.2.3.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.2/dblp-3_1.2.3.query.aql
index 938cc7a..cc3eccc 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.2/dblp-3_1.2.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-3_1.2/dblp-3_1.2.3.query.aql
@@ -40,7 +40,7 @@
group by $tokenGroupped := $token with $paper
order by count($paper), $tokenGroupped
return $tokenGroupped
- where $tokenUnranked = /*+ bcast */ $tokenRanked
+ where $tokenUnranked = /*+ hash-bcast */ $tokenRanked
order by $i
return $i
for $prefixTokenLeft in subset-collection(
@@ -62,7 +62,7 @@
group by $tokenGroupped := $token with $paper
order by count($paper), $tokenGroupped
return $tokenGroupped
- where $tokenUnranked = /*+ bcast */ $tokenRanked
+ where $tokenUnranked = /*+ hash-bcast */ $tokenRanked
order by $i
return $i
for $prefixTokenRight in subset-collection(
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3.1/dblp-csx-2_5.3.1.3.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3.1/dblp-csx-2_5.3.1.3.query.aql
index b552dd1..c085e8e 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3.1/dblp-csx-2_5.3.1.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3.1/dblp-csx-2_5.3.1.3.query.aql
@@ -40,7 +40,7 @@
/*+ inmem 1 302 */
order by count($id), $tokenGroupped
return $tokenGroupped
- where $tokenUnranked = /*+ bcast */ $tokenRanked
+ where $tokenUnranked = /*+ hash-bcast */ $tokenRanked
order by $i
return $i
for $prefixTokenDBLP in subset-collection(
@@ -66,7 +66,7 @@
/*+ inmem 1 302 */
order by count($id), $tokenGroupped
return $tokenGroupped
- where $tokenUnranked = /*+ bcast */ $tokenRanked
+ where $tokenUnranked = /*+ hash-bcast */ $tokenRanked
order by $i
return $i
for $prefixTokenCSX in subset-collection(
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3/dblp-csx-2_5.3.3.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3/dblp-csx-2_5.3.3.query.aql
index e095fa3..d2b026b 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3/dblp-csx-2_5.3.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-2_5.3/dblp-csx-2_5.3.3.query.aql
@@ -40,7 +40,7 @@
/*+ inmem 1 302 */
order by count($id), $tokenGrouped
return $tokenGrouped
- where $tokenUnranked = /*+ bcast */ $tokenRanked
+ where $tokenUnranked = /*+ hash-bcast */ $tokenRanked
order by $i
return $i
for $prefixTokenDBLP in subset-collection(
@@ -66,7 +66,7 @@
/*+ inmem 1 302 */
order by count($id), $tokenGrouped
return $tokenGrouped
- where $tokenUnranked = /*+ bcast */ $tokenRanked
+ where $tokenUnranked = /*+ hash-bcast */ $tokenRanked
order by $i
return $i
for $prefixTokenCSX in subset-collection(
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.2/dblp-csx-3_5.2.3.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.2/dblp-csx-3_5.2.3.query.aql
index dd9b3b7..ee73947 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.2/dblp-csx-3_5.2.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.2/dblp-csx-3_5.2.3.query.aql
@@ -43,7 +43,7 @@
group by $tokenGrouped := $token with $id
order by count($id), $tokenGrouped
return $tokenGrouped
- where $tokenUnranked = /*+ bcast */ $tokenRanked
+ where $tokenUnranked = /*+ hash-bcast */ $tokenRanked
order by $i
return $i
for $prefixTokenDBLP in subset-collection(
@@ -68,7 +68,7 @@
group by $tokenGrouped := $token with $id
order by count($id), $tokenGrouped
return $tokenGrouped
- where $tokenUnranked = /*+ bcast */ $tokenRanked
+ where $tokenUnranked = /*+ hash-bcast */ $tokenRanked
order by $i
return $i
for $prefixTokenCSX in subset-collection(
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3.1/dblp-csx-3_5.3.1.3.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3.1/dblp-csx-3_5.3.1.3.query.aql
index ebe7ab0..857b5b3 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3.1/dblp-csx-3_5.3.1.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3.1/dblp-csx-3_5.3.1.3.query.aql
@@ -44,7 +44,7 @@
/*+ inmem 1 302 */
order by count($id), $tokenGrouped
return $tokenGrouped
- where $tokenUnranked = /*+ bcast */ $tokenRanked
+ where $tokenUnranked = /*+ hash-bcast */ $tokenRanked
order by $i
return $i
for $prefixTokenDBLP in subset-collection(
@@ -70,7 +70,7 @@
/*+ inmem 1 302 */
order by count($id), $tokenGrouped
return $tokenGrouped
- where $tokenUnranked = /*+ bcast */ $tokenRanked
+ where $tokenUnranked = /*+ hash-bcast */ $tokenRanked
order by $i
return $i
for $prefixTokenCSX in subset-collection(
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3/dblp-csx-3_5.3.3.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3/dblp-csx-3_5.3.3.query.aql
index eacdd2e..3a45ff5 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3/dblp-csx-3_5.3.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.3/dblp-csx-3_5.3.3.query.aql
@@ -44,7 +44,7 @@
/*+ inmem 1 302 */
order by count($id), $tokenGroupped
return $tokenGroupped
- where $tokenUnranked = /*+ bcast */ $tokenRanked
+ where $tokenUnranked = /*+ hash-bcast */ $tokenRanked
order by $i
return $i
for $prefixTokenDBLP in subset-collection(
@@ -70,7 +70,7 @@
/*+ inmem 1 302 */
order by count($id), $tokenGroupped
return $tokenGroupped
- where $tokenUnranked = /*+ bcast */ $tokenRanked
+ where $tokenUnranked = /*+ hash-bcast */ $tokenRanked
order by $i
return $i
for $prefixTokenCSX in subset-collection(
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4.1/dblp-csx-3_5.4.1.3.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4.1/dblp-csx-3_5.4.1.3.query.aql
index c0fc0f0..4e3a821 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4.1/dblp-csx-3_5.4.1.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4.1/dblp-csx-3_5.4.1.3.query.aql
@@ -47,7 +47,7 @@
/*+ inmem 1 302 */
order by count($id), $tokenGrouped
return $tokenGrouped
- where $tokenUnranked = /*+ bcast */ $tokenRanked
+ where $tokenUnranked = /*+ hash-bcast */ $tokenRanked
order by $i
return $i
for $prefixTokenDBLP in subset-collection(
@@ -73,7 +73,7 @@
/*+ inmem 1 302 */
order by count($id), $tokenGrouped
return $tokenGrouped
- where $tokenUnranked = /*+ bcast */ $tokenRanked
+ where $tokenUnranked = /*+ hash-bcast */ $tokenRanked
order by $i
return $i
for $prefixTokenCSX in subset-collection(
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4/dblp-csx-3_5.4.3.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4/dblp-csx-3_5.4.3.query.aql
index 6706129..872d1c7 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4/dblp-csx-3_5.4.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/fuzzyjoin/dblp-csx-3_5.4/dblp-csx-3_5.4.3.query.aql
@@ -47,7 +47,7 @@
/*+ inmem 1 302 */
order by count($id), $tokenGrouped
return $tokenGrouped
- where $tokenUnranked = /*+ bcast */ $tokenRanked
+ where $tokenUnranked = /*+ hash-bcast */ $tokenRanked
order by $i
return $i
for $prefixTokenDBLP in subset-collection(
@@ -73,7 +73,7 @@
/*+ inmem 1 302 */
order by count($id), $tokenGrouped
return $tokenGrouped
- where $tokenUnranked = /*+ bcast */ $tokenRanked
+ where $tokenUnranked = /*+ hash-bcast */ $tokenRanked
order by $i
return $i
for $prefixTokenCSX in subset-collection(
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/like_02/like_02.1.ddl.sqlpp
similarity index 81%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/like_02/like_02.1.ddl.sqlpp
index a158d7f..7c48143 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/like_02/like_02.1.ddl.sqlpp
@@ -17,8 +17,9 @@
* under the License.
*/
-{
- 'result1':regexp_replace('abracadabra','a',''),
- 'result2':regexp_replace('abracadabra','a(.)','a$1$1'),
- 'result3':regexp_replace('darted','^(.*?)d(.*)$','$1c$2')
-};
+DROP DATAVERSE test IF EXISTS;
+CREATE DATAVERSE test;
+USE test;
+
+CREATE TYPE t AS {id: int};
+CREATE DATASET ds(t) PRIMARY KEY id;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/like_02/like_02.2.update.sqlpp
similarity index 78%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/like_02/like_02.2.update.sqlpp
index a158d7f..37db984 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/like_02/like_02.2.update.sqlpp
@@ -17,8 +17,10 @@
* under the License.
*/
-{
- 'result1':regexp_replace('abracadabra','a',''),
- 'result2':regexp_replace('abracadabra','a(.)','a$1$1'),
- 'result3':regexp_replace('darted','^(.*?)d(.*)$','$1c$2')
-};
+USE test;
+
+INSERT INTO ds [
+{"id": 1, "test_str": "hello \n world", "pattern": "%world"},
+{"id": 2, "test_str": "hello \n world", "pattern": "%orld"},
+{"id": 3, "test_str": "hello \n world", "pattern": "%orld"}
+];
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/like_02/like_02.3.query.sqlpp
similarity index 68%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/like_02/like_02.3.query.sqlpp
index a158d7f..9640747 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/like_02/like_02.3.query.sqlpp
@@ -17,8 +17,17 @@
* under the License.
*/
-{
- 'result1':regexp_replace('abracadabra','a',''),
- 'result2':regexp_replace('abracadabra','a(.)','a$1$1'),
- 'result3':regexp_replace('darted','^(.*?)d(.*)$','$1c$2')
-};
+SELECT ELEMENT A FROM [
+ "test\\string" LIKE "%\\\\%",
+ "abc ()/\\[]{}.,<>~!@#$%&*-_+=|;:'\"?" LIKE "%\\%",
+ "abc ()/\\[]{}.,<>~!@#$%&*-_+=|;:'\"?%" LIKE "%\\%",
+
+ 'ab\\c' LIKE '__\\\\c',
+ 'abc\\' LIKE '\\___',
+ '\\abc' LIKE '\\___',
+ '\\abc' LIKE '\\\\___',
+ '_abc' LIKE '\\___',
+ '_ab' LIKE '\\___',
+ 'tg\n' LIKE '__\n',
+ 'tg\\\n' LIKE '__\\\\_'
+] AS A;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/like_02/like_02.4.query.sqlpp
similarity index 81%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/like_02/like_02.4.query.sqlpp
index a158d7f..b478f4e 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/like_02/like_02.4.query.sqlpp
@@ -17,8 +17,6 @@
* under the License.
*/
-{
- 'result1':regexp_replace('abracadabra','a',''),
- 'result2':regexp_replace('abracadabra','a(.)','a$1$1'),
- 'result3':regexp_replace('darted','^(.*?)d(.*)$','$1c$2')
-};
+USE test;
+
+FROM ds SELECT VALUE test_str LIKE pattern ORDER BY id;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/like_02/like_02.5.ddl.sqlpp
similarity index 81%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/like_02/like_02.5.ddl.sqlpp
index a158d7f..36b2bab 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/like_02/like_02.5.ddl.sqlpp
@@ -17,8 +17,4 @@
* under the License.
*/
-{
- 'result1':regexp_replace('abracadabra','a',''),
- 'result2':regexp_replace('abracadabra','a(.)','a$1$1'),
- 'result3':regexp_replace('darted','^(.*?)d(.*)$','$1c$2')
-};
+DROP DATAVERSE test IF EXISTS;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/like_03_negative/like_03_negative.1.query.sqlpp
similarity index 81%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/like_03_negative/like_03_negative.1.query.sqlpp
index a158d7f..d3595fe 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/like_03_negative/like_03_negative.1.query.sqlpp
@@ -17,8 +17,6 @@
* under the License.
*/
-{
- 'result1':regexp_replace('abracadabra','a',''),
- 'result2':regexp_replace('abracadabra','a(.)','a$1$1'),
- 'result3':regexp_replace('darted','^(.*?)d(.*)$','$1c$2')
-};
+SELECT ELEMENT A FROM [
+ 'ab\\c' LIKE '__\\c'
+] AS A;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/like_03_negative/like_03_negative.2.query.sqlpp
similarity index 82%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/like_03_negative/like_03_negative.2.query.sqlpp
index a158d7f..018c5fa 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/like_03_negative/like_03_negative.2.query.sqlpp
@@ -17,8 +17,6 @@
* under the License.
*/
-{
- 'result1':regexp_replace('abracadabra','a',''),
- 'result2':regexp_replace('abracadabra','a(.)','a$1$1'),
- 'result3':regexp_replace('darted','^(.*?)d(.*)$','$1c$2')
-};
+SELECT ELEMENT A FROM [
+ "test\\string" LIKE "%\\"
+] AS A;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.1.ddl.sqlpp
similarity index 81%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.1.ddl.sqlpp
index a158d7f..7c48143 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.1.ddl.sqlpp
@@ -17,8 +17,9 @@
* under the License.
*/
-{
- 'result1':regexp_replace('abracadabra','a',''),
- 'result2':regexp_replace('abracadabra','a(.)','a$1$1'),
- 'result3':regexp_replace('darted','^(.*?)d(.*)$','$1c$2')
-};
+DROP DATAVERSE test IF EXISTS;
+CREATE DATAVERSE test;
+USE test;
+
+CREATE TYPE t AS {id: int};
+CREATE DATASET ds(t) PRIMARY KEY id;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.2.update.sqlpp
similarity index 77%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.2.update.sqlpp
index a158d7f..76de6d1 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.2.update.sqlpp
@@ -17,8 +17,11 @@
* under the License.
*/
-{
- 'result1':regexp_replace('abracadabra','a',''),
- 'result2':regexp_replace('abracadabra','a(.)','a$1$1'),
- 'result3':regexp_replace('darted','^(.*?)d(.*)$','$1c$2')
-};
+USE test;
+
+INSERT INTO ds [
+{"id": 1, "test_str": "hello world", "pattern": "\\w"},
+{"id": 2, "test_str": "\n", "pattern": "\\w"},
+{"id": 3, "test_str": "hello world", "pattern": "\\d"},
+{"id": 4, "test_str": "\n", "pattern": "\\w"}
+];
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.1.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.3.query.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.1.query.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.3.query.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.4.query.sqlpp
similarity index 81%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.4.query.sqlpp
index a158d7f..7090ce4 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.4.query.sqlpp
@@ -17,8 +17,6 @@
* under the License.
*/
-{
- 'result1':regexp_replace('abracadabra','a',''),
- 'result2':regexp_replace('abracadabra','a(.)','a$1$1'),
- 'result3':regexp_replace('darted','^(.*?)d(.*)$','$1c$2')
-};
+USE test;
+
+FROM ds SELECT VALUE regexp_contains(test_str, pattern) ORDER BY id;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.5.ddl.sqlpp
similarity index 81%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.5.ddl.sqlpp
index a158d7f..36b2bab 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.5.ddl.sqlpp
@@ -17,8 +17,4 @@
* under the License.
*/
-{
- 'result1':regexp_replace('abracadabra','a',''),
- 'result2':regexp_replace('abracadabra','a(.)','a$1$1'),
- 'result3':regexp_replace('darted','^(.*?)d(.*)$','$1c$2')
-};
+DROP DATAVERSE test IF EXISTS;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag.1.ddl.sqlpp
similarity index 81%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag.1.ddl.sqlpp
index a158d7f..7c48143 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag.1.ddl.sqlpp
@@ -17,8 +17,9 @@
* under the License.
*/
-{
- 'result1':regexp_replace('abracadabra','a',''),
- 'result2':regexp_replace('abracadabra','a(.)','a$1$1'),
- 'result3':regexp_replace('darted','^(.*?)d(.*)$','$1c$2')
-};
+DROP DATAVERSE test IF EXISTS;
+CREATE DATAVERSE test;
+USE test;
+
+CREATE TYPE t AS {id: int};
+CREATE DATASET ds(t) PRIMARY KEY id;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag.2.update.sqlpp
similarity index 62%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag.2.update.sqlpp
index a158d7f..55e2b8e 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag.2.update.sqlpp
@@ -17,8 +17,14 @@
* under the License.
*/
-{
- 'result1':regexp_replace('abracadabra','a',''),
- 'result2':regexp_replace('abracadabra','a(.)','a$1$1'),
- 'result3':regexp_replace('darted','^(.*?)d(.*)$','$1c$2')
-};
+USE test;
+
+INSERT INTO ds [
+{"id": 1, "test_str": "hello world", "pattern": "h", "flags": "i"},
+{"id": 2, "test_str": "hello world", "pattern": "H", "flags": "i"},
+{"id": 3, "test_str": "hello world", "pattern": "H", "flags": "i"},
+{"id": 4, "test_str": "hello world", "pattern": "H", "flags": "s"},
+{"id": 5, "test_str": "hello world", "pattern": "H", "flags": "s"},
+{"id": 6, "test_str": "\n", "pattern": ".", "flags": "s"},
+{"id": 7, "test_str": "\n", "pattern": ".", "flags": ""}
+];
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains.1.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag.3.query.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains.1.query.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag.3.query.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag.4.query.sqlpp
similarity index 81%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag.4.query.sqlpp
index a158d7f..199d20f 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag.4.query.sqlpp
@@ -17,8 +17,6 @@
* under the License.
*/
-{
- 'result1':regexp_replace('abracadabra','a',''),
- 'result2':regexp_replace('abracadabra','a(.)','a$1$1'),
- 'result3':regexp_replace('darted','^(.*?)d(.*)$','$1c$2')
-};
+USE test;
+
+FROM ds SELECT VALUE regexp_contains(test_str, pattern, flags) ORDER BY id;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flags.5.ddl.sqlpp
similarity index 81%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flags.5.ddl.sqlpp
index a158d7f..36b2bab 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flags.5.ddl.sqlpp
@@ -17,8 +17,4 @@
* under the License.
*/
-{
- 'result1':regexp_replace('abracadabra','a',''),
- 'result2':regexp_replace('abracadabra','a(.)','a$1$1'),
- 'result3':regexp_replace('darted','^(.*?)d(.*)$','$1c$2')
-};
+DROP DATAVERSE test IF EXISTS;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.1.ddl.sqlpp
similarity index 81%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.1.ddl.sqlpp
index a158d7f..7c48143 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.1.ddl.sqlpp
@@ -17,8 +17,9 @@
* under the License.
*/
-{
- 'result1':regexp_replace('abracadabra','a',''),
- 'result2':regexp_replace('abracadabra','a(.)','a$1$1'),
- 'result3':regexp_replace('darted','^(.*?)d(.*)$','$1c$2')
-};
+DROP DATAVERSE test IF EXISTS;
+CREATE DATAVERSE test;
+USE test;
+
+CREATE TYPE t AS {id: int};
+CREATE DATASET ds(t) PRIMARY KEY id;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.2.update.sqlpp
similarity index 76%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.2.update.sqlpp
index a158d7f..300a5f2 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.2.update.sqlpp
@@ -17,8 +17,11 @@
* under the License.
*/
-{
- 'result1':regexp_replace('abracadabra','a',''),
- 'result2':regexp_replace('abracadabra','a(.)','a$1$1'),
- 'result3':regexp_replace('darted','^(.*?)d(.*)$','$1c$2')
-};
+USE test;
+
+INSERT INTO ds [
+{"id": 1, "test_str": "hello_world", "pattern": "\\w+"},
+{"id": 2, "test_str": "\n", "pattern": "\\w+"},
+{"id": 3, "test_str": "hello_world", "pattern": "\\d+"},
+{"id": 4, "test_str": "\n", "pattern": "\\w+"}
+];
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.1.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.3.query.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.1.query.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.3.query.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.4.query.sqlpp
similarity index 81%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.4.query.sqlpp
index a158d7f..de3d809 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.4.query.sqlpp
@@ -17,8 +17,6 @@
* under the License.
*/
-{
- 'result1':regexp_replace('abracadabra','a',''),
- 'result2':regexp_replace('abracadabra','a(.)','a$1$1'),
- 'result3':regexp_replace('darted','^(.*?)d(.*)$','$1c$2')
-};
+USE test;
+
+FROM ds SELECT VALUE regexp_like(test_str, pattern) ORDER BY id;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.5.ddl.sqlpp
similarity index 81%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.5.ddl.sqlpp
index a158d7f..36b2bab 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.5.ddl.sqlpp
@@ -17,8 +17,4 @@
* under the License.
*/
-{
- 'result1':regexp_replace('abracadabra','a',''),
- 'result2':regexp_replace('abracadabra','a(.)','a$1$1'),
- 'result3':regexp_replace('darted','^(.*?)d(.*)$','$1c$2')
-};
+DROP DATAVERSE test IF EXISTS;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag.1.ddl.sqlpp
similarity index 81%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag.1.ddl.sqlpp
index a158d7f..7c48143 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag.1.ddl.sqlpp
@@ -17,8 +17,9 @@
* under the License.
*/
-{
- 'result1':regexp_replace('abracadabra','a',''),
- 'result2':regexp_replace('abracadabra','a(.)','a$1$1'),
- 'result3':regexp_replace('darted','^(.*?)d(.*)$','$1c$2')
-};
+DROP DATAVERSE test IF EXISTS;
+CREATE DATAVERSE test;
+USE test;
+
+CREATE TYPE t AS {id: int};
+CREATE DATASET ds(t) PRIMARY KEY id;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag.2.update.sqlpp
similarity index 61%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag.2.update.sqlpp
index a158d7f..b5ab61a 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag.2.update.sqlpp
@@ -17,8 +17,14 @@
* under the License.
*/
-{
- 'result1':regexp_replace('abracadabra','a',''),
- 'result2':regexp_replace('abracadabra','a(.)','a$1$1'),
- 'result3':regexp_replace('darted','^(.*?)d(.*)$','$1c$2')
-};
+USE test;
+
+INSERT INTO ds [
+{"id": 1, "test_str": "hello_world", "pattern": "h\\w+", "flags": "i"},
+{"id": 2, "test_str": "hello_world", "pattern": "H\\w+", "flags": "i"},
+{"id": 3, "test_str": "hello_world", "pattern": "H\\w+", "flags": "i"},
+{"id": 4, "test_str": "hello_world", "pattern": "H\\w+", "flags": "s"},
+{"id": 5, "test_str": "hello_world", "pattern": "H\\w+", "flags": "s"},
+{"id": 6, "test_str": "\n", "pattern": ".", "flags": "s"},
+{"id": 7, "test_str": "\n", "pattern": ".", "flags": ""}
+];
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag.1.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag.3.query.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag.1.query.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag.3.query.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag.4.query.sqlpp
similarity index 81%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag.4.query.sqlpp
index a158d7f..199d20f 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag.4.query.sqlpp
@@ -17,8 +17,6 @@
* under the License.
*/
-{
- 'result1':regexp_replace('abracadabra','a',''),
- 'result2':regexp_replace('abracadabra','a(.)','a$1$1'),
- 'result3':regexp_replace('darted','^(.*?)d(.*)$','$1c$2')
-};
+USE test;
+
+FROM ds SELECT VALUE regexp_contains(test_str, pattern, flags) ORDER BY id;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flags.5.ddl.sqlpp
similarity index 81%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flags.5.ddl.sqlpp
index a158d7f..36b2bab 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flags.5.ddl.sqlpp
@@ -17,8 +17,4 @@
* under the License.
*/
-{
- 'result1':regexp_replace('abracadabra','a',''),
- 'result2':regexp_replace('abracadabra','a(.)','a$1$1'),
- 'result3':regexp_replace('darted','^(.*?)d(.*)$','$1c$2')
-};
+DROP DATAVERSE test IF EXISTS;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.1.ddl.sqlpp
similarity index 81%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.1.ddl.sqlpp
index a158d7f..7c48143 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.1.ddl.sqlpp
@@ -17,8 +17,9 @@
* under the License.
*/
-{
- 'result1':regexp_replace('abracadabra','a',''),
- 'result2':regexp_replace('abracadabra','a(.)','a$1$1'),
- 'result3':regexp_replace('darted','^(.*?)d(.*)$','$1c$2')
-};
+DROP DATAVERSE test IF EXISTS;
+CREATE DATAVERSE test;
+USE test;
+
+CREATE TYPE t AS {id: int};
+CREATE DATASET ds(t) PRIMARY KEY id;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.2.update.sqlpp
similarity index 76%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.2.update.sqlpp
index a158d7f..300a5f2 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.2.update.sqlpp
@@ -17,8 +17,11 @@
* under the License.
*/
-{
- 'result1':regexp_replace('abracadabra','a',''),
- 'result2':regexp_replace('abracadabra','a(.)','a$1$1'),
- 'result3':regexp_replace('darted','^(.*?)d(.*)$','$1c$2')
-};
+USE test;
+
+INSERT INTO ds [
+{"id": 1, "test_str": "hello_world", "pattern": "\\w+"},
+{"id": 2, "test_str": "\n", "pattern": "\\w+"},
+{"id": 3, "test_str": "hello_world", "pattern": "\\d+"},
+{"id": 4, "test_str": "\n", "pattern": "\\w+"}
+];
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.1.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.3.query.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.1.query.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.3.query.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
similarity index 81%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
index a158d7f..7bd4fad 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
@@ -17,8 +17,6 @@
* under the License.
*/
-{
- 'result1':regexp_replace('abracadabra','a',''),
- 'result2':regexp_replace('abracadabra','a(.)','a$1$1'),
- 'result3':regexp_replace('darted','^(.*?)d(.*)$','$1c$2')
-};
+USE test;
+
+FROM ds SELECT VALUE regexp_position(test_str, pattern) ORDER BY id;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.5.ddl.sqlpp
similarity index 81%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.5.ddl.sqlpp
index a158d7f..36b2bab 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.5.ddl.sqlpp
@@ -17,8 +17,4 @@
* under the License.
*/
-{
- 'result1':regexp_replace('abracadabra','a',''),
- 'result2':regexp_replace('abracadabra','a(.)','a$1$1'),
- 'result3':regexp_replace('darted','^(.*?)d(.*)$','$1c$2')
-};
+DROP DATAVERSE test IF EXISTS;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.1.ddl.sqlpp
similarity index 81%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.1.ddl.sqlpp
index a158d7f..7c48143 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.1.ddl.sqlpp
@@ -17,8 +17,9 @@
* under the License.
*/
-{
- 'result1':regexp_replace('abracadabra','a',''),
- 'result2':regexp_replace('abracadabra','a(.)','a$1$1'),
- 'result3':regexp_replace('darted','^(.*?)d(.*)$','$1c$2')
-};
+DROP DATAVERSE test IF EXISTS;
+CREATE DATAVERSE test;
+USE test;
+
+CREATE TYPE t AS {id: int};
+CREATE DATASET ds(t) PRIMARY KEY id;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.2.update.sqlpp
similarity index 61%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.2.update.sqlpp
index a158d7f..b5ab61a 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.2.update.sqlpp
@@ -17,8 +17,14 @@
* under the License.
*/
-{
- 'result1':regexp_replace('abracadabra','a',''),
- 'result2':regexp_replace('abracadabra','a(.)','a$1$1'),
- 'result3':regexp_replace('darted','^(.*?)d(.*)$','$1c$2')
-};
+USE test;
+
+INSERT INTO ds [
+{"id": 1, "test_str": "hello_world", "pattern": "h\\w+", "flags": "i"},
+{"id": 2, "test_str": "hello_world", "pattern": "H\\w+", "flags": "i"},
+{"id": 3, "test_str": "hello_world", "pattern": "H\\w+", "flags": "i"},
+{"id": 4, "test_str": "hello_world", "pattern": "H\\w+", "flags": "s"},
+{"id": 5, "test_str": "hello_world", "pattern": "H\\w+", "flags": "s"},
+{"id": 6, "test_str": "\n", "pattern": ".", "flags": "s"},
+{"id": 7, "test_str": "\n", "pattern": ".", "flags": ""}
+];
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.1.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.1.query.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.4.query.sqlpp
similarity index 81%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.4.query.sqlpp
index a158d7f..48c7aac 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.4.query.sqlpp
@@ -17,8 +17,6 @@
* under the License.
*/
-{
- 'result1':regexp_replace('abracadabra','a',''),
- 'result2':regexp_replace('abracadabra','a(.)','a$1$1'),
- 'result3':regexp_replace('darted','^(.*?)d(.*)$','$1c$2')
-};
+USE test;
+
+FROM ds SELECT VALUE regexp_position(test_str, pattern, flags) ORDER BY id;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flags.5.ddl.sqlpp
similarity index 81%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flags.5.ddl.sqlpp
index a158d7f..36b2bab 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flags.5.ddl.sqlpp
@@ -17,8 +17,4 @@
* under the License.
*/
-{
- 'result1':regexp_replace('abracadabra','a',''),
- 'result2':regexp_replace('abracadabra','a(.)','a$1$1'),
- 'result3':regexp_replace('darted','^(.*?)d(.*)$','$1c$2')
-};
+DROP DATAVERSE test IF EXISTS;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.1.ddl.sqlpp
similarity index 82%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.1.ddl.sqlpp
index a158d7f..7c48143 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.1.ddl.sqlpp
@@ -17,8 +17,9 @@
* under the License.
*/
-{
- 'result1':regexp_replace('abracadabra','a',''),
- 'result2':regexp_replace('abracadabra','a(.)','a$1$1'),
- 'result3':regexp_replace('darted','^(.*?)d(.*)$','$1c$2')
-};
+DROP DATAVERSE test IF EXISTS;
+CREATE DATAVERSE test;
+USE test;
+
+CREATE TYPE t AS {id: int};
+CREATE DATASET ds(t) PRIMARY KEY id;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.1.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.1.query.sqlpp
deleted file mode 100644
index fbdf750..0000000
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.1.query.sqlpp
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-{
- 'result1':REGEXP_REPLACE('abracadabra','',null,null),
- 'result2':REGEXP_REPLACE('abracadabra','bra','XXX',''),
- 'result3':REGEXP_REPLACE(null,'hello world','XxXx','x'),
- 'result4':REGEXP_REPLACE('abracadabra','bra','XXX',null),
- 'result5':REGEXP_REPLACE('abracadabra',null,'XXX',null),
- 'result6':REGEXP_REPLACE('abracadabra','Bra',null,'i'),
- 'result7':REGEXP_REPLACE('abracadabra','Bra','','i'),
- 'result8':REGEXP_REPLACE('abracadabra','','XXX','')
-};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.update.sqlpp
similarity index 77%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.update.sqlpp
index a158d7f..300a5f2 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.update.sqlpp
@@ -17,8 +17,11 @@
* under the License.
*/
-{
- 'result1':regexp_replace('abracadabra','a',''),
- 'result2':regexp_replace('abracadabra','a(.)','a$1$1'),
- 'result3':regexp_replace('darted','^(.*?)d(.*)$','$1c$2')
-};
+USE test;
+
+INSERT INTO ds [
+{"id": 1, "test_str": "hello_world", "pattern": "\\w+"},
+{"id": 2, "test_str": "\n", "pattern": "\\w+"},
+{"id": 3, "test_str": "hello_world", "pattern": "\\d+"},
+{"id": 4, "test_str": "\n", "pattern": "\\w+"}
+];
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.3.query.sqlpp
index 910e476..efd0084 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.3.query.sqlpp
@@ -17,6 +17,11 @@
* under the License.
*/
-{
- 'result1':regexp_replace('abracadabra','bra','*')
-};
+select element a
+from [
+ regexp_replace('abracadabra','a',''),
+ regexp_replace('abracadabra','a(.)','a$1$1'),
+ regexp_replace('darted','^(.*?)d(.*)$','$1c$2'),
+ regexp_replace('abracadabra','bra','*'),
+ regexp_replace('abracadabra','a.*a','*')
+] as a;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.4.query.sqlpp
index b43481f..cbb55de 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.4.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.4.query.sqlpp
@@ -17,6 +17,6 @@
* under the License.
*/
-{
- 'result1':regexp_replace('abracadabra','a.*a','*')
-};
+USE test;
+
+FROM ds SELECT VALUE regexp_replace(test_str, pattern, "REPLACED") ORDER BY id;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.5.ddl.sqlpp
similarity index 82%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.5.ddl.sqlpp
index a158d7f..36b2bab 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.5.ddl.sqlpp
@@ -17,8 +17,4 @@
* under the License.
*/
-{
- 'result1':regexp_replace('abracadabra','a',''),
- 'result2':regexp_replace('abracadabra','a(.)','a$1$1'),
- 'result3':regexp_replace('darted','^(.*?)d(.*)$','$1c$2')
-};
+DROP DATAVERSE test IF EXISTS;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.5.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.5.query.sqlpp
deleted file mode 100644
index 600abe0..0000000
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.5.query.sqlpp
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-{
- 'result1':regexp_replace('abracadabra','Bra','kkk',''),
- 'result2':regexp_replace('abracadabra','Bra','kkk','i'),
- 'result3':regexp_replace('helloworld','hello world','kkk','x')
-};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.6.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.6.query.sqlpp
deleted file mode 100644
index 94deadc..0000000
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.6.query.sqlpp
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-{
- 'result1':regexp_replace('abracadabra','bra','kkk',-1),
- 'result2':regexp_replace('abracadabra','bra','kkk',0),
- 'result3':regexp_replace('abracadabra','bra','kkk',1),
- 'result4':regexp_replace('abracadabra_abracadabra','bra','kkk',2),
- 'result5':regexp_replace('abracadabra_abracadabra','bra','kkk',5)
-};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag.1.ddl.sqlpp
similarity index 81%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag.1.ddl.sqlpp
index a158d7f..7c48143 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag.1.ddl.sqlpp
@@ -17,8 +17,9 @@
* under the License.
*/
-{
- 'result1':regexp_replace('abracadabra','a',''),
- 'result2':regexp_replace('abracadabra','a(.)','a$1$1'),
- 'result3':regexp_replace('darted','^(.*?)d(.*)$','$1c$2')
-};
+DROP DATAVERSE test IF EXISTS;
+CREATE DATAVERSE test;
+USE test;
+
+CREATE TYPE t AS {id: int};
+CREATE DATASET ds(t) PRIMARY KEY id;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag.2.update.sqlpp
similarity index 61%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag.2.update.sqlpp
index a158d7f..b5ab61a 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag.2.update.sqlpp
@@ -17,8 +17,14 @@
* under the License.
*/
-{
- 'result1':regexp_replace('abracadabra','a',''),
- 'result2':regexp_replace('abracadabra','a(.)','a$1$1'),
- 'result3':regexp_replace('darted','^(.*?)d(.*)$','$1c$2')
-};
+USE test;
+
+INSERT INTO ds [
+{"id": 1, "test_str": "hello_world", "pattern": "h\\w+", "flags": "i"},
+{"id": 2, "test_str": "hello_world", "pattern": "H\\w+", "flags": "i"},
+{"id": 3, "test_str": "hello_world", "pattern": "H\\w+", "flags": "i"},
+{"id": 4, "test_str": "hello_world", "pattern": "H\\w+", "flags": "s"},
+{"id": 5, "test_str": "hello_world", "pattern": "H\\w+", "flags": "s"},
+{"id": 6, "test_str": "\n", "pattern": ".", "flags": "s"},
+{"id": 7, "test_str": "\n", "pattern": ".", "flags": ""}
+];
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag.3.query.sqlpp
new file mode 100644
index 0000000..90504e5
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag.3.query.sqlpp
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+select element a
+from [
+ regexp_replace('abracadabra','',null,null),
+ regexp_replace('abracadabra','bra','XXX',''),
+ regexp_replace(null,'hello world','XxXx','x'),
+ regexp_replace('abracadabra','bra','XXX',null),
+ regexp_replace('abracadabra',null,'XXX',null),
+ regexp_replace('abracadabra','Bra',null,'i'),
+ regexp_replace('abracadabra','Bra','','i'),
+ regexp_replace('abracadabra','','XXX',''),
+ regexp_replace('abracadabra','Bra','kkk',''),
+ regexp_replace('abracadabra','Bra','kkk','i'),
+ regexp_replace('helloworld','hello world','kkk','x'),
+ regexp_replace('abracadabra','bra','kkk',-1),
+ regexp_replace('abracadabra','bra','kkk',0),
+ regexp_replace('abracadabra','bra','kkk',1),
+ regexp_replace('abracadabra_abracadabra','bra','kkk',2),
+ regexp_replace('abracadabra_abracadabra','bra','kkk',5)
+] as a;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag.4.query.sqlpp
similarity index 81%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag.4.query.sqlpp
index a158d7f..42eaae7 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag.4.query.sqlpp
@@ -17,8 +17,6 @@
* under the License.
*/
-{
- 'result1':regexp_replace('abracadabra','a',''),
- 'result2':regexp_replace('abracadabra','a(.)','a$1$1'),
- 'result3':regexp_replace('darted','^(.*?)d(.*)$','$1c$2')
-};
+USE test;
+
+FROM ds SELECT VALUE regexp_replace(test_str, pattern, "REPLACED", flags) ORDER BY id;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag.5.ddl.sqlpp
similarity index 81%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag.5.ddl.sqlpp
index a158d7f..36b2bab 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag.5.ddl.sqlpp
@@ -17,8 +17,4 @@
* under the License.
*/
-{
- 'result1':regexp_replace('abracadabra','a',''),
- 'result2':regexp_replace('abracadabra','a(.)','a$1$1'),
- 'result3':regexp_replace('darted','^(.*?)d(.*)$','$1c$2')
-};
+DROP DATAVERSE test IF EXISTS;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/tpch-sql-sugar/q12_shipping_broadcast/q12_shipping_broadcast.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/tpch-sql-sugar/q12_shipping_broadcast/q12_shipping_broadcast.3.query.sqlpp
index 28c9a9b..c61357c 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/tpch-sql-sugar/q12_shipping_broadcast/q12_shipping_broadcast.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/tpch-sql-sugar/q12_shipping_broadcast/q12_shipping_broadcast.3.query.sqlpp
@@ -25,7 +25,7 @@
sum(CASE o.o_orderpriority = '1-URGENT' or o.o_orderpriority = '2-HIGH' WHEN true THEN 0 ELSE 1 END) low_line_count
FROM LineItem l,
Orders o
-WHERE l.l_orderkey /*+ bcast */ = o.o_orderkey AND l.l_commitdate < l.l_receiptdate AND
+WHERE l.l_orderkey /*+ hash-bcast */ = o.o_orderkey AND l.l_commitdate < l.l_receiptdate AND
l.l_shipdate < l.l_commitdate AND l.l_receiptdate >= '1994-01-01' AND
l.l_receiptdate < '1995-01-01' AND (l.l_shipmode = 'MAIL' OR l.l_shipmode = 'SHIP')
GROUP BY l.l_shipmode
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/like_02/like_02.3.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/like_02/like_02.3.adm
new file mode 100644
index 0000000..f64c9ef
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/like_02/like_02.3.adm
@@ -0,0 +1,11 @@
+true
+false
+true
+true
+false
+false
+true
+false
+true
+true
+true
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/like_02/like_02.4.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/like_02/like_02.4.adm
new file mode 100644
index 0000000..82cd87f
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/like_02/like_02.4.adm
@@ -0,0 +1,3 @@
+true
+true
+true
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains/regexp_contains.3.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains/regexp_contains.3.adm
new file mode 100644
index 0000000..3215658
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains/regexp_contains.3.adm
@@ -0,0 +1,15 @@
+true
+false
+true
+true
+true
+false
+true
+false
+false
+true
+true
+true
+true
+false
+true
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains/regexp_contains.4.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains/regexp_contains.4.adm
new file mode 100644
index 0000000..3180800
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains/regexp_contains.4.adm
@@ -0,0 +1,4 @@
+true
+false
+false
+false
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains_with_flag/regexp_contains_with_flag.3.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains_with_flag/regexp_contains_with_flag.3.adm
new file mode 100644
index 0000000..93dc2ea
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains_with_flag/regexp_contains_with_flag.3.adm
@@ -0,0 +1 @@
+{ "result1": true }
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains_with_flag/regexp_contains_with_flag.4.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains_with_flag/regexp_contains_with_flag.4.adm
new file mode 100644
index 0000000..08ed4c1
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains_with_flag/regexp_contains_with_flag.4.adm
@@ -0,0 +1,7 @@
+true
+true
+true
+false
+false
+true
+false
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_like/regexp_like.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_like/regexp_like.3.adm
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_like/regexp_like.1.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_like/regexp_like.3.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_like/regexp_like.4.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_like/regexp_like.4.adm
new file mode 100644
index 0000000..3180800
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_like/regexp_like.4.adm
@@ -0,0 +1,4 @@
+true
+false
+false
+false
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_like_with_flag/regexp_like_with_flag.3.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_like_with_flag/regexp_like_with_flag.3.adm
new file mode 100644
index 0000000..93dc2ea
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_like_with_flag/regexp_like_with_flag.3.adm
@@ -0,0 +1 @@
+{ "result1": true }
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_like_with_flag/regexp_like_with_flag.4.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_like_with_flag/regexp_like_with_flag.4.adm
new file mode 100644
index 0000000..08ed4c1
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_like_with_flag/regexp_like_with_flag.4.adm
@@ -0,0 +1,7 @@
+true
+true
+true
+false
+false
+true
+false
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/regexp_position.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/regexp_position.3.adm
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/regexp_position.1.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/regexp_position.3.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/regexp_position.4.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/regexp_position.4.adm
new file mode 100644
index 0000000..e2b8d1b
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/regexp_position.4.adm
@@ -0,0 +1,4 @@
+0
+-1
+-1
+-1
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/regexp_position_with_flag.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/regexp_position_with_flag.3.adm
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/regexp_position_with_flag.1.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/regexp_position_with_flag.3.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/regexp_position_with_flag.4.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/regexp_position_with_flag.4.adm
new file mode 100644
index 0000000..4a565d9
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/regexp_position_with_flag.4.adm
@@ -0,0 +1,7 @@
+0
+0
+0
+-1
+-1
+0
+-1
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace/regexp_replace.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace/regexp_replace.1.adm
deleted file mode 100644
index c50c7c5..0000000
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace/regexp_replace.1.adm
+++ /dev/null
@@ -1 +0,0 @@
-{ "result1": null, "result2": "aXXXcadaXXX", "result3": null, "result4": null, "result5": null, "result6": null, "result7": "acada", "result8": "XXXaXXXbXXXrXXXaXXXcXXXaXXXdXXXaXXXbXXXrXXXaXXX" }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace/regexp_replace.2.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace/regexp_replace.2.adm
deleted file mode 100644
index 5f992ce..0000000
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace/regexp_replace.2.adm
+++ /dev/null
@@ -1 +0,0 @@
-{ "result1": "brcdbr", "result2": "abbraccaddabbra", "result3": "carted" }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace/regexp_replace.3.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace/regexp_replace.3.adm
index fa45140..bd9e14b 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace/regexp_replace.3.adm
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace/regexp_replace.3.adm
@@ -1 +1,5 @@
-{ "result1": "a*cada*" }
+"brcdbr"
+"abbraccaddabbra"
+"carted"
+"a*cada*"
+"*"
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace/regexp_replace.4.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace/regexp_replace.4.adm
index 3882682..61d2a9c 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace/regexp_replace.4.adm
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace/regexp_replace.4.adm
@@ -1 +1,4 @@
-{ "result1": "*" }
+"REPLACED"
+"\n"
+"hello_world"
+"\n"
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace/regexp_replace.5.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace/regexp_replace.5.adm
deleted file mode 100644
index 9fd2e6a..0000000
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace/regexp_replace.5.adm
+++ /dev/null
@@ -1 +0,0 @@
-{ "result1": "abracadabra", "result2": "akkkcadakkk", "result3": "kkk" }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace/regexp_replace.6.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace/regexp_replace.6.adm
deleted file mode 100644
index 1005ff0..0000000
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace/regexp_replace.6.adm
+++ /dev/null
@@ -1 +0,0 @@
-{ "result1": "akkkcadakkk", "result2": "abracadabra", "result3": "akkkcadabra", "result4": "akkkcadakkk_abracadabra", "result5": "akkkcadakkk_akkkcadakkk" }
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace_with_flag/regexp_replace_with_flag.3.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace_with_flag/regexp_replace_with_flag.3.adm
new file mode 100644
index 0000000..33a5a9a
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace_with_flag/regexp_replace_with_flag.3.adm
@@ -0,0 +1,16 @@
+null
+"aXXXcadaXXX"
+null
+null
+null
+null
+"acada"
+"XXXaXXXbXXXrXXXaXXXcXXXaXXXdXXXaXXXbXXXrXXXaXXX"
+"abracadabra"
+"akkkcadakkk"
+"kkk"
+"akkkcadakkk"
+"abracadabra"
+"akkkcadabra"
+"akkkcadakkk_abracadabra"
+"akkkcadakkk_akkkcadakkk"
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace_with_flag/regexp_replace_with_flag.4.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace_with_flag/regexp_replace_with_flag.4.adm
new file mode 100644
index 0000000..a4c6204
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace_with_flag/regexp_replace_with_flag.4.adm
@@ -0,0 +1,7 @@
+"REPLACED"
+"REPLACED"
+"REPLACED"
+"hello_world"
+"hello_world"
+"REPLACED"
+"\n"
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
index abbb411..0f82c9e 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
@@ -8602,6 +8602,18 @@
</compilation-unit>
</test-case>
<test-case FilePath="string">
+ <compilation-unit name="like_02">
+ <output-dir compare="Text">like_02</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="like_03_negative">
+ <output-dir compare="Text">like_03_negative</output-dir>
+ <expected-error>Invalid pattern "__\c" for LIKE (in line 21, at column 11)</expected-error>
+ <expected-error>Invalid pattern "%\" for LIKE (in line 21, at column 18)</expected-error>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
<compilation-unit name="like_null">
<output-dir compare="Text">like_null</output-dir>
</compilation-unit>
@@ -8688,12 +8700,12 @@
</test-case>
<test-case FilePath="string">
<compilation-unit name="regexp_contains">
- <output-dir compare="Text">matches06</output-dir>
+ <output-dir compare="Text">regexp_contains</output-dir>
</compilation-unit>
</test-case>
<test-case FilePath="string">
<compilation-unit name="regexp_contains_with_flag">
- <output-dir compare="Text">matches23</output-dir>
+ <output-dir compare="Text">regexp_contains_with_flag</output-dir>
</compilation-unit>
</test-case>
<test-case FilePath="string">
@@ -8703,7 +8715,7 @@
</test-case>
<test-case FilePath="string">
<compilation-unit name="regexp_like_with_flag">
- <output-dir compare="Text">matches23</output-dir>
+ <output-dir compare="Text">regexp_like_with_flag</output-dir>
</compilation-unit>
</test-case>
<test-case FilePath="string">
@@ -8737,6 +8749,11 @@
</compilation-unit>
</test-case>
<test-case FilePath="string">
+ <compilation-unit name="regexp_replace_with_flag">
+ <output-dir compare="Text">regexp_replace_with_flag</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
<compilation-unit name="reverse">
<output-dir compare="Text">reverse</output-dir>
</compilation-unit>
@@ -12472,7 +12489,7 @@
<output-dir compare="Text">inapplicable-hint-warning</output-dir>
<expected-warn>HYR10006: Could not apply Group By hint: hash</expected-warn>
<expected-warn>ASX1107: Unexpected hint: indexnl. "hash" expected at this location</expected-warn>
- <expected-warn>ASX1107: Unexpected hint: hash. "indexnl", "skip-index", "bcast" expected at this location</expected-warn>
+ <expected-warn>ASX1107: Unexpected hint: hash. "indexnl", "skip-index", "hash-bcast" expected at this location</expected-warn>
<expected-warn>ASX1107: Unexpected hint: auto. "indexnl", "skip-index" expected at this location</expected-warn>
<expected-warn>ASX1107: Unexpected hint: hash. "indexnl", "skip-index" expected at this location</expected-warn>
<expected-warn>ASX1107: Unexpected hint: hash. None expected at this location</expected-warn>
@@ -12495,7 +12512,7 @@
<compilation-unit name="unknown-hint-warning">
<output-dir compare="Text">unknown-hint-warning</output-dir>
<expected-warn>ASX1107: Unexpected hint: unknown_hint_groupby. "hash" expected at this location</expected-warn>
- <expected-warn>ASX1107: Unexpected hint: unknown_hint_relexpr. "indexnl", "skip-index", "bcast" expected at this location</expected-warn>
+ <expected-warn>ASX1107: Unexpected hint: unknown_hint_relexpr. "indexnl", "skip-index", "hash-bcast" expected at this location</expected-warn>
<expected-warn>ASX1107: Unexpected hint: unknown_hint_between. "indexnl", "skip-index" expected at this location</expected-warn>
<expected-warn>ASX1107: Unexpected hint: unknown_hint_funcall. "indexnl", "skip-index" expected at this location</expected-warn>
<expected-warn>ASX1107: Unexpected hint: unknown_hint_elsewhere. None expected at this location</expected-warn>
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/StorageProperties.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/StorageProperties.java
index a0d5ceb..58bc828 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/StorageProperties.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/StorageProperties.java
@@ -50,7 +50,7 @@
STORAGE_METADATA_MEMORYCOMPONENT_NUMPAGES(POSITIVE_INTEGER, 8),
STORAGE_LSM_BLOOMFILTER_FALSEPOSITIVERATE(DOUBLE, 0.01d),
STORAGE_MAX_ACTIVE_WRITABLE_DATASETS(UNSIGNED_INTEGER, 8),
- STORAGE_COMPRESSION_BLOCK(STRING, "none"),
+ STORAGE_COMPRESSION_BLOCK(STRING, "snappy"),
STORAGE_DISK_FORCE_BYTES(LONG_BYTE_UNIT, StorageUtil.getLongSizeInBytes(16, MEGABYTE)),
STORAGE_IO_SCHEDULER(STRING, "greedy");
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/ErrorCode.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/ErrorCode.java
index 609e3a6..e718ca5 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/ErrorCode.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/ErrorCode.java
@@ -78,6 +78,7 @@
public static final int VALUE_OUT_OF_RANGE = 43;
public static final int PROHIBITED_STATEMENT_CATEGORY = 44;
public static final int INTEGER_VALUE_EXPECTED_FUNCTION = 45;
+ public static final int INVALID_LIKE_PATTERN = 46;
public static final int UNSUPPORTED_JRE = 100;
diff --git a/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties b/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties
index 661a220..f8d7a89 100644
--- a/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties
+++ b/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties
@@ -80,6 +80,7 @@
43 = Value out of range, function %1$s expects its %2$s input parameter value to be between %3$s and %4$s, received %5$s
44 = %1$s statement is prohibited by this request
45 = Invalid value: function %1$s expects its %2$s input parameter to be an integer value, got %3$s
+46 = Invalid pattern \"%1$s\" for LIKE
100 = Unsupported JRE: %1$s
diff --git a/asterixdb/asterix-doc/src/main/markdown/builtins/14_window.md b/asterixdb/asterix-doc/src/main/markdown/builtins/14_window.md
index adc5daa..d88d5e8 100644
--- a/asterixdb/asterix-doc/src/main/markdown/builtins/14_window.md
+++ b/asterixdb/asterix-doc/src/main/markdown/builtins/14_window.md
@@ -39,13 +39,17 @@
* Syntax:
- CUME_DIST() OVER ([window-partition-clause] window-order-clause)
+ CUME_DIST() OVER ([window-partition-clause] [window-order-clause])
* Returns the percentile rank of the current tuple as part of the cumulative
distribution – that is, the number of tuples ranked lower than or equal to
the current tuple, including the current tuple, divided by the total number
of tuples in the window partition.
+ The window order clause determines the sort order of the tuples.
+ If the window order clause is omitted, the function returns the same
+ result (1.0) for each tuple.
+
* Arguments:
* None.
@@ -54,7 +58,7 @@
* (Optional) [Window Partition Clause](manual.html#Window_partition_clause).
- * (Required) [Window Order Clause](manual.html#Window_order_clause).
+ * (Optional) [Window Order Clause](manual.html#Window_order_clause).
* Return Value:
@@ -116,7 +120,7 @@
* Syntax:
- DENSE_RANK() OVER ([window-partition-clause] window-order-clause)
+ DENSE_RANK() OVER ([window-partition-clause] [window-order-clause])
* Returns the dense rank of the current tuple – that is, the number of
distinct tuples preceding this tuple in the current window partition, plus
@@ -124,6 +128,8 @@
The tuples are ordered by the window order clause.
If any tuples are tied, they will have the same rank.
+ If the window order clause is omitted, the function returns the same
+ result (1) for each tuple.
For this function, when any tuples have the same rank, the rank of the next
tuple will be consecutive, so there will not be a gap in the sequence of
@@ -138,7 +144,7 @@
* (Optional) [Window Partition Clause](manual.html#Window_partition_clause).
- * (Required) [Window Order Clause](manual.html#Window_order_clause).
+ * (Optional) [Window Order Clause](manual.html#Window_order_clause).
* Return Value:
@@ -219,7 +225,7 @@
* Modifiers:
* [Nulls Treatment](manual.html#Nulls_treatment): (Optional) Determines how
- NULL or MISSING values are treated when finding the first tuple in the
+ NULL or MISSING values are treated when finding the first value in the
window frame.
- `IGNORE NULLS`: If the values for any tuples evaluate to NULL or
@@ -245,7 +251,8 @@
* The specified value from the first tuple.
The order of the tuples is determined by the window order clause.
- * If all values are NULL or MISSING it returns NULL.
+ * NULL, if the frame was empty or if all values were NULL or MISSING and
+ the `IGNORE NULLS` modifier was specified.
* In the following cases, this function may return unpredictable results.
@@ -326,36 +333,38 @@
* Syntax:
- LAG(expr[, offset[, default]]) [nulls-treatment] OVER ([window-partition-clause] window-order-clause)
+ LAG(expr[, offset[, default]]) [nulls-treatment] OVER ([window-partition-clause] [window-order-clause])
-* Returns the value of a tuple at a given offset prior to the current tuple
+* Returns the value from a tuple at a given offset prior to the current tuple
position.
+ The window order clause determines the sort order of the tuples.
+ If the window order clause is omitted, the return values may be
+ unpredictable.
+
* Arguments:
* `expr`: The value that you want to return from the offset
tuple. <sup>\[[1](#fn_1)\]</sup>
- * `offset`: (Optional) A positive integer greater than 0.
+ * `offset`: (Optional) A positive integer.
If omitted, the default is 1.
* `default`: (Optional) The value to return when the offset goes out of
- window scope.
+ partition scope.
If omitted, the default is NULL.
* Modifiers:
* [Nulls Treatment](manual.html#Nulls_treatment): (Optional) Determines how
- NULL or MISSING values are treated when finding the first tuple in the
- window frame.
+ NULL or MISSING values are treated when finding the offset tuple in the
+ window partition.
- `IGNORE NULLS`: If the values for any tuples evaluate to NULL or
- MISSING, those tuples are ignored when finding the first tuple.
- In this case, the function returns the first non-NULL, non-MISSING
- value.
+ MISSING, those tuples are ignored when finding the offset tuple.
- `RESPECT NULLS`: If the values for any tuples evaluate to NULL or
- MISSING, those tuples are included when finding the first tuple.
+ MISSING, those tuples are included when finding the offset tuple.
If this modifier is omitted, the default is `RESPECT NULLS`.
@@ -363,13 +372,13 @@
* (Optional) [Window Partition Clause](manual.html#Window_partition_clause).
- * (Required) [Window Order Clause](manual.html#Window_order_clause).
+ * (Optional) [Window Order Clause](manual.html#Window_order_clause).
* Return Value:
* The specified value from the offset tuple.
- * If the offset tuple is out of scope, it returns the default value,
+ * If the offset tuple is out of partition scope, it returns the default value,
or NULL if no default is specified.
* Example:
@@ -449,16 +458,16 @@
* Modifiers:
* [Nulls Treatment](manual.html#Nulls_treatment): (Optional) Determines how
- NULL or MISSING values are treated when finding the first tuple in the
+ NULL or MISSING values are treated when finding the last tuple in the
window frame.
- `IGNORE NULLS`: If the values for any tuples evaluate to NULL or
- MISSING, those tuples are ignored when finding the first tuple.
- In this case, the function returns the first non-NULL, non-MISSING
+ MISSING, those tuples are ignored when finding the last tuple.
+ In this case, the function returns the last non-NULL, non-MISSING
value.
- `RESPECT NULLS`: If the values for any tuples evaluate to NULL or
- MISSING, those tuples are included when finding the first tuple.
+ MISSING, those tuples are included when finding the last tuple.
If this modifier is omitted, the default is `RESPECT NULLS`.
@@ -475,7 +484,8 @@
* The specified value from the last tuple.
The order of the tuples is determined by the window order clause.
- * If all values are NULL or MISSING it returns NULL.
+ * NULL, if the frame was empty or if all values were NULL or MISSING and
+ the `IGNORE NULLS` modifier was specified.
* In the following cases, this function may return unpredictable results.
@@ -566,36 +576,38 @@
* Syntax:
- LEAD(expr[, offset[, default]]) [nulls-treatment] OVER ([window-partition-clause] window-order-clause)
+ LEAD(expr[, offset[, default]]) [nulls-treatment] OVER ([window-partition-clause] [window-order-clause])
-* Returns the value of a tuple at a given offset ahead of the current tuple
+* Returns the value from a tuple at a given offset ahead of the current tuple
position.
+ The window order clause determines the sort order of the tuples.
+ If the window order clause is omitted, the return values may be
+ unpredictable.
+
* Arguments:
* `expr`: The value that you want to return from the offset
tuple. <sup>\[[1](#fn_1)\]</sup>
- * `offset`: (Optional) A positive integer greater than 0. If omitted, the
+ * `offset`: (Optional) A positive integer. If omitted, the
default is 1.
* `default`: (Optional) The value to return when the offset goes out of
- window scope.
+ window partition scope.
If omitted, the default is NULL.
* Modifiers:
* [Nulls Treatment](manual.html#Nulls_treatment): (Optional) Determines how
- NULL or MISSING values are treated when finding the first tuple in the
- window frame.
+ NULL or MISSING values are treated when finding the offset tuple in the
+ window partition.
- `IGNORE NULLS`: If the values for any tuples evaluate to NULL or
- MISSING, those tuples are ignored when finding the first tuple.
- In this case, the function returns the first non-NULL, non-MISSING
- value.
+ MISSING, those tuples are ignored when finding the offset tuple.
- `RESPECT NULLS`: If the values for any tuples evaluate to NULL or
- MISSING, those tuples are included when finding the first tuple.
+ MISSING, those tuples are included when finding the offset tuple.
If this modifier is omitted, the default is `RESPECT NULLS`.
@@ -603,13 +615,13 @@
* (Optional) [Window Partition Clause](manual.html#Window_partition_clause).
- * (Required) [Window Order Clause](manual.html#Window_order_clause).
+ * (Optional) [Window Order Clause](manual.html#Window_order_clause).
* Return Value:
* The specified value from the offset tuple.
- * If the offset tuple is out of scope, it returns the default value, or
+ * If the offset tuple is out of partition scope, it returns the default value, or
NULL if no default is specified.
* Example:
@@ -706,16 +718,14 @@
If this modifier is omitted, the default is `FROM FIRST`.
* [Nulls Treatment](manual.html#Nulls_treatment): (Optional) Determines how
- NULL or MISSING values are treated when finding the first tuple in the
+ NULL or MISSING values are treated when finding the offset tuple in the
window frame.
- `IGNORE NULLS`: If the values for any tuples evaluate to NULL or
- MISSING, those tuples are ignored when finding the first tuple.
- In this case, the function returns the first non-NULL, non-MISSING
- value.
+ MISSING, those tuples are ignored when finding the offset tuple.
- `RESPECT NULLS`: If the values for any tuples evaluate to NULL or
- MISSING, those tuples are included when finding the first tuple.
+ MISSING, those tuples are included when finding the offset tuple.
If this modifier is omitted, the default is `RESPECT NULLS`.
@@ -735,8 +745,6 @@
- If the window order clause is omitted.
- - If the window frame clause is omitted.
-
- If the window frame is defined by `ROWS`, and there are tied tuples
in the window frame.
@@ -893,7 +901,7 @@
* Syntax:
- NTILE(num_tiles) OVER ([window-partition-clause] window-order-clause)
+ NTILE(num_tiles) OVER ([window-partition-clause] [window-order-clause])
* Divides the window partition into the specified number of tiles, and
allocates each tuple in the window partition to a tile, so that as far as
@@ -903,20 +911,22 @@
For each tuple, the function returns the number of the tile into which that
tuple was placed.
+ The window order clause determines the sort order of the tuples.
+ If the window order clause is omitted then the tuples are processed in
+ an undefined order.
+
* Arguments:
* `num_tiles`: The number of tiles into which you want to divide
the window partition.
This argument can be an expression and must evaluate to a number.
If the number is not an integer, it will be truncated.
- If the expression depends on a tuple, it evaluates from the first
- tuple in the window partition.
* Clauses:
* (Optional) [Window Partition Clause](manual.html#Window_partition_clause).
- * (Required) [Window Order Clause](manual.html#Window_order_clause).
+ * (Optional) [Window Order Clause](manual.html#Window_order_clause).
* Return Value:
@@ -977,12 +987,16 @@
* Syntax:
- PERCENT_RANK() OVER ([window-partition-clause] window-order-clause)
+ PERCENT_RANK() OVER ([window-partition-clause] [window-order-clause])
* Returns the percentile rank of the current tuple – that is, the rank of the
tuples minus one, divided by the total number of tuples in the window
partition minus one.
+ The window order clause determines the sort order of the tuples.
+ If the window order clause is omitted, the function returns the same
+ result (0) for each tuple.
+
* Arguments:
* None.
@@ -991,7 +1005,7 @@
* (Optional) [Window Partition Clause](manual.html#Window_partition_clause).
- * (Required) [Window Order Clause](manual.html#Window_order_clause).
+ * (Optional) [Window Order Clause](manual.html#Window_order_clause).
* Return Value:
@@ -1053,19 +1067,23 @@
* Syntax:
- RANK() OVER ([window-partition-clause] window-order-clause)
+ RANK() OVER ([window-partition-clause] [window-order-clause])
* Returns the rank of the current tuple – that is, the number of distinct
tuples preceding this tuple in the current window partition, plus one.
The tuples are ordered by the window order clause.
If any tuples are tied, they will have the same rank.
+ If the window order clause is omitted, the function returns the same
+ result (1) for each tuple.
When any tuples have the same rank, the rank of the next tuple will include
all preceding tuples, so there may be a gap in the sequence of returned
values.
For example, if there are three tuples ranked 2, the next rank is 5.
+ To avoid gaps in the returned values, use the DENSE_RANK() function instead.
+
* Arguments:
* None.
@@ -1074,7 +1092,7 @@
* (Optional) [Window Partition Clause](manual.html#Window_partition_clause).
- * (Required) [Window Order Clause](manual.html#Window_order_clause).
+ * (Optional) [Window Order Clause](manual.html#Window_order_clause).
* Return Value:
@@ -1145,7 +1163,7 @@
RATIO_TO_REPORT(expr) OVER (window-definition)
* Returns the fractional ratio of the specified value for each tuple to the
- sum of values for all tuples in the window partition.
+ sum of values for all tuples in the window frame.
* Arguments:
@@ -1165,7 +1183,7 @@
* A number between 0 and 1, representing the fractional ratio of the value
for the current tuple to the sum of values for all tuples in the
current window frame.
- The sum of values for all tuples in the current window frame is 1.
+ The sum of returned values for all tuples in the current window frame is 1.
* If the input expression does not evaluate to a number, or the sum of
values for all tuples is zero, it returns NULL.
diff --git a/asterixdb/asterix-doc/src/main/markdown/sqlpp/3_query.md b/asterixdb/asterix-doc/src/main/markdown/sqlpp/3_query.md
index f4b5f3d..e19e2ec 100644
--- a/asterixdb/asterix-doc/src/main/markdown/sqlpp/3_query.md
+++ b/asterixdb/asterix-doc/src/main/markdown/sqlpp/3_query.md
@@ -1698,11 +1698,11 @@
### <a id="Window_function_call">Window Function Call</a> ###
WindowFunctionCall ::= WindowFunctionType "(" WindowFunctionArguments ")"
- (WindowFunctionOptions)? <OVER> (Variable <AS>)? "(" WindowClause ")"
+ (WindowFunctionOptions)? <OVER> (Variable <AS>)? "(" WindowDefinition ")"
#### <a id="Window_function_type">Window Function Type</a> ####
- WindowFunctionType ::= AggregateFunctions | WindowFunctions
+ WindowFunctionType ::= AggregateFunction | WindowFunction
Refer to the [Aggregate Functions](builtins.html#AggregateFunctions) section
for a list of aggregate functions.
@@ -1763,9 +1763,9 @@
a window function, the function’s argument must be a subquery which refers to
this alias, for example:
- FROM source AS src
SELECT ARRAY_COUNT(DISTINCT (FROM alias SELECT VALUE alias.src.field))
OVER alias AS (PARTITION BY … ORDER BY …)
+ FROM source AS src
The alias is not necessary when using a [window function](builtins.html#WindowFunctions),
or when using a standard SQL aggregate function with the OVER clause.
@@ -1776,15 +1776,14 @@
query compiler using a built-in aggregate function over a frame variable.
For example, the following query with the `sum()` function:
+ SELECT SUM(field) OVER (PARTITION BY … ORDER BY …)
FROM source AS src
- SELECT SUM(field)
- OVER (PARTITION BY … ORDER BY …)
Is rewritten as the following query using the `array_sum()` function:
+ SELECT ARRAY_SUM( (SELECT VALUE alias.src.field FROM alias) )
+ OVER alias AS (PARTITION BY … ORDER BY …)
FROM source AS src
- SELECT ARRAY_SUM( (FROM alias SELECT VALUE alias.src.field) )
- OVER alias AS (PARTITION BY … ORDER BY …)
This is similar to the way that standard SQL aggregate functions are rewritten
as built-in aggregate functions in the presence of the GROUP BY clause.
@@ -1801,8 +1800,8 @@
WindowPartitionClause ::= <PARTITION> <BY> Expression ("," Expression)*
-The **window partition clause** divides the tuples into partitions using
-one or more expressions.
+The **window partition clause** divides the tuples into logical partitions
+using one or more expressions.
This clause may be used with any [window function](builtins.html#WindowFunctions),
or any [aggregate function](builtins.html#AggregateFunctions) used as a window
@@ -1823,13 +1822,8 @@
or any [aggregate function](builtins.html#AggregateFunctions) used as a window
function.
-This clause is optional for some functions, and required for others.
-Refer to the [Aggregate Functions](builtins.html#AggregateFunctions) section or
-the [Window Functions](builtins.html#WindowFunctions) section for details of
-the syntax of individual functions.
-
-If this clause is omitted, all tuples are considered peers, i.e. their order
-is tied.
+This clause is optional.
+If omitted, all tuples are considered peers, i.e. their order is tied.
When tuples in the window partition are tied, each window function behaves
differently.
@@ -1904,11 +1898,15 @@
If this clause uses `RANGE` with either `Expression PRECEDING` or
`Expression FOLLOWING`, the [window order clause](#Window_order_clause) must
have only a single ordering term.
+
+The ordering term expression must evaluate to a number.
+<!--
The ordering term expression must evaluate to a number, a date, a time, or a
datetime.
If the ordering term expression evaluates to a date, a time, or a datetime, the
expression in `Expression PRECEDING` or `Expression FOLLOWING` must evaluate to
a duration.
+-->
If these conditions are not met, the window frame will be empty,
which means the window function will return its default
@@ -1930,10 +1928,11 @@
#### <a id="Window_frame_extent">Window Frame Extent</a> ####
- WindowFrameExtent ::= ( <UNBOUNDED> <PRECEDING> | <CURRENT> <ROW> |
- Expression <FOLLOWING> ) | <BETWEEN> ( <UNBOUNDED> <PRECEDING> | <CURRENT>
- <ROW> | Expression ( <PRECEDING> | <FOLLOWING> ) ) <AND> ( <UNBOUNDED>
- <FOLLOWING> | <CURRENT> <ROW> | Expression ( <PRECEDING> | <FOLLOWING> ) )
+ WindowFrameExtent ::= ( ( <UNBOUNDED> | Expression ) <PRECEDING> | <CURRENT> <ROW> ) |
+ <BETWEEN>
+ ( <UNBOUNDED> <PRECEDING> | <CURRENT> <ROW> | Expression ( <PRECEDING> | <FOLLOWING> ) )
+ <AND>
+ ( <UNBOUNDED> <FOLLOWING> | <CURRENT> <ROW> | Expression ( <PRECEDING> | <FOLLOWING> ) )
The **window frame extent clause** specifies the start point and end point of
the window frame.
diff --git a/asterixdb/asterix-lang-aql/src/main/javacc/AQL.jj b/asterixdb/asterix-lang-aql/src/main/javacc/AQL.jj
index 810d8e9..f8aa57c 100644
--- a/asterixdb/asterix-lang-aql/src/main/javacc/AQL.jj
+++ b/asterixdb/asterix-lang-aql/src/main/javacc/AQL.jj
@@ -156,6 +156,7 @@
import org.apache.hyracks.algebricks.common.utils.Pair;
import org.apache.hyracks.algebricks.common.utils.Triple;
import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
+import org.apache.hyracks.algebricks.core.algebra.expressions.BroadcastExpressionAnnotation;
import org.apache.hyracks.algebricks.core.algebra.expressions.IExpressionAnnotation;
import org.apache.hyracks.algebricks.core.algebra.expressions.IndexedNLJoinExpressionAnnotation;
import org.apache.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
@@ -165,7 +166,7 @@
// optimizer hints
private static final String AUTO_HINT = "auto";
- private static final String BROADCAST_JOIN_HINT = "bcast";
+ private static final String HASH_BROADCAST_JOIN_HINT = "hash-bcast";
private static final String COMPOSE_VAL_FILES_HINT = "compose-val-files";
private static final String DATE_BETWEEN_YEARS_HINT = "date-between-years";
private static final String DATETIME_ADD_RAND_HOURS_HINT = "datetime-add-rand-hours";
@@ -1746,19 +1747,10 @@
{
OperatorExpr op = null;
Expression operand = null;
- boolean broadcast = false;
IExpressionAnnotation annotation = null;
}
{
operand = AddExpr()
- {
- if (operand instanceof VariableExpr) {
- String hint = getHint(token);
- if (hint != null && hint.equals(BROADCAST_JOIN_HINT)) {
- broadcast = true;
- }
- }
- }
(
LOOKAHEAD(2)( <LT> | <GT> | <LE> | <GE> | <EQ> | <NE> |<SIMILAR>)
@@ -1773,9 +1765,8 @@
}
if (op == null) {
op = new OperatorExpr();
- op.addOperand(operand, broadcast);
+ op.addOperand(operand);
op.setCurrentop(true);
- broadcast = false;
}
try{
op.addOperator(token.image);
@@ -1786,14 +1777,14 @@
operand = AddExpr()
{
- broadcast = false;
if (operand instanceof VariableExpr) {
String hint = getHint(token);
- if (hint != null && hint.equals(BROADCAST_JOIN_HINT)) {
- broadcast = true;
+ if (hint != null && hint.equals(HASH_BROADCAST_JOIN_HINT)) {
+ annotation = new BroadcastExpressionAnnotation();
+ annotation.setObject(BroadcastExpressionAnnotation.BroadcastSide.RIGHT);
}
}
- op.addOperand(operand, broadcast);
+ op.addOperand(operand);
}
)?
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/expression/OperatorExpr.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/expression/OperatorExpr.java
index 9521469..a37a366 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/expression/OperatorExpr.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/expression/OperatorExpr.java
@@ -31,20 +31,16 @@
public class OperatorExpr extends AbstractExpression {
private List<Expression> exprList;
private List<OperatorType> opList;
- private List<Integer> exprBroadcastIdx;
private boolean currentop;
public OperatorExpr() {
super();
exprList = new ArrayList<>();
- exprBroadcastIdx = new ArrayList<>();
opList = new ArrayList<>();
}
- public OperatorExpr(List<Expression> exprList, List<Integer> exprBroadcastIdx, List<OperatorType> opList,
- boolean currentop) {
+ public OperatorExpr(List<Expression> exprList, List<OperatorType> opList, boolean currentop) {
this.exprList = exprList;
- this.exprBroadcastIdx = exprBroadcastIdx;
this.opList = opList;
this.currentop = currentop;
}
@@ -61,10 +57,6 @@
return exprList;
}
- public List<Integer> getExprBroadcastIdx() {
- return exprBroadcastIdx;
- }
-
public List<OperatorType> getOpList() {
return opList;
}
@@ -74,13 +66,6 @@
}
public void addOperand(Expression operand) {
- addOperand(operand, false);
- }
-
- public void addOperand(Expression operand, boolean broadcast) {
- if (broadcast) {
- exprBroadcastIdx.add(exprList.size());
- }
exprList.add(operand);
}
@@ -123,18 +108,9 @@
return visitor.visit(this, arg);
}
- public boolean isBroadcastOperand(int idx) {
- for (Integer i : exprBroadcastIdx) {
- if (i == idx) {
- return true;
- }
- }
- return false;
- }
-
@Override
public int hashCode() {
- return Objects.hash(currentop, exprBroadcastIdx, exprList, opList);
+ return Objects.hash(currentop, exprList, opList);
}
@Override
@@ -146,7 +122,7 @@
return false;
}
OperatorExpr target = (OperatorExpr) object;
- return currentop == target.isCurrentop() && Objects.equals(exprBroadcastIdx, target.exprBroadcastIdx)
- && Objects.equals(exprList, target.exprList) && Objects.equals(opList, target.opList);
+ return currentop == target.isCurrentop() && Objects.equals(exprList, target.exprList)
+ && Objects.equals(opList, target.opList);
}
}
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/CloneAndSubstituteVariablesVisitor.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/CloneAndSubstituteVariablesVisitor.java
index 3a19254..6efb2ce 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/CloneAndSubstituteVariablesVisitor.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/CloneAndSubstituteVariablesVisitor.java
@@ -227,7 +227,7 @@
Pair<ILangExpression, VariableSubstitutionEnvironment> p1 = e.accept(this, env);
exprs.add((Expression) p1.first);
}
- OperatorExpr oe = new OperatorExpr(exprs, op.getExprBroadcastIdx(), op.getOpList(), op.isCurrentop());
+ OperatorExpr oe = new OperatorExpr(exprs, op.getOpList(), op.isCurrentop());
oe.setSourceLocation(op.getSourceLocation());
oe.addHints(op.getHints());
return new Pair<>(oe, env);
diff --git a/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/parser/SqlppHint.java b/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/parser/SqlppHint.java
index 4770581..27e2fa0 100644
--- a/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/parser/SqlppHint.java
+++ b/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/parser/SqlppHint.java
@@ -27,7 +27,7 @@
// optimizer hints
AUTO_HINT("auto"),
- BROADCAST_JOIN_HINT("bcast"),
+ HASH_BROADCAST_JOIN_HINT("hash-bcast"),
COMPOSE_VAL_FILES_HINT("compose-val-files"),
DATE_BETWEEN_YEARS_HINT("date-between-years"),
DATETIME_ADD_RAND_HOURS_HINT("datetime-add-rand-hours"),
diff --git a/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/DeepCopyVisitor.java b/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/DeepCopyVisitor.java
index b1b39e6..56f160b 100644
--- a/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/DeepCopyVisitor.java
+++ b/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/DeepCopyVisitor.java
@@ -396,8 +396,8 @@
@Override
public OperatorExpr visit(OperatorExpr operatorExpr, Void arg) throws CompilationException {
- OperatorExpr copy = new OperatorExpr(copyExprList(operatorExpr.getExprList(), arg),
- operatorExpr.getExprBroadcastIdx(), operatorExpr.getOpList(), operatorExpr.isCurrentop());
+ OperatorExpr copy = new OperatorExpr(copyExprList(operatorExpr.getExprList(), arg), operatorExpr.getOpList(),
+ operatorExpr.isCurrentop());
copy.setSourceLocation(operatorExpr.getSourceLocation());
copy.addHints(operatorExpr.getHints());
return copy;
diff --git a/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj b/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj
index e0ad033..38ace29 100644
--- a/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj
+++ b/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj
@@ -187,6 +187,7 @@
import org.apache.hyracks.algebricks.common.utils.Pair;
import org.apache.hyracks.algebricks.common.utils.Triple;
import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
+import org.apache.hyracks.algebricks.core.algebra.expressions.BroadcastExpressionAnnotation;
import org.apache.hyracks.algebricks.core.algebra.expressions.IExpressionAnnotation;
import org.apache.hyracks.algebricks.core.algebra.expressions.IndexedNLJoinExpressionAnnotation;
import org.apache.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
@@ -2057,7 +2058,6 @@
boolean not = false;
OperatorExpr op = null;
Expression operand = null;
- boolean broadcast = false;
IExpressionAnnotation annotation = null;
}
{
@@ -2067,7 +2067,7 @@
LOOKAHEAD(2)( <LT> | <GT> | <LE> | <GE> | <EQ> | <NE> | <LG> |<SIMILAR> | (<NOT> { not = true; })? <IN>)
{
Token hintToken = fetchHint(token, SqlppHint.INDEXED_NESTED_LOOP_JOIN_HINT,
- SqlppHint.SKIP_SECONDARY_INDEX_SEARCH_HINT, SqlppHint.BROADCAST_JOIN_HINT);
+ SqlppHint.SKIP_SECONDARY_INDEX_SEARCH_HINT, SqlppHint.HASH_BROADCAST_JOIN_HINT);
if (hintToken != null) {
switch (hintToken.hint) {
case INDEXED_NESTED_LOOP_JOIN_HINT:
@@ -2076,8 +2076,9 @@
case SKIP_SECONDARY_INDEX_SEARCH_HINT:
annotation = SkipSecondaryIndexSearchExpressionAnnotation.INSTANCE;
break;
- case BROADCAST_JOIN_HINT:
- broadcast = true;
+ case HASH_BROADCAST_JOIN_HINT:
+ annotation = new BroadcastExpressionAnnotation();
+ annotation.setObject(BroadcastExpressionAnnotation.BroadcastSide.RIGHT);
break;
}
}
@@ -2091,7 +2092,7 @@
}
if (op == null) {
op = new OperatorExpr();
- op.addOperand(operand, false); // broadcast is always for the right branch
+ op.addOperand(operand);
op.setCurrentop(true);
addSourceLocation(op, token);
}
@@ -2104,7 +2105,7 @@
operand = BetweenExpr()
{
- op.addOperand(operand, broadcast);
+ op.addOperand(operand);
}
)?
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractBinaryStringBoolEval.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractBinaryStringBoolEval.java
index b7a1c2f..62ba22d 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractBinaryStringBoolEval.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractBinaryStringBoolEval.java
@@ -61,8 +61,8 @@
* @param right
* , the second input argument.
* @return a boolean value.
- * @throws IOException
+ * @throws HyracksDataException
*/
- protected abstract boolean compute(UTF8StringPointable left, UTF8StringPointable right) throws IOException;
+ protected abstract boolean compute(UTF8StringPointable left, UTF8StringPointable right) throws HyracksDataException;
}
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractBinaryStringEval.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractBinaryStringEval.java
index 400126e..65fba47 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractBinaryStringEval.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractBinaryStringEval.java
@@ -55,7 +55,7 @@
// Function ID, for error reporting.
private final FunctionIdentifier funcID;
- private final SourceLocation sourceLoc;
+ protected final SourceLocation sourceLoc;
public AbstractBinaryStringEval(IEvaluatorContext context, IScalarEvaluatorFactory evalLeftFactory,
IScalarEvaluatorFactory evalRightFactory, FunctionIdentifier funcID, SourceLocation sourceLoc)
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringContainsDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringContainsDescriptor.java
index 8ce5b78..b4d8ab6 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringContainsDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringContainsDescriptor.java
@@ -18,8 +18,6 @@
*/
package org.apache.asterix.runtime.evaluators.functions;
-import java.io.IOException;
-
import org.apache.asterix.common.annotations.MissingNullInOutFunction;
import org.apache.asterix.om.functions.BuiltinFunctions;
import org.apache.asterix.om.functions.IFunctionDescriptor;
@@ -54,7 +52,7 @@
return new AbstractBinaryStringBoolEval(ctx, args[0], args[1], BuiltinFunctions.STRING_CONTAINS,
sourceLoc) {
@Override
- protected boolean compute(UTF8StringPointable left, UTF8StringPointable right) throws IOException {
+ protected boolean compute(UTF8StringPointable left, UTF8StringPointable right) {
return UTF8StringPointable.contains(left, right, false);
}
};
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringEndsWithDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringEndsWithDescriptor.java
index 3a29bc6..0c952cf 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringEndsWithDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringEndsWithDescriptor.java
@@ -18,8 +18,6 @@
*/
package org.apache.asterix.runtime.evaluators.functions;
-import java.io.IOException;
-
import org.apache.asterix.common.annotations.MissingNullInOutFunction;
import org.apache.asterix.om.functions.BuiltinFunctions;
import org.apache.asterix.om.functions.IFunctionDescriptor;
@@ -55,7 +53,7 @@
sourceLoc) {
@Override
- protected boolean compute(UTF8StringPointable left, UTF8StringPointable right) throws IOException {
+ protected boolean compute(UTF8StringPointable left, UTF8StringPointable right) {
return UTF8StringPointable.endsWith(left, right, false);
}
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringEqualDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringEqualDescriptor.java
index ca43df8..bbe7c59 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringEqualDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringEqualDescriptor.java
@@ -18,8 +18,6 @@
*/
package org.apache.asterix.runtime.evaluators.functions;
-import java.io.IOException;
-
import org.apache.asterix.common.annotations.MissingNullInOutFunction;
import org.apache.asterix.om.functions.BuiltinFunctions;
import org.apache.asterix.om.functions.IFunctionDescriptor;
@@ -55,7 +53,7 @@
sourceLoc) {
@Override
- protected boolean compute(UTF8StringPointable left, UTF8StringPointable right) throws IOException {
+ protected boolean compute(UTF8StringPointable left, UTF8StringPointable right) {
return left.compareTo(right) == 0;
}
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringEvaluatorUtils.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringEvaluatorUtils.java
index 9c2076da..81ce832 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringEvaluatorUtils.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringEvaluatorUtils.java
@@ -24,7 +24,10 @@
import org.apache.hyracks.data.std.primitive.UTF8StringPointable;
import org.apache.hyracks.data.std.util.ByteArrayAccessibleOutputStream;
-public class StringEvaluatorUtils {
+public final class StringEvaluatorUtils {
+
+ private StringEvaluatorUtils() {
+ }
public static int toFlag(String pattern) {
int flag = 0;
@@ -57,32 +60,10 @@
return destString;
}
- static char[] reservedRegexChars =
- new char[] { '\\', '(', ')', '[', ']', '{', '}', '.', '^', '$', '*', '|', '+', '?' };
+ static final char[] RESERVED_REGEX_CHARS = new char[] { '\\', '(', ')', '[', ']', '{', '}', '.', '^', '$', '*', '|',
+ '+', '?', '<', '>', '-', '=', '!' };
static {
- Arrays.sort(reservedRegexChars);
- }
-
- public static String toRegex(String pattern) {
- StringBuilder sb = new StringBuilder();
- for (int i = 0; i < pattern.length(); i++) {
- char c = pattern.charAt(i);
- if (c == '\\' && (i < pattern.length() - 1)
- && (pattern.charAt(i + 1) == '_' || pattern.charAt(i + 1) == '%')) {
- sb.append(pattern.charAt(i + 1));
- ++i;
- } else if (c == '%') {
- sb.append(".*");
- } else if (c == '_') {
- sb.append(".");
- } else {
- if (Arrays.binarySearch(reservedRegexChars, c) >= 0) {
- sb.append('\\');
- }
- sb.append(c);
- }
- }
- return sb.toString();
+ Arrays.sort(RESERVED_REGEX_CHARS);
}
}
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringLikeDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringLikeDescriptor.java
index 8210522..1c75aa9 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringLikeDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringLikeDescriptor.java
@@ -18,11 +18,14 @@
*/
package org.apache.asterix.runtime.evaluators.functions;
-import java.io.IOException;
+import static org.apache.asterix.runtime.evaluators.functions.StringEvaluatorUtils.RESERVED_REGEX_CHARS;
+
+import java.util.Arrays;
import org.apache.asterix.common.annotations.MissingNullInOutFunction;
+import org.apache.asterix.common.exceptions.ErrorCode;
+import org.apache.asterix.common.exceptions.RuntimeDataException;
import org.apache.asterix.om.functions.BuiltinFunctions;
-import org.apache.asterix.om.functions.IFunctionDescriptor;
import org.apache.asterix.om.functions.IFunctionDescriptorFactory;
import org.apache.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
import org.apache.asterix.runtime.evaluators.functions.utils.RegExpMatcher;
@@ -31,11 +34,34 @@
import org.apache.hyracks.algebricks.runtime.base.IScalarEvaluator;
import org.apache.hyracks.algebricks.runtime.base.IScalarEvaluatorFactory;
import org.apache.hyracks.api.exceptions.HyracksDataException;
+import org.apache.hyracks.api.exceptions.SourceLocation;
import org.apache.hyracks.data.std.primitive.UTF8StringPointable;
/**
- * Creates new Matcher and Pattern objects each time the value of the pattern
- * argument (the second argument) changes.
+ * Runtime for {@code LIKE} operator. The invocation is LIKE(test_string, pattern). Pattern of LIKE includes two
+ * wildcards, "%" and "_". The "%" matches zero or more characters. The "_" matches any single character. Line
+ * terminator characters are included, e.g. "\n", "\r\n", etc.
+ * <p>
+ * The default escape character is a backslash. Currently, the default cannot be changed, but will be configurable in
+ * the future. The escape character is used to match literal "%", "_" and the escape character itself. It is an error
+ * to use the escape character to match a character other than those three. It is also an error if the pattern ends
+ * with an incomplete escape character sequence since it not known what character the user wants to match literally.
+ * <p>
+ * Backslash character is written as "\\" inside a string. That is how a backslash character is supposed to be
+ * written inside a string. That means if the escape character is backslash and the goal is to match a literal "%",
+ * write "\\%" in the pattern string. To match a literal "_" write "\\_". To match the backslash (the escape character)
+ * write "\\\\". The first "\\" is the LIKE escape character. The last "\\" is the backslash character to match.
+ * <p>
+ * Examples using the default escape character, the backslash:
+ * <ul>
+ * <li>LIKE("there is a 50% discount", "%50\\% discount") -> true</li>
+ * <li>LIKE("text_text", "%\\_%") -> true</li>
+ * <li>LIKE("text with a backslash \\ in here", "%\\\\%") -> true</li>
+ * <li>LIKE("text with a backslash \\", "%\\") -> ERROR</li>
+ * <li>LIKE("Foo and bar text", "%\\ext") -> ERROR</li>
+ * </ul>
+ * <p>
+ * Creates new Matcher and Pattern objects each time the value of the pattern argument (the second argument) changes.
*/
@MissingNullInOutFunction
@@ -43,12 +69,7 @@
private static final long serialVersionUID = 1L;
- public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
- @Override
- public IFunctionDescriptor createFunctionDescriptor() {
- return new StringLikeDescriptor();
- }
- };
+ public static final IFunctionDescriptorFactory FACTORY = StringLikeDescriptor::new;
@Override
public FunctionIdentifier getIdentifier() {
@@ -62,28 +83,63 @@
@Override
public IScalarEvaluator createScalarEvaluator(IEvaluatorContext ctx) throws HyracksDataException {
- return new AbstractBinaryStringBoolEval(ctx, args[0], args[1],
- StringLikeDescriptor.this.getIdentifier(), sourceLoc) {
- private final RegExpMatcher matcher = new RegExpMatcher();
- private final RegExpMatcher.IRegExpPatternGenerator patternGenerator = new LikePatternGenerator();
-
- @Override
- protected boolean compute(UTF8StringPointable srcPtr, UTF8StringPointable patternPtr)
- throws IOException {
- matcher.build(srcPtr, patternPtr, null, patternGenerator);
- return matcher.matches();
- }
- };
+ return new StringLikeEval(ctx, args[0], args[1], StringLikeDescriptor.this.getIdentifier(), sourceLoc);
}
};
}
- class LikePatternGenerator implements RegExpMatcher.IRegExpPatternGenerator {
+ private static class StringLikeEval extends AbstractBinaryStringBoolEval
+ implements RegExpMatcher.IRegExpPatternGenerator {
+
+ // could be improved to check if args are constant and create a matcher with fixed pattern/flags
+ private static final UTF8StringPointable DOT_ALL_FLAG = UTF8StringPointable.generateUTF8Pointable("s");
+ private static final char likeEscapeChar = '\\'; // currently static until ESCAPE is supported
+ private final RegExpMatcher matcher = new RegExpMatcher();
+ private final StringBuilder tempStringBuilder = new StringBuilder();
+
+ StringLikeEval(IEvaluatorContext context, IScalarEvaluatorFactory evalLeftFactory,
+ IScalarEvaluatorFactory evalRightFactory, FunctionIdentifier funcID, SourceLocation sourceLoc)
+ throws HyracksDataException {
+ super(context, evalLeftFactory, evalRightFactory, funcID, sourceLoc);
+ }
@Override
- public String toRegExpPatternString(String input) {
- return StringEvaluatorUtils.toRegex(input);
+ protected boolean compute(UTF8StringPointable srcPtr, UTF8StringPointable patternPtr)
+ throws HyracksDataException {
+ matcher.build(srcPtr, patternPtr, DOT_ALL_FLAG, this);
+ return matcher.matches();
+ }
+
+ @Override
+ public String toRegExpPatternString(String pattern) throws HyracksDataException {
+ tempStringBuilder.setLength(0);
+ for (int i = 0, length = pattern.length(); i < length; i++) {
+ char c = pattern.charAt(i);
+ if (c == likeEscapeChar) {
+ char nextChar;
+ // escape character can't be last, and only %, _ and the escape char are allowed after it
+ if (i >= length - 1 || ((nextChar = pattern.charAt(i + 1)) != '%' && nextChar != '_'
+ && nextChar != likeEscapeChar)) {
+ throw new RuntimeDataException(ErrorCode.INVALID_LIKE_PATTERN, this.sourceLoc, pattern);
+ }
+ if (Arrays.binarySearch(RESERVED_REGEX_CHARS, nextChar) >= 0) {
+ // precede the nextChar with a backslash if it's one of JAVA's regex reserved chars
+ tempStringBuilder.append('\\');
+ }
+ tempStringBuilder.append(nextChar);
+ ++i;
+ } else if (c == '%') {
+ tempStringBuilder.append(".*");
+ } else if (c == '_') {
+ tempStringBuilder.append('.');
+ } else {
+ if (Arrays.binarySearch(RESERVED_REGEX_CHARS, c) >= 0) {
+ tempStringBuilder.append('\\');
+ }
+ tempStringBuilder.append(c);
+ }
+ }
+ return tempStringBuilder.toString();
}
}
-
}
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringRegExpContainsDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringRegExpContainsDescriptor.java
index 82a9579..1d1d011 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringRegExpContainsDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringRegExpContainsDescriptor.java
@@ -18,8 +18,6 @@
*/
package org.apache.asterix.runtime.evaluators.functions;
-import java.io.IOException;
-
import org.apache.asterix.common.annotations.MissingNullInOutFunction;
import org.apache.asterix.om.functions.BuiltinFunctions;
import org.apache.asterix.om.functions.IFunctionDescriptor;
@@ -57,7 +55,7 @@
@Override
protected boolean compute(UTF8StringPointable srcPtr, UTF8StringPointable patternPtr)
- throws IOException {
+ throws HyracksDataException {
matcher.build(srcPtr, patternPtr);
return matcher.find();
}
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringRegExpContainsWithFlagDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringRegExpContainsWithFlagDescriptor.java
index af67eae..7016581 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringRegExpContainsWithFlagDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringRegExpContainsWithFlagDescriptor.java
@@ -59,7 +59,7 @@
@Override
protected boolean compute(UTF8StringPointable srcPtr, UTF8StringPointable patternPtr,
- UTF8StringPointable flagPtr) {
+ UTF8StringPointable flagPtr) throws HyracksDataException {
matcher.build(srcPtr, patternPtr, flagPtr);
return matcher.find();
}
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringRegExpLikeDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringRegExpLikeDescriptor.java
index 23b6cd9..8a6587e 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringRegExpLikeDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringRegExpLikeDescriptor.java
@@ -19,8 +19,6 @@
package org.apache.asterix.runtime.evaluators.functions;
-import java.io.IOException;
-
import org.apache.asterix.common.annotations.MissingNullInOutFunction;
import org.apache.asterix.om.functions.BuiltinFunctions;
import org.apache.asterix.om.functions.IFunctionDescriptor;
@@ -58,7 +56,7 @@
@Override
protected boolean compute(UTF8StringPointable srcPtr, UTF8StringPointable patternPtr)
- throws IOException {
+ throws HyracksDataException {
matcher.build(srcPtr, patternPtr);
return matcher.matches();
}
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringRegExpLikeWithFlagDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringRegExpLikeWithFlagDescriptor.java
index 6019b24..046f80e 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringRegExpLikeWithFlagDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringRegExpLikeWithFlagDescriptor.java
@@ -56,7 +56,7 @@
@Override
protected boolean compute(UTF8StringPointable srcPtr, UTF8StringPointable patternPtr,
- UTF8StringPointable flagPtr) {
+ UTF8StringPointable flagPtr) throws HyracksDataException {
matcher.build(srcPtr, patternPtr, flagPtr);
return matcher.matches();
}
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringRegExpPositionDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringRegExpPositionDescriptor.java
index c152358..bfdcb1e 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringRegExpPositionDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringRegExpPositionDescriptor.java
@@ -63,9 +63,10 @@
private final RegExpMatcher matcher = new RegExpMatcher();
@Override
- protected int compute(UTF8StringPointable srcPtr, UTF8StringPointable patternPtr) {
+ protected int compute(UTF8StringPointable srcPtr, UTF8StringPointable patternPtr)
+ throws HyracksDataException {
matcher.build(srcPtr, patternPtr);
- int pos = matcher.postion();
+ int pos = matcher.position();
return pos < 0 ? pos : pos + baseOffset;
}
};
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringRegExpPositionWithFlagDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringRegExpPositionWithFlagDescriptor.java
index 9a1abc8..339b989 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringRegExpPositionWithFlagDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringRegExpPositionWithFlagDescriptor.java
@@ -64,9 +64,9 @@
@Override
protected int compute(UTF8StringPointable srcPtr, UTF8StringPointable patternPtr,
- UTF8StringPointable flagPtr) {
+ UTF8StringPointable flagPtr) throws HyracksDataException {
matcher.build(srcPtr, patternPtr, flagPtr);
- int pos = matcher.postion();
+ int pos = matcher.position();
return pos < 0 ? pos : pos + baseOffset;
}
};
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringRegExpReplaceDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringRegExpReplaceDescriptor.java
index de373ac..9819d63 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringRegExpReplaceDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringRegExpReplaceDescriptor.java
@@ -55,7 +55,7 @@
@Override
protected String compute(UTF8StringPointable srcPtr, UTF8StringPointable patternPtr,
- UTF8StringPointable replacePtr) {
+ UTF8StringPointable replacePtr) throws HyracksDataException {
matcher.build(srcPtr, patternPtr);
return matcher.replace(replacePtr);
}
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringStartsWithDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringStartsWithDescriptor.java
index c9606e1..41eeeca 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringStartsWithDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringStartsWithDescriptor.java
@@ -18,8 +18,6 @@
*/
package org.apache.asterix.runtime.evaluators.functions;
-import java.io.IOException;
-
import org.apache.asterix.common.annotations.MissingNullInOutFunction;
import org.apache.asterix.om.functions.BuiltinFunctions;
import org.apache.asterix.om.functions.IFunctionDescriptor;
@@ -55,7 +53,7 @@
sourceLoc) {
@Override
- protected boolean compute(UTF8StringPointable left, UTF8StringPointable right) throws IOException {
+ protected boolean compute(UTF8StringPointable left, UTF8StringPointable right) {
return UTF8StringPointable.startsWith(left, right, false);
}
};
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/utils/RegExpMatcher.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/utils/RegExpMatcher.java
index 77622d3..0b234f5 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/utils/RegExpMatcher.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/utils/RegExpMatcher.java
@@ -23,6 +23,7 @@
import java.util.regex.Pattern;
import org.apache.asterix.runtime.evaluators.functions.StringEvaluatorUtils;
+import org.apache.hyracks.api.exceptions.HyracksDataException;
import org.apache.hyracks.data.std.primitive.UTF8StringPointable;
import org.apache.hyracks.data.std.util.ByteArrayAccessibleOutputStream;
import org.apache.hyracks.data.std.util.UTF8CharSequence;
@@ -57,7 +58,7 @@
@FunctionalInterface
public interface IRegExpPatternGenerator {
- String toRegExpPatternString(String inputString);
+ String toRegExpPatternString(String inputString) throws HyracksDataException;
}
/**
@@ -68,7 +69,7 @@
* @param patternPtr
* , the definition of the regular expression.
*/
- public void build(UTF8StringPointable srcPtr, UTF8StringPointable patternPtr) {
+ public void build(UTF8StringPointable srcPtr, UTF8StringPointable patternPtr) throws HyracksDataException {
build(srcPtr, patternPtr, null);
}
@@ -82,7 +83,8 @@
* @param flagPtr
* , the flags.
*/
- public void build(UTF8StringPointable srcPtr, UTF8StringPointable patternPtr, UTF8StringPointable flagPtr) {
+ public void build(UTF8StringPointable srcPtr, UTF8StringPointable patternPtr, UTF8StringPointable flagPtr)
+ throws HyracksDataException {
build(srcPtr, patternPtr, flagPtr, null);
}
@@ -99,33 +101,32 @@
* , the regular expression pattern generator.
*/
public void build(UTF8StringPointable srcPtr, UTF8StringPointable patternPtr, UTF8StringPointable flagPtr,
- IRegExpPatternGenerator patternGenerator) {
- // Builds a new pattern if necessary.
- final boolean newPattern = patternPtr != null && (pattern == null || lastPatternPtr.compareTo(patternPtr) != 0);
+ IRegExpPatternGenerator patternGenerator) throws HyracksDataException {
+ // Builds a new pattern if necessary. patternPtr cannot be null
+ final boolean newPattern = pattern == null || lastPatternPtr.compareTo(patternPtr) != 0;
final boolean newFlag = flagPtr != null && (pattern == null || lastFlagPtr.compareTo(flagPtr) != 0);
- if (newPattern) {
- StringEvaluatorUtils.copyResetUTF8Pointable(patternPtr, lastPatternStorage, lastPatternPtr);
- }
- if (newFlag) {
- StringEvaluatorUtils.copyResetUTF8Pointable(flagPtr, lastFlagsStorage, lastFlagPtr);
- }
- if (newPattern || newFlag) {
- StringEvaluatorUtils.copyResetUTF8Pointable(patternPtr, lastPatternStorage, lastPatternPtr);
- // ! object creation !
- String inputPatternString = lastPatternPtr.toString();
- String patternString = patternGenerator == null ? inputPatternString
- : patternGenerator.toRegExpPatternString(inputPatternString);
- if (newFlag) {
- pattern = Pattern.compile(patternString, StringEvaluatorUtils.toFlag(flagPtr.toString()));
-
- } else {
- pattern = Pattern.compile(patternString);
- }
- }
-
- // Resets the matcher.
charSeq.reset(srcPtr);
if (newPattern || newFlag) {
+ // ! object creation !
+ String patternString;
+ if (newPattern) {
+ StringEvaluatorUtils.copyResetUTF8Pointable(patternPtr, lastPatternStorage, lastPatternPtr);
+ String inputPatternString = lastPatternPtr.toString();
+ patternString = patternGenerator == null ? inputPatternString
+ : patternGenerator.toRegExpPatternString(inputPatternString);
+ } else {
+ // use whatever pattern string the previous pattern was using
+ patternString = pattern.pattern();
+ }
+ int flags = 0;
+ if (newFlag) {
+ StringEvaluatorUtils.copyResetUTF8Pointable(flagPtr, lastFlagsStorage, lastFlagPtr);
+ flags = StringEvaluatorUtils.toFlag(lastFlagPtr.toString());
+ } else if (pattern != null) {
+ // use whatever flags the previous pattern was using
+ flags = pattern.flags();
+ }
+ pattern = Pattern.compile(patternString, flags);
matcher = pattern.matcher(charSeq);
} else {
matcher.reset(charSeq);
@@ -153,7 +154,7 @@
/**
* @return the first matched position of the regular expression pattern in the source string.
*/
- public int postion() {
+ public int position() {
return matcher.find() ? matcher.start() : -1;
}
diff --git a/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/expressions/BroadcastExpressionAnnotation.java b/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/expressions/BroadcastExpressionAnnotation.java
index 6c47b82..9eef8f6 100644
--- a/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/expressions/BroadcastExpressionAnnotation.java
+++ b/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/expressions/BroadcastExpressionAnnotation.java
@@ -20,12 +20,10 @@
public class BroadcastExpressionAnnotation implements IExpressionAnnotation {
- public static final String BROADCAST_ANNOTATION_KEY = "broadcast";
-
public enum BroadcastSide {
LEFT,
RIGHT
- };
+ }
private BroadcastSide side;
@@ -41,14 +39,9 @@
@Override
public IExpressionAnnotation copy() {
- BroadcastExpressionAnnotation bcast = new BroadcastExpressionAnnotation();
- bcast.side = side;
- return bcast;
- }
-
- @Override
- public String toString() {
- return BROADCAST_ANNOTATION_KEY;
+ BroadcastExpressionAnnotation hashBcast = new BroadcastExpressionAnnotation();
+ hashBcast.side = side;
+ return hashBcast;
}
}
diff --git a/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/logical/visitors/BroadcastSideSwitchingVisitor.java b/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/logical/visitors/BroadcastSideSwitchingVisitor.java
new file mode 100644
index 0000000..c9da3f6
--- /dev/null
+++ b/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/logical/visitors/BroadcastSideSwitchingVisitor.java
@@ -0,0 +1,108 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.hyracks.algebricks.core.algebra.operators.logical.visitors;
+
+import java.util.Iterator;
+import java.util.Map;
+
+import org.apache.commons.lang3.mutable.Mutable;
+import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
+import org.apache.hyracks.algebricks.core.algebra.base.ILogicalExpression;
+import org.apache.hyracks.algebricks.core.algebra.expressions.AggregateFunctionCallExpression;
+import org.apache.hyracks.algebricks.core.algebra.expressions.BroadcastExpressionAnnotation;
+import org.apache.hyracks.algebricks.core.algebra.expressions.ConstantExpression;
+import org.apache.hyracks.algebricks.core.algebra.expressions.ScalarFunctionCallExpression;
+import org.apache.hyracks.algebricks.core.algebra.expressions.StatefulFunctionCallExpression;
+import org.apache.hyracks.algebricks.core.algebra.expressions.UnnestingFunctionCallExpression;
+import org.apache.hyracks.algebricks.core.algebra.expressions.VariableReferenceExpression;
+import org.apache.hyracks.algebricks.core.algebra.functions.AlgebricksBuiltinFunctions;
+import org.apache.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+import org.apache.hyracks.algebricks.core.algebra.visitors.ILogicalExpressionVisitor;
+
+public class BroadcastSideSwitchingVisitor implements ILogicalExpressionVisitor<ILogicalExpression, Void> {
+ private static BroadcastSideSwitchingVisitor instance = null;
+
+ private BroadcastSideSwitchingVisitor() {
+ }
+
+ public static BroadcastSideSwitchingVisitor getInstance() {
+ if (instance == null) {
+ instance = new BroadcastSideSwitchingVisitor();
+ }
+ return instance;
+ }
+
+ @Override
+ public ILogicalExpression visitConstantExpression(ConstantExpression expr, Void arg) {
+ return null;
+ }
+
+ @Override
+ public ILogicalExpression visitVariableReferenceExpression(VariableReferenceExpression expr, Void arg) {
+ return null;
+ }
+
+ @Override
+ public ILogicalExpression visitAggregateFunctionCallExpression(AggregateFunctionCallExpression expr, Void arg) {
+ return null;
+ }
+
+ @Override
+ public ILogicalExpression visitScalarFunctionCallExpression(ScalarFunctionCallExpression expr, Void arg)
+ throws AlgebricksException {
+ BroadcastExpressionAnnotation.BroadcastSide bSide;
+ FunctionIdentifier fi = expr.getFunctionIdentifier();
+ if (fi.equals(AlgebricksBuiltinFunctions.AND)) {
+ for (Mutable<ILogicalExpression> a : expr.getArguments()) {
+ a.getValue().accept(this, null);
+ }
+ }
+ Iterator it = expr.getAnnotations().entrySet().iterator();
+ while (it.hasNext()) {
+ Map.Entry pair = (Map.Entry) it.next();
+ if (pair.getKey() instanceof BroadcastExpressionAnnotation) {
+ bSide = (BroadcastExpressionAnnotation.BroadcastSide) ((BroadcastExpressionAnnotation) pair.getValue())
+ .getObject();
+ switch (bSide) {
+ case RIGHT:
+ bSide = BroadcastExpressionAnnotation.BroadcastSide.LEFT;
+ break;
+ case LEFT:
+ bSide = BroadcastExpressionAnnotation.BroadcastSide.RIGHT;
+ break;
+ default:
+ bSide = null;
+ break;
+ }
+ ((BroadcastExpressionAnnotation) pair.getValue()).setObject(bSide);
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public ILogicalExpression visitStatefulFunctionCallExpression(StatefulFunctionCallExpression expr, Void arg) {
+ return null;
+ }
+
+ @Override
+ public ILogicalExpression visitUnnestingFunctionCallExpression(UnnestingFunctionCallExpression expr, Void arg) {
+ return null;
+ }
+}
diff --git a/hyracks-fullstack/algebricks/algebricks-rewriter/src/main/java/org/apache/hyracks/algebricks/rewriter/util/JoinUtils.java b/hyracks-fullstack/algebricks/algebricks-rewriter/src/main/java/org/apache/hyracks/algebricks/rewriter/util/JoinUtils.java
index 7dfeeb5..6eede7f 100644
--- a/hyracks-fullstack/algebricks/algebricks-rewriter/src/main/java/org/apache/hyracks/algebricks/rewriter/util/JoinUtils.java
+++ b/hyracks-fullstack/algebricks/algebricks-rewriter/src/main/java/org/apache/hyracks/algebricks/rewriter/util/JoinUtils.java
@@ -18,10 +18,10 @@
*/
package org.apache.hyracks.algebricks.rewriter.util;
-import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
+import java.util.Set;
import org.apache.commons.lang3.mutable.Mutable;
import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
@@ -67,7 +67,7 @@
List<LogicalVariable> varsRight = op.getInputs().get(1).getValue().getSchema();
ILogicalExpression conditionExpr = op.getCondition().getValue();
if (isHashJoinCondition(conditionExpr, varsLeft, varsRight, sideLeft, sideRight)) {
- BroadcastSide side = getBroadcastJoinSide(conditionExpr, varsLeft, varsRight);
+ BroadcastSide side = getBroadcastJoinSide(conditionExpr);
if (side == null) {
setHashJoinOp(op, JoinPartitioningType.PAIRWISE, sideLeft, sideRight, context);
} else {
@@ -190,55 +190,33 @@
}
}
- private static BroadcastSide getBroadcastJoinSide(ILogicalExpression e, List<LogicalVariable> varsLeft,
- List<LogicalVariable> varsRight) {
+ private static BroadcastSide getBroadcastJoinSide(ILogicalExpression e) {
+ BroadcastSide side = null;
if (e.getExpressionTag() != LogicalExpressionTag.FUNCTION_CALL) {
return null;
}
AbstractFunctionCallExpression fexp = (AbstractFunctionCallExpression) e;
FunctionIdentifier fi = fexp.getFunctionIdentifier();
if (fi.equals(AlgebricksBuiltinFunctions.AND)) {
- BroadcastSide fBcastSide = null;
for (Mutable<ILogicalExpression> a : fexp.getArguments()) {
- BroadcastSide aBcastSide = getBroadcastJoinSide(a.getValue(), varsLeft, varsRight);
- if (fBcastSide == null) {
- fBcastSide = aBcastSide;
- } else if (aBcastSide != null && !aBcastSide.equals(fBcastSide)) {
+ BroadcastSide newSide = getBroadcastJoinSide(a.getValue());
+ if (side == null) {
+ side = newSide;
+ } else if (newSide != null && !newSide.equals(side)) {
return null;
}
}
- return fBcastSide;
+ return side;
} else {
- IExpressionAnnotation ann =
- fexp.getAnnotations().get(BroadcastExpressionAnnotation.BROADCAST_ANNOTATION_KEY);
- if (ann == null) {
- return null;
- }
- BroadcastSide side = (BroadcastSide) ann.getObject();
- if (side == null) {
- return null;
- }
- int i;
- switch (side) {
- case LEFT:
- i = 0;
- break;
- case RIGHT:
- i = 1;
- break;
- default:
- return null;
- }
- ArrayList<LogicalVariable> vars = new ArrayList<>();
- fexp.getArguments().get(i).getValue().getUsedVariables(vars);
- if (varsLeft.containsAll(vars)) {
- return BroadcastSide.LEFT;
- } else if (varsRight.containsAll(vars)) {
- return BroadcastSide.RIGHT;
- } else {
- return null;
+ Set<Object> annotationSet = fexp.getAnnotations().keySet();
+ for (Object o : annotationSet) {
+ if (o instanceof BroadcastExpressionAnnotation) {
+ IExpressionAnnotation ann = (BroadcastExpressionAnnotation) o;
+ return (BroadcastSide) ann.getObject();
+ }
}
}
+ return null;
}
private static void warnIfCrossProduct(ILogicalExpression conditionExpr, SourceLocation sourceLoc,
diff --git a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/comm/IBufferFactory.java b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/comm/IBufferFactory.java
index 9e8d931..d1d5b9b 100644
--- a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/comm/IBufferFactory.java
+++ b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/comm/IBufferFactory.java
@@ -22,9 +22,20 @@
import org.apache.hyracks.api.exceptions.HyracksDataException;
-@FunctionalInterface
public interface IBufferFactory {
- public ByteBuffer createBuffer() throws HyracksDataException;
+ /**
+ * Creates a buffer
+ *
+ * @return the created buffer
+ * @throws HyracksDataException
+ */
+ ByteBuffer createBuffer() throws HyracksDataException;
+ /**
+ * Gets the number of created buffers
+ *
+ * @return the number of created buffers
+ */
+ int getCreatedBuffersCount();
}
diff --git a/hyracks-fullstack/hyracks/hyracks-comm/src/main/java/org/apache/hyracks/comm/channels/ReadBufferFactory.java b/hyracks-fullstack/hyracks/hyracks-comm/src/main/java/org/apache/hyracks/comm/channels/ReadBufferFactory.java
index 876b3de..ed639f5 100644
--- a/hyracks-fullstack/hyracks/hyracks-comm/src/main/java/org/apache/hyracks/comm/channels/ReadBufferFactory.java
+++ b/hyracks-fullstack/hyracks/hyracks-comm/src/main/java/org/apache/hyracks/comm/channels/ReadBufferFactory.java
@@ -22,7 +22,9 @@
import org.apache.hyracks.api.comm.IBufferFactory;
import org.apache.hyracks.api.context.IHyracksCommonContext;
+import org.apache.hyracks.util.annotations.NotThreadSafe;
+@NotThreadSafe
public class ReadBufferFactory implements IBufferFactory {
private final int limit;
@@ -44,4 +46,9 @@
return frame;
}
}
+
+ @Override
+ public int getCreatedBuffersCount() {
+ return counter;
+ }
}
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/scheduler/FIFOJobQueue.java b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/scheduler/FIFOJobQueue.java
index 2a6bdae..260c6b9 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/scheduler/FIFOJobQueue.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/scheduler/FIFOJobQueue.java
@@ -35,8 +35,8 @@
import org.apache.hyracks.api.job.resource.IJobCapacityController;
import org.apache.hyracks.control.cc.job.IJobManager;
import org.apache.hyracks.control.cc.job.JobRun;
+import org.apache.hyracks.util.annotations.GuardedBy;
import org.apache.hyracks.util.annotations.NotThreadSafe;
-import org.apache.hyracks.util.annotations.ThreadSafetyGuaranteedBy;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -45,7 +45,7 @@
* An implementation of IJobQueue that gives more priority to jobs that are submitted earlier.
*/
@NotThreadSafe
-@ThreadSafetyGuaranteedBy("JobManager")
+@GuardedBy("JobManager")
public class FIFOJobQueue implements IJobQueue {
private static final Logger LOGGER = LogManager.getLogger();
diff --git a/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/AbstractChannelReadInterface.java b/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/AbstractChannelReadInterface.java
index 31cb69f..d81517d 100644
--- a/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/AbstractChannelReadInterface.java
+++ b/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/AbstractChannelReadInterface.java
@@ -24,6 +24,7 @@
import org.apache.hyracks.api.comm.IBufferFactory;
import org.apache.hyracks.api.comm.IChannelReadInterface;
import org.apache.hyracks.api.comm.ICloseableBufferAcceptor;
+import org.apache.hyracks.util.annotations.GuardedBy;
public abstract class AbstractChannelReadInterface implements IChannelReadInterface {
@@ -31,6 +32,7 @@
protected IBufferAcceptor emptyBufferAcceptor;
protected ByteBuffer currentReadBuffer;
protected IBufferFactory bufferFactory;
+ @GuardedBy("MultiplexConnection")
protected volatile int credits;
@Override
@@ -58,11 +60,13 @@
}
@Override
+ @GuardedBy("MultiplexConnection")
public int getCredits() {
return credits;
}
@Override
+ @GuardedBy("MultiplexConnection")
public void setReadCredits(int credits) {
this.credits = credits;
}
diff --git a/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/AbstractChannelWriteInterface.java b/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/AbstractChannelWriteInterface.java
index 5c927f9..741ca8c 100644
--- a/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/AbstractChannelWriteInterface.java
+++ b/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/AbstractChannelWriteInterface.java
@@ -27,6 +27,7 @@
import org.apache.hyracks.api.comm.IChannelControlBlock;
import org.apache.hyracks.api.comm.IChannelWriteInterface;
import org.apache.hyracks.api.comm.ICloseableBufferAcceptor;
+import org.apache.hyracks.util.annotations.GuardedBy;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -42,6 +43,7 @@
protected boolean channelWritabilityState;
protected final int channelId;
protected IBufferAcceptor eba;
+ @GuardedBy("ChannelControlBlock")
protected int credits;
protected boolean eos;
protected boolean eosSent;
@@ -61,6 +63,7 @@
}
@Override
+ @GuardedBy("ChannelControlBlock")
public void writeComplete() {
if (currentWriteBuffer.remaining() <= 0) {
currentWriteBuffer.clear();
@@ -70,6 +73,7 @@
}
}
+ @GuardedBy("ChannelControlBlock")
private boolean computeWritability() {
boolean writableDataPresent = currentWriteBuffer != null || !wiFullQueue.isEmpty();
if (writableDataPresent) {
@@ -82,6 +86,7 @@
}
@Override
+ @GuardedBy("ChannelControlBlock")
public void adjustChannelWritability() {
boolean writable = computeWritability();
if (writable) {
@@ -97,6 +102,7 @@
}
@Override
+ @GuardedBy("ChannelControlBlock")
public void addCredits(int credit) {
credits += credit;
}
diff --git a/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/ChannelControlBlock.java b/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/ChannelControlBlock.java
index 3f88630..4ca7f1a 100644
--- a/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/ChannelControlBlock.java
+++ b/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/ChannelControlBlock.java
@@ -30,6 +30,7 @@
import org.apache.hyracks.api.network.ISocketChannel;
import org.apache.hyracks.net.protocols.muxdemux.MultiplexedConnection.WriterState;
import org.apache.hyracks.util.JSONUtil;
+import org.apache.hyracks.util.annotations.GuardedBy;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -95,10 +96,12 @@
return ri.read(sc, size);
}
+ @GuardedBy("MultiplexConnection")
int getReadCredits() {
return ri.getCredits();
}
+ @GuardedBy("MultiplexConnection")
void setReadCredits(int credits) {
ri.setReadCredits(credits);
}
diff --git a/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/FullFrameChannelReadInterface.java b/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/FullFrameChannelReadInterface.java
index f32e6bf..9d7f848 100644
--- a/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/FullFrameChannelReadInterface.java
+++ b/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/FullFrameChannelReadInterface.java
@@ -27,6 +27,7 @@
import org.apache.hyracks.api.comm.IChannelControlBlock;
import org.apache.hyracks.api.exceptions.NetException;
import org.apache.hyracks.api.network.ISocketChannel;
+import org.apache.hyracks.util.annotations.GuardedBy;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -36,6 +37,9 @@
private final Deque<ByteBuffer> riEmptyStack;
private final IChannelControlBlock ccb;
private final Object bufferRecycleLock = new Object();
+ private int frameSize;
+ private long recycledBuffers = 0;
+ private long flushedBuffers = 0;
public FullFrameChannelReadInterface(IChannelControlBlock ccb) {
this.ccb = ccb;
@@ -43,17 +47,22 @@
credits = 0;
emptyBufferAcceptor = buffer -> {
final int delta = buffer.remaining();
+ if (delta != frameSize) {
+ LOGGER.warn("partial frame being recycled; expected size {}, actual size {}", frameSize, delta);
+ }
synchronized (bufferRecycleLock) {
if (ccb.isRemotelyClosed()) {
return;
}
riEmptyStack.push(buffer);
+ recycledBuffers++;
ccb.addPendingCredits(delta);
}
};
}
@Override
+ @GuardedBy("ChannelControlBlock")
public int read(ISocketChannel sc, int size) throws IOException, NetException {
synchronized (bufferRecycleLock) {
while (true) {
@@ -62,16 +71,12 @@
}
if (currentReadBuffer == null) {
currentReadBuffer = riEmptyStack.poll();
- //if current buffer == null and limit not reached
- // factory.createBuffer factory
if (currentReadBuffer == null) {
currentReadBuffer = bufferFactory.createBuffer();
}
}
if (currentReadBuffer == null) {
- if (LOGGER.isWarnEnabled()) {
- LOGGER.warn("{} read buffers exceeded. Current empty buffers: {}", ccb, riEmptyStack.size());
- }
+ logStats();
throw new IllegalStateException(ccb + " read buffers exceeded");
}
int rSize = Math.min(size, currentReadBuffer.remaining());
@@ -95,6 +100,7 @@
}
if (currentReadBuffer.remaining() <= 0) {
flush();
+ flushedBuffers++;
}
}
}
@@ -102,7 +108,16 @@
@Override
public void setBufferFactory(IBufferFactory bufferFactory, int limit, int frameSize) {
+ this.frameSize = frameSize;
super.setBufferFactory(bufferFactory, limit, frameSize);
ccb.addPendingCredits(limit * frameSize);
}
+
+ private void logStats() {
+ if (LOGGER.isWarnEnabled()) {
+ LOGGER.warn(
+ "{} read buffers exceeded; current empty buffers: {}, created buffers: {}, recycled buffers: {}, flushed buffers: {}",
+ ccb, riEmptyStack.size(), bufferFactory.getCreatedBuffersCount(), recycledBuffers, flushedBuffers);
+ }
+ }
}
diff --git a/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/FullFrameChannelWriteInterface.java b/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/FullFrameChannelWriteInterface.java
index 3f4618b..a7be3a6 100644
--- a/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/FullFrameChannelWriteInterface.java
+++ b/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/FullFrameChannelWriteInterface.java
@@ -23,6 +23,7 @@
import org.apache.hyracks.api.comm.IConnectionWriterState;
import org.apache.hyracks.api.comm.MuxDemuxCommand;
import org.apache.hyracks.api.exceptions.NetException;
+import org.apache.hyracks.util.annotations.GuardedBy;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -35,6 +36,7 @@
}
@Override
+ @GuardedBy("ChannelControlBlock")
public void write(IConnectionWriterState writerState) throws NetException {
if (currentWriteBuffer == null) {
currentWriteBuffer = wiFullQueue.poll();
@@ -43,6 +45,9 @@
int size = Math.min(currentWriteBuffer.remaining(), credits);
if (size > 0) {
credits -= size;
+ if (credits % currentWriteBuffer.capacity() != 0) {
+ LOGGER.warn("partial frame being written on {}", ccb);
+ }
writerState.getCommand().setChannelId(channelId);
writerState.getCommand().setCommandType(MuxDemuxCommand.CommandType.DATA);
writerState.getCommand().setData(size);
diff --git a/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/MultiplexedConnection.java b/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/MultiplexedConnection.java
index 64c1a53..061c6eee 100644
--- a/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/MultiplexedConnection.java
+++ b/hyracks-fullstack/hyracks/hyracks-net/src/main/java/org/apache/hyracks/net/protocols/muxdemux/MultiplexedConnection.java
@@ -34,7 +34,7 @@
import org.apache.hyracks.net.protocols.tcp.ITCPConnectionEventListener;
import org.apache.hyracks.net.protocols.tcp.TCPConnection;
import org.apache.hyracks.util.JSONUtil;
-import org.apache.hyracks.util.annotations.ThreadSafetyGuaranteedBy;
+import org.apache.hyracks.util.annotations.GuardedBy;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -406,6 +406,7 @@
int channelId = readerState.command.getChannelId();
ccb = cSet.registerChannel(channelId);
muxDemux.getChannelOpenListener().channelOpened(ccb);
+ break;
}
}
if (LOGGER.isTraceEnabled()) {
@@ -429,7 +430,7 @@
return muxDemux.getChannelInterfaceFactory();
}
- @ThreadSafetyGuaranteedBy("MultiplexedConnection.this")
+ @GuardedBy("MultiplexedConnection.this")
private class EventCounter implements IEventCounter {
private int counter;
diff --git a/hyracks-fullstack/hyracks/hyracks-net/src/test/java/org/apache/hyracks/net/tests/FullFrameChannelReadInterfaceTest.java b/hyracks-fullstack/hyracks/hyracks-net/src/test/java/org/apache/hyracks/net/tests/FullFrameChannelReadInterfaceTest.java
index ef6048d..2180d1d 100644
--- a/hyracks-fullstack/hyracks/hyracks-net/src/test/java/org/apache/hyracks/net/tests/FullFrameChannelReadInterfaceTest.java
+++ b/hyracks-fullstack/hyracks/hyracks-net/src/test/java/org/apache/hyracks/net/tests/FullFrameChannelReadInterfaceTest.java
@@ -176,5 +176,11 @@
counter++;
return ByteBuffer.allocate(frameSize);
}
+
+ @Override
+ public int getCreatedBuffersCount() {
+ return counter;
+ }
+
}
}
diff --git a/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/annotations/ThreadSafetyGuaranteedBy.java b/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/annotations/GuardedBy.java
similarity index 92%
rename from hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/annotations/ThreadSafetyGuaranteedBy.java
rename to hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/annotations/GuardedBy.java
index 7ca1a94..0ce2727 100644
--- a/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/annotations/ThreadSafetyGuaranteedBy.java
+++ b/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/annotations/GuardedBy.java
@@ -29,8 +29,8 @@
* to be thread safe by {@link #value()}
*/
@Documented
-@Target({ ElementType.TYPE, ElementType.METHOD })
+@Target({ ElementType.TYPE, ElementType.METHOD, ElementType.FIELD })
@Retention(RetentionPolicy.SOURCE)
-public @interface ThreadSafetyGuaranteedBy {
+public @interface GuardedBy {
String value();
}