[ASTERIXDB-2657][FUN] String 1-based functions + function aliases
- user model changes: yes
- storage format changes: no
- interface changes: no
Details:
- Removed compiler property compiler.stringoffset.
- Add 1-based string function to the following functions:
position, regex_position
- Add aliases to the following functions:
position, substring, regex_contains, regex_like,
regex_position, regex_replace
- Add test cases for the above mentioned functions and
aliases.
Change-Id: I0df799f197e430a9cd7d1b2a45e372a0cd77347e
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/3643
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Hussain Towaileb <hussainht@gmail.com>
diff --git a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/runtime/StringOffsetTest.java b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/runtime/StringOffsetTest.java
deleted file mode 100644
index 0400649..0000000
--- a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/runtime/StringOffsetTest.java
+++ /dev/null
@@ -1,65 +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.
- */
-
-package org.apache.asterix.test.runtime;
-
-import java.util.Collection;
-
-import org.apache.asterix.test.common.TestExecutor;
-import org.apache.asterix.testframework.context.TestCaseContext;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-
-/**
- * Overrides string offset to be 1 instead of 0
- */
-@RunWith(Parameterized.class)
-public class StringOffsetTest {
- protected static final String TEST_CONFIG_FILE_NAME = "src/test/resources/cc-stringoffset.conf";
-
- @BeforeClass
- public static void setUp() throws Exception {
- LangExecutionUtil.setUp(TEST_CONFIG_FILE_NAME, new TestExecutor());
- }
-
- @AfterClass
- public static void tearDown() throws Exception {
- LangExecutionUtil.tearDown();
- }
-
- @Parameterized.Parameters(name = "StringOffsetTest {index}: {0}")
- public static Collection<Object[]> tests() throws Exception {
- return LangExecutionUtil.tests("only_sqlpp.xml", "testsuite_stringoffset.xml");
- }
-
- protected TestCaseContext tcCtx;
-
- public StringOffsetTest(TestCaseContext tcCtx) {
- this.tcCtx = tcCtx;
- }
-
- @Test
- public void test() throws Exception {
- LangExecutionUtil.test(tcCtx);
- }
-
-}
diff --git a/asterixdb/asterix-app/src/test/resources/cc-stringoffset.conf b/asterixdb/asterix-app/src/test/resources/cc-stringoffset.conf
deleted file mode 100644
index b176852..0000000
--- a/asterixdb/asterix-app/src/test/resources/cc-stringoffset.conf
+++ /dev/null
@@ -1,60 +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.
-
-; Overrides string offset to be 1 instead of 0
-
-[nc/asterix_nc1]
-txn.log.dir=target/tmp/asterix_nc1/txnlog
-core.dump.dir=target/tmp/asterix_nc1/coredump
-iodevices=target/tmp/asterix_nc1/iodevice1,../asterix-server/target/tmp/asterix_nc1/iodevice2
-nc.api.port=19004
-#jvm.args=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5006
-
-[nc/asterix_nc2]
-ncservice.port=9091
-txn.log.dir=target/tmp/asterix_nc2/txnlog
-core.dump.dir=target/tmp/asterix_nc2/coredump
-iodevices=target/tmp/asterix_nc2/iodevice1,../asterix-server/target/tmp/asterix_nc2/iodevice2
-nc.api.port=19005
-#jvm.args=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5007
-
-[nc]
-address=127.0.0.1
-command=asterixnc
-app.class=org.apache.asterix.hyracks.bootstrap.NCApplication
-jvm.args=-Xmx4096m -Dnode.Resolver="org.apache.asterix.external.util.IdentitiyResolverFactory"
-storage.buffercache.pagesize=32KB
-storage.buffercache.size=128MB
-storage.memorycomponent.globalbudget=512MB
-
-[cc]
-address = 127.0.0.1
-app.class=org.apache.asterix.hyracks.bootstrap.CCApplication
-heartbeat.period=2000
-heartbeat.max.misses=25
-
-[common]
-log.level = INFO
-compiler.framesize=32KB
-compiler.sortmemory=320KB
-compiler.groupmemory=160KB
-compiler.joinmemory=256KB
-compiler.windowmemory=192KB
-compiler.stringoffset=1
-messaging.frame.size=4096
-messaging.frame.count=512
-
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/position/offset0/pos/pos.1.query.sqlpp
similarity index 88%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/position/offset0/pos/pos.1.query.sqlpp
index 6568d06..ca2de43 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/position/offset0/pos/pos.1.query.sqlpp
@@ -17,4 +17,6 @@
* under the License.
*/
-{'result1': REGEXP_POSITION('helloworld','hello world','x')};
+// pos alias
+select element [pos(x, 'ofo'), pos(y,'ofo')]
+from ['foofoo'] as x, ['barbar'] as y;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/position/offset0/pos0/pos0.1.query.sqlpp
similarity index 88%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/position/offset0/pos0/pos0.1.query.sqlpp
index 6568d06..6bf0ff7 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/position/offset0/pos0/pos0.1.query.sqlpp
@@ -17,4 +17,6 @@
* under the License.
*/
-{'result1': REGEXP_POSITION('helloworld','hello world','x')};
+// pos0 alias
+select element [pos0(x, 'ofo'), pos0(y,'ofo')]
+from ['foofoo'] as x, ['barbar'] as y;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/position/offset0/position/position.1.query.sqlpp
similarity index 89%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/position/offset0/position/position.1.query.sqlpp
index 7bd4fad..cdda7de 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/position/offset0/position/position.1.query.sqlpp
@@ -17,6 +17,5 @@
* under the License.
*/
-USE test;
-
-FROM ds SELECT VALUE regexp_position(test_str, pattern) ORDER BY id;
\ No newline at end of file
+select element [position(x, 'ofo'), position(y,'ofo')]
+from ['foofoo'] as x, ['barbar'] as y;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/position/position.1.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/position/offset0/position0/position0.1.query.sqlpp
similarity index 87%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/position/position.1.query.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/position/offset0/position0/position0.1.query.sqlpp
index d8afe59..b46b177 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/position/position.1.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/position/offset0/position0/position0.1.query.sqlpp
@@ -17,7 +17,6 @@
* under the License.
*/
-select element [position(x,'ofo'), position(y,'ofo')]
-from ['foofoo'] as x,
- ['barbar'] as y
-;
+// position0 alias
+select element [position0(x, 'ofo'), position0(y,'ofo')]
+from ['foofoo'] as x, ['barbar'] as y;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/position/offset1/pos1/pos1.1.query.sqlpp
similarity index 88%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.4.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/position/offset1/pos1/pos1.1.query.sqlpp
index de3d809..24a2333 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.4.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/position/offset1/pos1/pos1.1.query.sqlpp
@@ -16,7 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
-
-USE test;
-
-FROM ds SELECT VALUE regexp_like(test_str, pattern) ORDER BY id;
\ No newline at end of file
+// pos1 alias
+select value [
+ pos1('abcdefg','ab'),
+ pos1('abcdefg','de'),
+ pos1('abc', 'de')
+];
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/position/position.1.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/position/offset1/position1/position1.1.query.sqlpp
similarity index 86%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/position/position.1.query.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/position/offset1/position1/position1.1.query.sqlpp
index 8f321c4..acdffd1 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/position/position.1.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/position/offset1/position1/position1.1.query.sqlpp
@@ -17,11 +17,9 @@
* under the License.
*/
-/* String offset is set to 1 */
-
+// position1 and pos1 alias
select value [
- position('abcdefg','ab'),
- position('abcdefg','de'),
- position('abc', 'de')
-]
-;
+ position1('abcdefg','ab'),
+ position1('abcdefg','de'),
+ position1('abc', 'de')
+];
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/contains_regex/contains_regex.1.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.1.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/contains_regex/contains_regex.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/contains_regex/contains_regex.2.update.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.2.update.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/contains_regex/contains_regex.2.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/contains_regex/contains_regex.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/contains_regex/contains_regex.3.query.sqlpp
new file mode 100644
index 0000000..59e468c
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/contains_regex/contains_regex.3.query.sqlpp
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ */
+
+// contains_regex alias
+select element a
+from [
+ CONTAINS_REGEX('mnop','.'),
+ CONTAINS_REGEX('abcdefABCDEF','/d'),
+ CONTAINS_REGEX('12345','\\d'),
+ CONTAINS_REGEX('abcdefGHIJK','\\D'),
+ CONTAINS_REGEX(' ','\\s'),
+ CONTAINS_REGEX(' ','\\S'),
+ CONTAINS_REGEX('Welcome to pattern matching!','[a-zA-Z_0-9]'),
+ CONTAINS_REGEX('!@#$%^&*()','[a-zA-Z_0-9]'),
+ CONTAINS_REGEX('!@#$%^&*()','[^\\W]'),
+ CONTAINS_REGEX('!@#$%^&*','[^\\w]'),
+ CONTAINS_REGEX('0xffff','[\\p{XDigit}]'),
+ CONTAINS_REGEX('FFFFFFFF','[\\p{XDigit}]'),
+ CONTAINS_REGEX('abcdefgh','[\\p{javaLowerCase}]'),
+ CONTAINS_REGEX('ABCDEF','[\\p{javaLowerCase}]'),
+ CONTAINS_REGEX(`codepoint-to-string`([163]),'[\\p{Sc}]')
+ ] as a
+;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/contains_regex/contains_regex.4.query.sqlpp
similarity index 89%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/contains_regex/contains_regex.4.query.sqlpp
index 7bd4fad..1c3738b 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/contains_regex/contains_regex.4.query.sqlpp
@@ -17,6 +17,7 @@
* under the License.
*/
+// contains_regex alias
USE test;
-FROM ds SELECT VALUE regexp_position(test_str, pattern) ORDER BY id;
\ No newline at end of file
+FROM ds SELECT VALUE contains_regex(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_contains/regexp_contains.5.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/contains_regex/contains_regex.5.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.5.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/contains_regex/contains_regex.5.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/contains_regexp/contains_regexp.1.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.1.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/contains_regexp/contains_regexp.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/contains_regexp/contains_regexp.2.update.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.2.update.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/contains_regexp/contains_regexp.2.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/contains_regexp/contains_regexp.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/contains_regexp/contains_regexp.3.query.sqlpp
new file mode 100644
index 0000000..31e2f39
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/contains_regexp/contains_regexp.3.query.sqlpp
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ */
+
+// contains_regexp alias
+select element a
+from [
+ CONTAINS_REGEXP('mnop','.'),
+ CONTAINS_REGEXP('abcdefABCDEF','/d'),
+ CONTAINS_REGEXP('12345','\\d'),
+ CONTAINS_REGEXP('abcdefGHIJK','\\D'),
+ CONTAINS_REGEXP(' ','\\s'),
+ CONTAINS_REGEXP(' ','\\S'),
+ CONTAINS_REGEXP('Welcome to pattern matching!','[a-zA-Z_0-9]'),
+ CONTAINS_REGEXP('!@#$%^&*()','[a-zA-Z_0-9]'),
+ CONTAINS_REGEXP('!@#$%^&*()','[^\\W]'),
+ CONTAINS_REGEXP('!@#$%^&*','[^\\w]'),
+ CONTAINS_REGEXP('0xffff','[\\p{XDigit}]'),
+ CONTAINS_REGEXP('FFFFFFFF','[\\p{XDigit}]'),
+ CONTAINS_REGEXP('abcdefgh','[\\p{javaLowerCase}]'),
+ CONTAINS_REGEXP('ABCDEF','[\\p{javaLowerCase}]'),
+ CONTAINS_REGEXP(`codepoint-to-string`([163]),'[\\p{Sc}]')
+ ] as a
+;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/contains_regexp/contains_regexp.4.query.sqlpp
similarity index 89%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/contains_regexp/contains_regexp.4.query.sqlpp
index 7bd4fad..30570c0 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/contains_regexp/contains_regexp.4.query.sqlpp
@@ -17,6 +17,7 @@
* under the License.
*/
+// contains_regexp alias
USE test;
-FROM ds SELECT VALUE regexp_position(test_str, pattern) ORDER BY id;
\ No newline at end of file
+FROM ds SELECT VALUE contains_regexp(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_contains/regexp_contains.5.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/contains_regexp/contains_regexp.5.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.5.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/contains_regexp/contains_regexp.5.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regex_contains/regex_contains.1.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.1.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regex_contains/regex_contains.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regex_contains/regex_contains.2.update.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.2.update.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regex_contains/regex_contains.2.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regex_contains/regex_contains.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regex_contains/regex_contains.3.query.sqlpp
new file mode 100644
index 0000000..ae6931e
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regex_contains/regex_contains.3.query.sqlpp
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ */
+
+// regex_contains alias
+select element a
+from [
+ REGEX_CONTAINS('mnop','.'),
+ REGEX_CONTAINS('abcdefABCDEF','/d'),
+ REGEX_CONTAINS('12345','\\d'),
+ REGEX_CONTAINS('abcdefGHIJK','\\D'),
+ REGEX_CONTAINS(' ','\\s'),
+ REGEX_CONTAINS(' ','\\S'),
+ REGEX_CONTAINS('Welcome to pattern matching!','[a-zA-Z_0-9]'),
+ REGEX_CONTAINS('!@#$%^&*()','[a-zA-Z_0-9]'),
+ REGEX_CONTAINS('!@#$%^&*()','[^\\W]'),
+ REGEX_CONTAINS('!@#$%^&*','[^\\w]'),
+ REGEX_CONTAINS('0xffff','[\\p{XDigit}]'),
+ REGEX_CONTAINS('FFFFFFFF','[\\p{XDigit}]'),
+ REGEX_CONTAINS('abcdefgh','[\\p{javaLowerCase}]'),
+ REGEX_CONTAINS('ABCDEF','[\\p{javaLowerCase}]'),
+ REGEX_CONTAINS(`codepoint-to-string`([163]),'[\\p{Sc}]')
+ ] as a
+;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regex_contains/regex_contains.4.query.sqlpp
similarity index 89%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regex_contains/regex_contains.4.query.sqlpp
index 7bd4fad..f845d11 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regex_contains/regex_contains.4.query.sqlpp
@@ -17,6 +17,7 @@
* under the License.
*/
+// regex_contains alias
USE test;
-FROM ds SELECT VALUE regexp_position(test_str, pattern) ORDER BY id;
\ No newline at end of file
+FROM ds SELECT VALUE regex_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_contains/regexp_contains.5.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regex_contains/regex_contains.5.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.5.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regex_contains/regex_contains.5.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains/regexp_contains.1.ddl.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.1.ddl.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains/regexp_contains.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains/regexp_contains.2.update.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.2.update.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains/regexp_contains.2.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains/regexp_contains.3.query.sqlpp
similarity index 98%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.3.query.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains/regexp_contains.3.query.sqlpp
index a639365..da6968a 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains/regexp_contains.3.query.sqlpp
@@ -17,7 +17,7 @@
* under the License.
*/
-
+// regex_contains function
select element a
from [
REGEXP_CONTAINS('mnop','.'),
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains/regexp_contains.4.query.sqlpp
similarity index 96%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.4.query.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains/regexp_contains.4.query.sqlpp
index 7090ce4..4e5f40c 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.4.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains/regexp_contains.4.query.sqlpp
@@ -17,6 +17,7 @@
* under the License.
*/
+// regex_contains function
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_contains/regexp_contains.5.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains/regexp_contains.5.ddl.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains.5.ddl.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains/regexp_contains/regexp_contains.5.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/contains_regex_with_flag/contains_regex_with_flag.1.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag.1.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/contains_regex_with_flag/contains_regex_with_flag.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/contains_regex_with_flag/contains_regex_with_flag.2.update.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag.2.update.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/contains_regex_with_flag/contains_regex_with_flag.2.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/contains_regex_with_flag/contains_regex_with_flag.3.query.sqlpp
similarity index 90%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/contains_regex_with_flag/contains_regex_with_flag.3.query.sqlpp
index 6568d06..3fdc250 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/contains_regex_with_flag/contains_regex_with_flag.3.query.sqlpp
@@ -17,4 +17,5 @@
* under the License.
*/
-{'result1': REGEXP_POSITION('helloworld','hello world','x')};
+// contains_regex alias
+{'result1': CONTAINS_REGEX('helloworld','hello world','x')};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/contains_regex_with_flag/contains_regex_with_flag.4.query.sqlpp
similarity index 88%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/contains_regex_with_flag/contains_regex_with_flag.4.query.sqlpp
index 7bd4fad..eedbf1b 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/contains_regex_with_flag/contains_regex_with_flag.4.query.sqlpp
@@ -17,6 +17,7 @@
* under the License.
*/
+// contains_regex alias
USE test;
-FROM ds SELECT VALUE regexp_position(test_str, pattern) ORDER BY id;
\ No newline at end of file
+FROM ds SELECT VALUE contains_regex(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_contains_with_flag/regexp_contains_with_flags.5.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/contains_regex_with_flag/contains_regex_with_flags.5.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flags.5.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/contains_regex_with_flag/contains_regex_with_flags.5.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/contains_regexp_with_flag/contains_regexp_with_flag.1.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag.1.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/contains_regexp_with_flag/contains_regexp_with_flag.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/contains_regexp_with_flag/contains_regexp_with_flag.2.update.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag.2.update.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/contains_regexp_with_flag/contains_regexp_with_flag.2.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/contains_regexp_with_flag/contains_regexp_with_flag.3.query.sqlpp
similarity index 89%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/contains_regexp_with_flag/contains_regexp_with_flag.3.query.sqlpp
index 6568d06..e5083c5 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/contains_regexp_with_flag/contains_regexp_with_flag.3.query.sqlpp
@@ -17,4 +17,5 @@
* under the License.
*/
-{'result1': REGEXP_POSITION('helloworld','hello world','x')};
+// contains_regexp alias
+{'result1': CONTAINS_REGEXP('helloworld','hello world','x')};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/contains_regexp_with_flag/contains_regexp_with_flag.4.query.sqlpp
similarity index 89%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.4.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/contains_regexp_with_flag/contains_regexp_with_flag.4.query.sqlpp
index 48c7aac..d3d149b 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.4.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/contains_regexp_with_flag/contains_regexp_with_flag.4.query.sqlpp
@@ -17,6 +17,7 @@
* under the License.
*/
+// contains_regexp alias
USE test;
-FROM ds SELECT VALUE regexp_position(test_str, pattern, flags) ORDER BY id;
\ No newline at end of file
+FROM ds SELECT VALUE contains_regexp(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_contains_with_flag/regexp_contains_with_flags.5.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/contains_regexp_with_flag/contains_regexp_with_flags.5.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flags.5.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/contains_regexp_with_flag/contains_regexp_with_flags.5.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regex_contains_with_flag/regex_contains_with_flag.1.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag.1.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regex_contains_with_flag/regex_contains_with_flag.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regex_contains_with_flag/regex_contains_with_flag.2.update.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag.2.update.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regex_contains_with_flag/regex_contains_with_flag.2.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regex_contains_with_flag/regex_contains_with_flag.3.query.sqlpp
similarity index 90%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regex_contains_with_flag/regex_contains_with_flag.3.query.sqlpp
index 6568d06..0e85b64 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regex_contains_with_flag/regex_contains_with_flag.3.query.sqlpp
@@ -17,4 +17,5 @@
* under the License.
*/
-{'result1': REGEXP_POSITION('helloworld','hello world','x')};
+// regex_contains alias
+{'result1': REGEX_CONTAINS('helloworld','hello world','x')};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regex_contains_with_flag/regex_contains_with_flag.4.query.sqlpp
similarity index 89%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag.4.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regex_contains_with_flag/regex_contains_with_flag.4.query.sqlpp
index 199d20f..1c200c9 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag.4.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regex_contains_with_flag/regex_contains_with_flag.4.query.sqlpp
@@ -17,6 +17,7 @@
* under the License.
*/
+// regex_contains alias
USE test;
-FROM ds SELECT VALUE regexp_contains(test_str, pattern, flags) ORDER BY id;
\ No newline at end of file
+FROM ds SELECT VALUE regex_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_contains_with_flag/regexp_contains_with_flags.5.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regex_contains_with_flag/regex_contains_with_flags.5.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flags.5.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regex_contains_with_flag/regex_contains_with_flags.5.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag/regexp_contains_with_flag.1.ddl.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag.1.ddl.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag/regexp_contains_with_flag.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag/regexp_contains_with_flag.2.update.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag.2.update.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag/regexp_contains_with_flag.2.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag/regexp_contains_with_flag.3.query.sqlpp
similarity index 96%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag.3.query.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag/regexp_contains_with_flag.3.query.sqlpp
index 0836054..339f744 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag/regexp_contains_with_flag.3.query.sqlpp
@@ -17,4 +17,5 @@
* under the License.
*/
+// regex_contains function
{'result1': REGEXP_CONTAINS('helloworld','hello world','x')};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag/regexp_contains_with_flag.4.query.sqlpp
similarity index 96%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag.4.query.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag/regexp_contains_with_flag.4.query.sqlpp
index 199d20f..d0e2971 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag.4.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag/regexp_contains_with_flag.4.query.sqlpp
@@ -17,6 +17,7 @@
* under the License.
*/
+// regex_contains function
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_contains_with_flag/regexp_contains_with_flags.5.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag/regexp_contains_with_flags.5.ddl.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flags.5.ddl.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_contains_with_flag/regexp_contains_with_flag/regexp_contains_with_flags.5.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regex_like/regex_like.1.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.1.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regex_like/regex_like.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regex_like/regex_like.2.update.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.2.update.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regex_like/regex_like.2.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regex_like/regex_like.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regex_like/regex_like.3.query.sqlpp
new file mode 100644
index 0000000..ff6e9f2
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regex_like/regex_like.3.query.sqlpp
@@ -0,0 +1,41 @@
+/*
+ * 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.
+ */
+
+// regex_like alias
+select element a
+from [
+ REGEX_LIKE('mnop','.'),
+ REGEX_LIKE('abcdefABCDEF','/d'),
+ REGEX_LIKE('12345','\\d'),
+ REGEX_LIKE('abcdefGHIJK','\\D'),
+ REGEX_LIKE(' ','\\s'),
+ REGEX_LIKE(' ','\\S'),
+ REGEX_LIKE('Welcome to pattern matching!','[a-zA-Z_0-9]'),
+ REGEX_LIKE('!@#$%^&*()','[a-zA-Z_0-9]'),
+ REGEX_LIKE('!@#$%^&*()','[^\\W]'),
+ REGEX_LIKE('!@#$%^&*','[^\\w]'),
+ REGEX_LIKE('0xffff','[\\p{XDigit}]'),
+ REGEX_LIKE('FFFFFFFF','[\\p{XDigit}]'),
+ REGEX_LIKE('abcdefgh','[\\p{javaLowerCase}]'),
+ REGEX_LIKE('ABCDEF','[\\p{javaLowerCase}]'),
+ REGEX_LIKE(`codepoint-to-string`([163]),'[\\p{Sc}]'),
+ REGEX_LIKE('Steven','Ste(v|ph)en'),
+ REGEX_LIKE('Stephen','.*(v|ph)*')
+ ] as a
+;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regex_like/regex_like.4.query.sqlpp
similarity index 90%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regex_like/regex_like.4.query.sqlpp
index 7bd4fad..9e2cd56 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regex_like/regex_like.4.query.sqlpp
@@ -17,6 +17,7 @@
* under the License.
*/
+// regex_like alias
USE test;
-FROM ds SELECT VALUE regexp_position(test_str, pattern) ORDER BY id;
\ No newline at end of file
+FROM ds SELECT VALUE regex_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_like/regexp_like.5.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regex_like/regex_like.5.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.5.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regex_like/regex_like.5.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like/regexp_like.1.ddl.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.1.ddl.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like/regexp_like.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like/regexp_like.2.update.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.2.update.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like/regexp_like.2.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like/regexp_like.3.query.sqlpp
similarity index 98%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.3.query.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like/regexp_like.3.query.sqlpp
index eaaacc5..6316697 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like/regexp_like.3.query.sqlpp
@@ -17,7 +17,7 @@
* under the License.
*/
-
+// regexp_like function
select element a
from [
REGEXP_LIKE('mnop','.'),
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like/regexp_like.4.query.sqlpp
similarity index 97%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.4.query.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like/regexp_like.4.query.sqlpp
index de3d809..0c137bb 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.4.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like/regexp_like.4.query.sqlpp
@@ -17,6 +17,7 @@
* under the License.
*/
+// regexp_like function
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_like/regexp_like.5.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like/regexp_like.5.ddl.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.5.ddl.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like/regexp_like.5.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regex_like_with_flag/regex_like_with_flag.1.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag.1.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regex_like_with_flag/regex_like_with_flag.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regex_like_with_flag/regex_like_with_flag.2.update.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag.2.update.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regex_like_with_flag/regex_like_with_flag.2.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regex_like_with_flag/regex_like_with_flag.3.query.sqlpp
similarity index 91%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag.3.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regex_like_with_flag/regex_like_with_flag.3.query.sqlpp
index 91f90a4..256cb4c 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regex_like_with_flag/regex_like_with_flag.3.query.sqlpp
@@ -17,4 +17,5 @@
* under the License.
*/
-{'result1': REGEXP_LIKE('helloworld','hello world','x')};
+// regex_like alias
+{'result1': REGEX_LIKE('helloworld','hello world','x')};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regex_like_with_flag/regex_like_with_flag.4.query.sqlpp
similarity index 89%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regex_like_with_flag/regex_like_with_flag.4.query.sqlpp
index 7bd4fad..e0c91b6 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regex_like_with_flag/regex_like_with_flag.4.query.sqlpp
@@ -17,6 +17,7 @@
* under the License.
*/
+// regex_like alias
USE test;
-FROM ds SELECT VALUE regexp_position(test_str, pattern) ORDER BY id;
\ No newline at end of file
+FROM ds SELECT VALUE regex_like(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_like_with_flag/regexp_like_with_flags.5.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regex_like_with_flag/regex_like_with_flags.5.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flags.5.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regex_like_with_flag/regex_like_with_flags.5.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag.4.query.sqlpp
deleted file mode 100644
index 199d20f..0000000
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag.4.query.sqlpp
+++ /dev/null
@@ -1,22 +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.
- */
-
-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_like_with_flag/regexp_like_with_flag.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag/regexp_like_with_flag.1.ddl.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.ddl.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag/regexp_like_with_flag.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag/regexp_like_with_flag.2.update.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag.2.update.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag/regexp_like_with_flag.2.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag/regexp_like_with_flag.3.query.sqlpp
similarity index 97%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag.3.query.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag/regexp_like_with_flag.3.query.sqlpp
index 91f90a4..0c34f4e 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag/regexp_like_with_flag.3.query.sqlpp
@@ -17,4 +17,5 @@
* under the License.
*/
+// regexp_like function
{'result1': REGEXP_LIKE('helloworld','hello world','x')};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag/regexp_like_with_flag.4.query.sqlpp
similarity index 89%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag/regexp_like_with_flag.4.query.sqlpp
index 7bd4fad..ada33bf 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag/regexp_like_with_flag.4.query.sqlpp
@@ -17,6 +17,7 @@
* under the License.
*/
+// regexp_like function
USE test;
-FROM ds SELECT VALUE regexp_position(test_str, pattern) ORDER BY id;
\ No newline at end of file
+FROM ds SELECT VALUE regexp_like(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_like_with_flag/regexp_like_with_flags.5.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag/regexp_like_with_flags.5.ddl.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flags.5.ddl.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag/regexp_like_with_flags.5.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_pos/regex_pos.1.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.1.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_pos/regex_pos.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_pos/regex_pos.2.update.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.2.update.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_pos/regex_pos.2.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_pos/regex_pos.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_pos/regex_pos.3.query.sqlpp
new file mode 100644
index 0000000..0be9b7b
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_pos/regex_pos.3.query.sqlpp
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ */
+
+// regex_pos alias
+select element a
+from [
+ REGEX_POS('mnop','.'),
+ REGEX_POS('abcdefABCDEF','/d'),
+ REGEX_POS('12345','\\d'),
+ REGEX_POS('abcdefGHIJK','\\D'),
+ REGEX_POS(' ','\\s'),
+ REGEX_POS(' ','\\S'),
+ REGEX_POS('Welcome to pattern matching!','[a-zA-Z_0-9]'),
+ REGEX_POS('!@#$%^&*()','[a-zA-Z_0-9]'),
+ REGEX_POS('!@#$%^&*()','[^\\W]'),
+ REGEX_POS('!@#$%^&*','[^\\w]'),
+ REGEX_POS('0xffff','[\\p{XDigit}]'),
+ REGEX_POS('FFFFFFFF','[\\p{XDigit}]'),
+ REGEX_POS('abcdefgh','[\\p{javaLowerCase}]'),
+ REGEX_POS('ABCDEF','[\\p{javaLowerCase}]'),
+ REGEX_POS(`codepoint-to-string`([163]),'[\\p{Sc}]')
+ ] as a
+;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_pos/regex_pos.4.query.sqlpp
similarity index 90%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_pos/regex_pos.4.query.sqlpp
index 7bd4fad..611f8ad 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_pos/regex_pos.4.query.sqlpp
@@ -17,6 +17,7 @@
* under the License.
*/
+// regex_pos alias
USE test;
-FROM ds SELECT VALUE regexp_position(test_str, pattern) ORDER BY id;
\ No newline at end of file
+FROM ds SELECT VALUE regex_pos(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_like/regexp_like.5.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_pos/regex_pos.5.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.5.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_pos/regex_pos.5.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_pos0/regex_pos0.1.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.1.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_pos0/regex_pos0.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_pos0/regex_pos0.2.update.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.2.update.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_pos0/regex_pos0.2.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_pos0/regex_pos0.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_pos0/regex_pos0.3.query.sqlpp
new file mode 100644
index 0000000..99189aa
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_pos0/regex_pos0.3.query.sqlpp
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ */
+
+// regex_pos0 alias
+select element a
+from [
+ REGEX_POS0('mnop','.'),
+ REGEX_POS0('abcdefABCDEF','/d'),
+ REGEX_POS0('12345','\\d'),
+ REGEX_POS0('abcdefGHIJK','\\D'),
+ REGEX_POS0(' ','\\s'),
+ REGEX_POS0(' ','\\S'),
+ REGEX_POS0('Welcome to pattern matching!','[a-zA-Z_0-9]'),
+ REGEX_POS0('!@#$%^&*()','[a-zA-Z_0-9]'),
+ REGEX_POS0('!@#$%^&*()','[^\\W]'),
+ REGEX_POS0('!@#$%^&*','[^\\w]'),
+ REGEX_POS0('0xffff','[\\p{XDigit}]'),
+ REGEX_POS0('FFFFFFFF','[\\p{XDigit}]'),
+ REGEX_POS0('abcdefgh','[\\p{javaLowerCase}]'),
+ REGEX_POS0('ABCDEF','[\\p{javaLowerCase}]'),
+ REGEX_POS0(`codepoint-to-string`([163]),'[\\p{Sc}]')
+ ] as a
+;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_pos0/regex_pos0.4.query.sqlpp
similarity index 90%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_pos0/regex_pos0.4.query.sqlpp
index 7bd4fad..3371f9e 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_pos0/regex_pos0.4.query.sqlpp
@@ -17,6 +17,7 @@
* under the License.
*/
+// regex_pos0 alias
USE test;
-FROM ds SELECT VALUE regexp_position(test_str, pattern) ORDER BY id;
\ No newline at end of file
+FROM ds SELECT VALUE regex_pos0(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_like/regexp_like.5.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_pos0/regex_pos0.5.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.5.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_pos0/regex_pos0.5.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_position/regex_position.1.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.1.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_position/regex_position.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_position/regex_position.2.update.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.2.update.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_position/regex_position.2.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_position/regex_position.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_position/regex_position.3.query.sqlpp
new file mode 100644
index 0000000..4385a13
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_position/regex_position.3.query.sqlpp
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ */
+
+// regex_position alias
+select element a
+from [
+ REGEX_POSITION('mnop','.'),
+ REGEX_POSITION('abcdefABCDEF','/d'),
+ REGEX_POSITION('12345','\\d'),
+ REGEX_POSITION('abcdefGHIJK','\\D'),
+ REGEX_POSITION(' ','\\s'),
+ REGEX_POSITION(' ','\\S'),
+ REGEX_POSITION('Welcome to pattern matching!','[a-zA-Z_0-9]'),
+ REGEX_POSITION('!@#$%^&*()','[a-zA-Z_0-9]'),
+ REGEX_POSITION('!@#$%^&*()','[^\\W]'),
+ REGEX_POSITION('!@#$%^&*','[^\\w]'),
+ REGEX_POSITION('0xffff','[\\p{XDigit}]'),
+ REGEX_POSITION('FFFFFFFF','[\\p{XDigit}]'),
+ REGEX_POSITION('abcdefgh','[\\p{javaLowerCase}]'),
+ REGEX_POSITION('ABCDEF','[\\p{javaLowerCase}]'),
+ REGEX_POSITION(`codepoint-to-string`([163]),'[\\p{Sc}]')
+ ] as a
+;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_position/regex_position.4.query.sqlpp
similarity index 89%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_position/regex_position.4.query.sqlpp
index 7bd4fad..b394e98 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_position/regex_position.4.query.sqlpp
@@ -17,6 +17,7 @@
* under the License.
*/
+// regex_position alias
USE test;
-FROM ds SELECT VALUE regexp_position(test_str, pattern) ORDER BY id;
\ No newline at end of file
+FROM ds SELECT VALUE regex_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_position/regexp_position.5.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_position/regex_position.5.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.5.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_position/regex_position.5.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_position0/regex_position0.1.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.1.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_position0/regex_position0.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_position0/regex_position0.2.update.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.2.update.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_position0/regex_position0.2.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_position0/regex_position0.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_position0/regex_position0.3.query.sqlpp
new file mode 100644
index 0000000..888683a
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_position0/regex_position0.3.query.sqlpp
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ */
+
+// regex_position0 alias
+select element a
+from [
+ REGEX_POSITION0('mnop','.'),
+ REGEX_POSITION0('abcdefABCDEF','/d'),
+ REGEX_POSITION0('12345','\\d'),
+ REGEX_POSITION0('abcdefGHIJK','\\D'),
+ REGEX_POSITION0(' ','\\s'),
+ REGEX_POSITION0(' ','\\S'),
+ REGEX_POSITION0('Welcome to pattern matching!','[a-zA-Z_0-9]'),
+ REGEX_POSITION0('!@#$%^&*()','[a-zA-Z_0-9]'),
+ REGEX_POSITION0('!@#$%^&*()','[^\\W]'),
+ REGEX_POSITION0('!@#$%^&*','[^\\w]'),
+ REGEX_POSITION0('0xffff','[\\p{XDigit}]'),
+ REGEX_POSITION0('FFFFFFFF','[\\p{XDigit}]'),
+ REGEX_POSITION0('abcdefgh','[\\p{javaLowerCase}]'),
+ REGEX_POSITION0('ABCDEF','[\\p{javaLowerCase}]'),
+ REGEX_POSITION0(`codepoint-to-string`([163]),'[\\p{Sc}]')
+ ] as a
+;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_position0/regex_position0.4.query.sqlpp
similarity index 89%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_position0/regex_position0.4.query.sqlpp
index 7bd4fad..648a7ad1 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_position0/regex_position0.4.query.sqlpp
@@ -17,6 +17,7 @@
* under the License.
*/
+// regex_position0 alias
USE test;
-FROM ds SELECT VALUE regexp_position(test_str, pattern) ORDER BY id;
\ No newline at end of file
+FROM ds SELECT VALUE regex_position0(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_position/regexp_position.5.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_position0/regex_position0.5.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.5.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regex_position0/regex_position0.5.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_pos/regexp_pos.1.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.1.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_pos/regexp_pos.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_pos/regexp_pos.2.update.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.2.update.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_pos/regexp_pos.2.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_pos/regexp_pos.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_pos/regexp_pos.3.query.sqlpp
new file mode 100644
index 0000000..7780940
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_pos/regexp_pos.3.query.sqlpp
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ */
+
+// regexp_pos alias
+select element a
+from [
+ REGEXP_POS('mnop','.'),
+ REGEXP_POS('abcdefABCDEF','/d'),
+ REGEXP_POS('12345','\\d'),
+ REGEXP_POS('abcdefGHIJK','\\D'),
+ REGEXP_POS(' ','\\s'),
+ REGEXP_POS(' ','\\S'),
+ REGEXP_POS('Welcome to pattern matching!','[a-zA-Z_0-9]'),
+ REGEXP_POS('!@#$%^&*()','[a-zA-Z_0-9]'),
+ REGEXP_POS('!@#$%^&*()','[^\\W]'),
+ REGEXP_POS('!@#$%^&*','[^\\w]'),
+ REGEXP_POS('0xffff','[\\p{XDigit}]'),
+ REGEXP_POS('FFFFFFFF','[\\p{XDigit}]'),
+ REGEXP_POS('abcdefgh','[\\p{javaLowerCase}]'),
+ REGEXP_POS('ABCDEF','[\\p{javaLowerCase}]'),
+ REGEXP_POS(`codepoint-to-string`([163]),'[\\p{Sc}]')
+ ] as a
+;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_pos/regexp_pos.4.query.sqlpp
similarity index 90%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_pos/regexp_pos.4.query.sqlpp
index 7bd4fad..b1a0c23 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_pos/regexp_pos.4.query.sqlpp
@@ -17,6 +17,7 @@
* under the License.
*/
+// regexp_pos alias
USE test;
-FROM ds SELECT VALUE regexp_position(test_str, pattern) ORDER BY id;
\ No newline at end of file
+FROM ds SELECT VALUE regexp_pos(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_like/regexp_like.5.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_pos/regexp_pos.5.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.5.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_pos/regexp_pos.5.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_pos0/regexp_pos0.1.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.1.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_pos0/regexp_pos0.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_pos0/regexp_pos0.2.update.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.2.update.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_pos0/regexp_pos0.2.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_pos0/regexp_pos0.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_pos0/regexp_pos0.3.query.sqlpp
new file mode 100644
index 0000000..cd8cde2
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_pos0/regexp_pos0.3.query.sqlpp
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ */
+
+// regexp_pos0 alias
+select element a
+from [
+ REGEXP_POS0('mnop','.'),
+ REGEXP_POS0('abcdefABCDEF','/d'),
+ REGEXP_POS0('12345','\\d'),
+ REGEXP_POS0('abcdefGHIJK','\\D'),
+ REGEXP_POS0(' ','\\s'),
+ REGEXP_POS0(' ','\\S'),
+ REGEXP_POS0('Welcome to pattern matching!','[a-zA-Z_0-9]'),
+ REGEXP_POS0('!@#$%^&*()','[a-zA-Z_0-9]'),
+ REGEXP_POS0('!@#$%^&*()','[^\\W]'),
+ REGEXP_POS0('!@#$%^&*','[^\\w]'),
+ REGEXP_POS0('0xffff','[\\p{XDigit}]'),
+ REGEXP_POS0('FFFFFFFF','[\\p{XDigit}]'),
+ REGEXP_POS0('abcdefgh','[\\p{javaLowerCase}]'),
+ REGEXP_POS0('ABCDEF','[\\p{javaLowerCase}]'),
+ REGEXP_POS0(`codepoint-to-string`([163]),'[\\p{Sc}]')
+ ] as a
+;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_pos0/regexp_pos0.4.query.sqlpp
similarity index 90%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_pos0/regexp_pos0.4.query.sqlpp
index 7bd4fad..2e647fa 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_pos0/regexp_pos0.4.query.sqlpp
@@ -17,6 +17,7 @@
* under the License.
*/
+// regexp_pos0 alias
USE test;
-FROM ds SELECT VALUE regexp_position(test_str, pattern) ORDER BY id;
\ No newline at end of file
+FROM ds SELECT VALUE regexp_pos0(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_like/regexp_like.5.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_pos0/regexp_pos0.5.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like/regexp_like.5.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_pos0/regexp_pos0.5.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_position/regexp_position.1.ddl.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.1.ddl.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_position/regexp_position.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_position/regexp_position.2.update.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.2.update.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_position/regexp_position.2.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_position/regexp_position.3.query.sqlpp
similarity index 94%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.3.query.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_position/regexp_position.3.query.sqlpp
index 41b4489..1faefe9 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_position/regexp_position.3.query.sqlpp
@@ -17,7 +17,8 @@
* under the License.
*/
-
+// regexp_position function
+// regex_pos, regex_position, regex_pos0, regex_position0
select element a
from [
REGEXP_POSITION('mnop','.'),
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_position/regexp_position.4.query.sqlpp
similarity index 96%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_position/regexp_position.4.query.sqlpp
index 7bd4fad..b4469db 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_position/regexp_position.4.query.sqlpp
@@ -17,6 +17,7 @@
* under the License.
*/
+// regexp_position function
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_position/regexp_position.5.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_position/regexp_position.5.ddl.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.5.ddl.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_position/regexp_position.5.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_position0/regexp_position0.1.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.1.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_position0/regexp_position0.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_position0/regexp_position0.2.update.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.2.update.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_position0/regexp_position0.2.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_position0/regexp_position0.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_position0/regexp_position0.3.query.sqlpp
new file mode 100644
index 0000000..996fba0
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_position0/regexp_position0.3.query.sqlpp
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ */
+
+// regexp_position0 alias
+select element a
+from [
+ REGEXP_POSITION0('mnop','.'),
+ REGEXP_POSITION0('abcdefABCDEF','/d'),
+ REGEXP_POSITION0('12345','\\d'),
+ REGEXP_POSITION0('abcdefGHIJK','\\D'),
+ REGEXP_POSITION0(' ','\\s'),
+ REGEXP_POSITION0(' ','\\S'),
+ REGEXP_POSITION0('Welcome to pattern matching!','[a-zA-Z_0-9]'),
+ REGEXP_POSITION0('!@#$%^&*()','[a-zA-Z_0-9]'),
+ REGEXP_POSITION0('!@#$%^&*()','[^\\W]'),
+ REGEXP_POSITION0('!@#$%^&*','[^\\w]'),
+ REGEXP_POSITION0('0xffff','[\\p{XDigit}]'),
+ REGEXP_POSITION0('FFFFFFFF','[\\p{XDigit}]'),
+ REGEXP_POSITION0('abcdefgh','[\\p{javaLowerCase}]'),
+ REGEXP_POSITION0('ABCDEF','[\\p{javaLowerCase}]'),
+ REGEXP_POSITION0(`codepoint-to-string`([163]),'[\\p{Sc}]')
+ ] as a
+;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_position0/regexp_position0.4.query.sqlpp
similarity index 89%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_position0/regexp_position0.4.query.sqlpp
index 7bd4fad..16d64b5 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_position0/regexp_position0.4.query.sqlpp
@@ -17,6 +17,7 @@
* under the License.
*/
+// regexp_position0 alias
USE test;
-FROM ds SELECT VALUE regexp_position(test_str, pattern) ORDER BY id;
\ No newline at end of file
+FROM ds SELECT VALUE regexp_position0(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_position/regexp_position.5.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_position0/regexp_position0.5.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.5.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset0/regexp_position0/regexp_position0.5.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/regexp_position_with_flag/regexp_position_with_flag.1.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset1/regex_pos1/regex_pos1.1.query.sqlpp
similarity index 84%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/regexp_position_with_flag/regexp_position_with_flag.1.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset1/regex_pos1/regex_pos1.1.query.sqlpp
index ac47eb9..cbeff24 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/regexp_position_with_flag/regexp_position_with_flag.1.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset1/regex_pos1/regex_pos1.1.query.sqlpp
@@ -17,10 +17,10 @@
* under the License.
*/
-/* String offset is set to 1 */
-
+// regex_pos1 alias
select value [
- REGEXP_POSITION('mnop','.','x'),
- REGEXP_POSITION('mnop','p','x'),
- REGEXP_POSITION('abcdefABCDEF','/d','x')
-]
+ REGEX_POS1('mnop','.'),
+ REGEX_POS1('mnop','p'),
+ REGEX_POS1('abcdefABCDEF','/d'),
+ REGEX_POS1('abcdefABCDEF','/d')
+];
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/regexp_position_with_flag/regexp_position_with_flag.1.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset1/regex_position1/regex_position1.1.query.sqlpp
similarity index 82%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/regexp_position_with_flag/regexp_position_with_flag.1.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset1/regex_position1/regex_position1.1.query.sqlpp
index ac47eb9..0156eb0 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/regexp_position_with_flag/regexp_position_with_flag.1.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset1/regex_position1/regex_position1.1.query.sqlpp
@@ -17,10 +17,10 @@
* under the License.
*/
-/* String offset is set to 1 */
-
+// regex_position1 alias
select value [
- REGEXP_POSITION('mnop','.','x'),
- REGEXP_POSITION('mnop','p','x'),
- REGEXP_POSITION('abcdefABCDEF','/d','x')
-]
+ REGEX_POSITION1('mnop','.'),
+ REGEX_POSITION1('mnop','p'),
+ REGEX_POSITION1('abcdefABCDEF','/d'),
+ REGEX_POSITION1('abcdefABCDEF','/d')
+];
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/regexp_position_with_flag/regexp_position_with_flag.1.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset1/regexp_pos1/regexp_pos1.1.query.sqlpp
similarity index 84%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/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/offset1/regexp_pos1/regexp_pos1.1.query.sqlpp
index ac47eb9..7142b7d 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/regexp_position_with_flag/regexp_position_with_flag.1.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset1/regexp_pos1/regexp_pos1.1.query.sqlpp
@@ -17,10 +17,10 @@
* under the License.
*/
-/* String offset is set to 1 */
-
+// regexp_pos1 alias
select value [
- REGEXP_POSITION('mnop','.','x'),
- REGEXP_POSITION('mnop','p','x'),
- REGEXP_POSITION('abcdefABCDEF','/d','x')
-]
+ REGEXP_POS1('mnop','.'),
+ REGEXP_POS1('mnop','p'),
+ REGEXP_POS1('abcdefABCDEF','/d'),
+ REGEXP_POS1('abcdefABCDEF','/d')
+];
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/substring2/substring2.1.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset1/regexp_position1/regexp_position1.1.query.sqlpp
similarity index 81%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/substring2/substring2.1.query.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset1/regexp_position1/regexp_position1.1.query.sqlpp
index 65d10b5..78e6f5e 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/substring2/substring2.1.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/offset1/regexp_position1/regexp_position1.1.query.sqlpp
@@ -17,13 +17,10 @@
* under the License.
*/
-/* String offset is set to 1 */
-
+// regexp_position1 function
select value [
- substring('abcdefg',-1),
- substring('abcdefg',0),
- substring('abcdefg',1),
- substring('abcdefg',2),
- substring('abcdefg',3)
-]
-;
+ REGEXP_POSITION1('mnop','.'),
+ REGEXP_POSITION1('mnop','p'),
+ REGEXP_POSITION1('abcdefABCDEF','/d'),
+ REGEXP_POSITION1('abcdefABCDEF','/d')
+];
\ 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.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_pos0_with_flag/regex_pos0_with_flag.1.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag.1.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_pos0_with_flag/regex_pos0_with_flag.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_pos0_with_flag/regex_pos0_with_flag.2.update.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag.2.update.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_pos0_with_flag/regex_pos0_with_flag.2.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_pos0_with_flag/regex_pos0_with_flag.3.query.sqlpp
similarity index 90%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_pos0_with_flag/regex_pos0_with_flag.3.query.sqlpp
index 6568d06..7928e4c 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_pos0_with_flag/regex_pos0_with_flag.3.query.sqlpp
@@ -17,4 +17,5 @@
* under the License.
*/
-{'result1': REGEXP_POSITION('helloworld','hello world','x')};
+// regex_pos0 alias
+{'result1': REGEX_POS0('helloworld','hello world','x')};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_pos0_with_flag/regex_pos0_with_flag.4.query.sqlpp
similarity index 89%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_pos0_with_flag/regex_pos0_with_flag.4.query.sqlpp
index 7bd4fad..b2a3bd6 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_pos0_with_flag/regex_pos0_with_flag.4.query.sqlpp
@@ -17,6 +17,7 @@
* under the License.
*/
+// regex_pos0 alias
USE test;
-FROM ds SELECT VALUE regexp_position(test_str, pattern) ORDER BY id;
\ No newline at end of file
+FROM ds SELECT VALUE regex_pos0(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_with_flag/regexp_replace_with_flag.5.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_pos0_with_flag/regex_pos0_with_flag.5.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag.5.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_pos0_with_flag/regex_pos0_with_flag.5.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_pos_with_flag/regex_pos_with_flag.1.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag.1.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_pos_with_flag/regex_pos_with_flag.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_pos_with_flag/regex_pos_with_flag.2.update.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag.2.update.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_pos_with_flag/regex_pos_with_flag.2.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_pos_with_flag/regex_pos_with_flag.3.query.sqlpp
similarity index 91%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_pos_with_flag/regex_pos_with_flag.3.query.sqlpp
index 6568d06..0b87998 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_pos_with_flag/regex_pos_with_flag.3.query.sqlpp
@@ -17,4 +17,5 @@
* under the License.
*/
-{'result1': REGEXP_POSITION('helloworld','hello world','x')};
+// regex_pos alias
+{'result1': REGEX_POS('helloworld','hello world','x')};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_pos_with_flag/regex_pos_with_flag.4.query.sqlpp
similarity index 89%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_pos_with_flag/regex_pos_with_flag.4.query.sqlpp
index 7bd4fad..1fbc7dc 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_pos_with_flag/regex_pos_with_flag.4.query.sqlpp
@@ -17,6 +17,7 @@
* under the License.
*/
+// regex_pos alias
USE test;
-FROM ds SELECT VALUE regexp_position(test_str, pattern) ORDER BY id;
\ No newline at end of file
+FROM ds SELECT VALUE regex_pos(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_with_flag/regexp_replace_with_flag.5.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_pos_with_flag/regex_pos_with_flag.5.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag.5.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_pos_with_flag/regex_pos_with_flag.5.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_position0_with_flag/regex_position0_with_flag.1.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.1.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_position0_with_flag/regex_position0_with_flag.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_position0_with_flag/regex_position0_with_flag.2.update.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.2.update.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_position0_with_flag/regex_position0_with_flag.2.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_position0_with_flag/regex_position0_with_flag.3.query.sqlpp
similarity index 89%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_position0_with_flag/regex_position0_with_flag.3.query.sqlpp
index 6568d06..9b67976 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_position0_with_flag/regex_position0_with_flag.3.query.sqlpp
@@ -17,4 +17,5 @@
* under the License.
*/
-{'result1': REGEXP_POSITION('helloworld','hello world','x')};
+// regex_position0 alias
+{'result1': REGEX_POSITION0('helloworld','hello world','x')};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_position0_with_flag/regex_position0_with_flag.4.query.sqlpp
similarity index 89%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.4.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_position0_with_flag/regex_position0_with_flag.4.query.sqlpp
index 48c7aac..27315e9 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.4.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_position0_with_flag/regex_position0_with_flag.4.query.sqlpp
@@ -17,6 +17,7 @@
* under the License.
*/
+// regex_position0 alias
USE test;
-FROM ds SELECT VALUE regexp_position(test_str, pattern, flags) ORDER BY id;
\ No newline at end of file
+FROM ds SELECT VALUE regex_position0(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_with_flag/regexp_replace_with_flag.5.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_position0_with_flag/regex_position0_with_flag.5.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag.5.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_position0_with_flag/regex_position0_with_flag.5.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_position_with_flag/regex_position_with_flag.1.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.1.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_position_with_flag/regex_position_with_flag.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_position_with_flag/regex_position_with_flag.2.update.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.2.update.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_position_with_flag/regex_position_with_flag.2.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_position_with_flag/regex_position_with_flag.3.query.sqlpp
similarity index 90%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_position_with_flag/regex_position_with_flag.3.query.sqlpp
index 6568d06..9514dbc 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_position_with_flag/regex_position_with_flag.3.query.sqlpp
@@ -17,4 +17,5 @@
* under the License.
*/
-{'result1': REGEXP_POSITION('helloworld','hello world','x')};
+// regex_position alias
+{'result1': REGEX_POSITION('helloworld','hello world','x')};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_position_with_flag/regex_position_with_flag.4.query.sqlpp
similarity index 89%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.4.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_position_with_flag/regex_position_with_flag.4.query.sqlpp
index 48c7aac..b1c96ca 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.4.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_position_with_flag/regex_position_with_flag.4.query.sqlpp
@@ -17,6 +17,7 @@
* under the License.
*/
+// regex_position alias
USE test;
-FROM ds SELECT VALUE regexp_position(test_str, pattern, flags) ORDER BY id;
\ No newline at end of file
+FROM ds SELECT VALUE regex_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_position_with_flag/regexp_position_with_flags.5.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_position_with_flag/regex_position_with_flags.5.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flags.5.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regex_position_with_flag/regex_position_with_flags.5.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_pos0_with_flag/regexp_pos0_with_flag.1.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag.1.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_pos0_with_flag/regexp_pos0_with_flag.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_pos0_with_flag/regexp_pos0_with_flag.2.update.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.2.update.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_pos0_with_flag/regexp_pos0_with_flag.2.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_pos0_with_flag/regexp_pos0_with_flag.3.query.sqlpp
similarity index 90%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_pos0_with_flag/regexp_pos0_with_flag.3.query.sqlpp
index 6568d06..7fb4d87 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_pos0_with_flag/regexp_pos0_with_flag.3.query.sqlpp
@@ -17,4 +17,5 @@
* under the License.
*/
-{'result1': REGEXP_POSITION('helloworld','hello world','x')};
+// regexp_pos0 alias
+{'result1': REGEXP_POS0('helloworld','hello world','x')};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_pos0_with_flag/regexp_pos0_with_flag.4.query.sqlpp
similarity index 89%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_pos0_with_flag/regexp_pos0_with_flag.4.query.sqlpp
index 7bd4fad..9df6e69 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_pos0_with_flag/regexp_pos0_with_flag.4.query.sqlpp
@@ -17,6 +17,7 @@
* under the License.
*/
+// regexp_pos0 alias
USE test;
-FROM ds SELECT VALUE regexp_position(test_str, pattern) ORDER BY id;
\ No newline at end of file
+FROM ds SELECT VALUE regexp_pos0(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_position_with_flag/regexp_position_with_flags.5.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_pos0_with_flag/regexp_pos0_with_flags.5.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flags.5.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_pos0_with_flag/regexp_pos0_with_flags.5.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_pos_with_flag/regexp_pos_with_flag.1.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag.1.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_pos_with_flag/regexp_pos_with_flag.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_pos_with_flag/regexp_pos_with_flag.2.update.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flag.2.update.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_pos_with_flag/regexp_pos_with_flag.2.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_pos_with_flag/regexp_pos_with_flag.3.query.sqlpp
similarity index 90%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_pos_with_flag/regexp_pos_with_flag.3.query.sqlpp
index 6568d06..ee7d872 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_pos_with_flag/regexp_pos_with_flag.3.query.sqlpp
@@ -17,4 +17,5 @@
* under the License.
*/
-{'result1': REGEXP_POSITION('helloworld','hello world','x')};
+// regexp_pos alias
+{'result1': REGEXP_POS('helloworld','hello world','x')};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_pos_with_flag/regexp_pos_with_flag.4.query.sqlpp
similarity index 89%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_pos_with_flag/regexp_pos_with_flag.4.query.sqlpp
index 7bd4fad..1900905 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_pos_with_flag/regexp_pos_with_flag.4.query.sqlpp
@@ -17,6 +17,7 @@
* under the License.
*/
+// regexp_pos alias
USE test;
-FROM ds SELECT VALUE regexp_position(test_str, pattern) ORDER BY id;
\ No newline at end of file
+FROM ds SELECT VALUE regexp_pos(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_like_with_flag/regexp_like_with_flags.5.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_pos_with_flag/regexp_pos_with_flags.5.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_like_with_flag/regexp_like_with_flags.5.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_pos_with_flag/regexp_pos_with_flags.5.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_position0_with_flag/regexp_position0_with_flag.1.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.1.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_position0_with_flag/regexp_position0_with_flag.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_position0_with_flag/regexp_position0_with_flag.2.update.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.2.update.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_position0_with_flag/regexp_position0_with_flag.2.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_position0_with_flag/regexp_position0_with_flag.3.query.sqlpp
similarity index 89%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_position0_with_flag/regexp_position0_with_flag.3.query.sqlpp
index 6568d06..6277bbd 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_position0_with_flag/regexp_position0_with_flag.3.query.sqlpp
@@ -17,4 +17,5 @@
* under the License.
*/
-{'result1': REGEXP_POSITION('helloworld','hello world','x')};
+// regexp_position0 alias
+{'result1': REGEXP_POSITION0('helloworld','hello world','x')};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_position0_with_flag/regexp_position0_with_flag.4.query.sqlpp
similarity index 88%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_position0_with_flag/regexp_position0_with_flag.4.query.sqlpp
index 7bd4fad..74018de 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_position0_with_flag/regexp_position0_with_flag.4.query.sqlpp
@@ -17,6 +17,7 @@
* under the License.
*/
+// regexp_position0 alias
USE test;
-FROM ds SELECT VALUE regexp_position(test_str, pattern) ORDER BY id;
\ No newline at end of file
+FROM ds SELECT VALUE regexp_position0(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_position_with_flag/regexp_position_with_flags.5.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_position0_with_flag/regexp_position0_with_flags.5.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flags.5.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_position0_with_flag/regexp_position0_with_flags.5.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_position_with_flag/regexp_position_with_flag.1.ddl.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.ddl.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_position_with_flag/regexp_position_with_flag.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_position_with_flag/regexp_position_with_flag.2.update.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.2.update.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_position_with_flag/regexp_position_with_flag.2.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp
similarity index 96%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp
index 6568d06..46977b8 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp
@@ -17,4 +17,5 @@
* under the License.
*/
+// regexp_position function
{'result1': REGEXP_POSITION('helloworld','hello world','x')};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_position_with_flag/regexp_position_with_flag.4.query.sqlpp
similarity index 96%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.4.query.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_position_with_flag/regexp_position_with_flag.4.query.sqlpp
index 48c7aac..6f7d337 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.4.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_position_with_flag/regexp_position_with_flag.4.query.sqlpp
@@ -17,6 +17,7 @@
* under the License.
*/
+// regexp_position function
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_position_with_flag/regexp_position_with_flags.5.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_position_with_flag/regexp_position_with_flags.5.ddl.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flags.5.ddl.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset0/regexp_position_with_flag/regexp_position_with_flags.5.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/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/offset1/regex_pos1_with_flag/regex_pos1_with_flag.1.query.sqlpp
similarity index 83%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/regexp_position_with_flag/regexp_position_with_flag.1.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset1/regex_pos1_with_flag/regex_pos1_with_flag.1.query.sqlpp
index ac47eb9..81458b9 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/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/offset1/regex_pos1_with_flag/regex_pos1_with_flag.1.query.sqlpp
@@ -17,10 +17,10 @@
* under the License.
*/
-/* String offset is set to 1 */
-
+// regex_pos1 alias
select value [
- REGEXP_POSITION('mnop','.','x'),
- REGEXP_POSITION('mnop','p','x'),
- REGEXP_POSITION('abcdefABCDEF','/d','x')
-]
+ REGEX_POS1('mnop','.','x'),
+ REGEX_POS1('mnop','p','x'),
+ REGEX_POS1('abcdefABCDEF','/d','x'),
+ REGEX_POS1('abcdefABCDEF','/d','x')
+ ];
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/substring2/substring2.1.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset1/regex_position1_with_flag/regex_position1_with_flag.1.query.sqlpp
similarity index 81%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/substring2/substring2.1.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset1/regex_position1_with_flag/regex_position1_with_flag.1.query.sqlpp
index 65d10b5..09876db 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/substring2/substring2.1.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset1/regex_position1_with_flag/regex_position1_with_flag.1.query.sqlpp
@@ -17,13 +17,10 @@
* under the License.
*/
-/* String offset is set to 1 */
-
+// regex_position1 alias
select value [
- substring('abcdefg',-1),
- substring('abcdefg',0),
- substring('abcdefg',1),
- substring('abcdefg',2),
- substring('abcdefg',3)
-]
-;
+ REGEX_POSITION1('mnop','.','x'),
+ REGEX_POSITION1('mnop','p','x'),
+ REGEX_POSITION1('abcdefABCDEF','/d','x'),
+ REGEX_POSITION1('abcdefABCDEF','/d','x')
+ ];
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/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/offset1/regexp_pos1_with_flag/regexp_pos1_with_flag.1.query.sqlpp
similarity index 82%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/regexp_position_with_flag/regexp_position_with_flag.1.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset1/regexp_pos1_with_flag/regexp_pos1_with_flag.1.query.sqlpp
index ac47eb9..0c9ef50 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/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/offset1/regexp_pos1_with_flag/regexp_pos1_with_flag.1.query.sqlpp
@@ -17,10 +17,10 @@
* under the License.
*/
-/* String offset is set to 1 */
-
+// regexp_pos1 alias
select value [
- REGEXP_POSITION('mnop','.','x'),
- REGEXP_POSITION('mnop','p','x'),
- REGEXP_POSITION('abcdefABCDEF','/d','x')
-]
+ REGEXP_POS1('mnop','.','x'),
+ REGEXP_POS1('mnop','p','x'),
+ REGEXP_POS1('abcdefABCDEF','/d','x'),
+ REGEXP_POS1('abcdefABCDEF','/d','x')
+ ];
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/substring2/substring2.1.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset1/regexp_position1_with_flag/regexp_position1_with_flag.1.query.sqlpp
similarity index 80%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/substring2/substring2.1.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset1/regexp_position1_with_flag/regexp_position1_with_flag.1.query.sqlpp
index 65d10b5..d4030e8 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/substring2/substring2.1.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/offset1/regexp_position1_with_flag/regexp_position1_with_flag.1.query.sqlpp
@@ -17,13 +17,10 @@
* under the License.
*/
-/* String offset is set to 1 */
-
+// regexp_position1 function
select value [
- substring('abcdefg',-1),
- substring('abcdefg',0),
- substring('abcdefg',1),
- substring('abcdefg',2),
- substring('abcdefg',3)
-]
-;
+ REGEXP_POSITION1('mnop','.','x'),
+ REGEXP_POSITION1('mnop','p','x'),
+ REGEXP_POSITION1('abcdefABCDEF','/d','x'),
+ REGEXP_POSITION1('abcdefABCDEF','/d','x')
+ ];
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regex_replace/regex_replace.1.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.1.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regex_replace/regex_replace.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regex_replace/regex_replace.2.update.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.update.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regex_replace/regex_replace.2.update.sqlpp
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/regex_replace/regex_replace.3.query.sqlpp
similarity index 77%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.3.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regex_replace/regex_replace.3.query.sqlpp
index efd0084..6885841 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/regex_replace/regex_replace.3.query.sqlpp
@@ -17,11 +17,12 @@
* under the License.
*/
+// regex_replace alias
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','*')
+ regex_replace('abracadabra','a',''),
+ regex_replace('abracadabra','a(.)','a$1$1'),
+ regex_replace('darted','^(.*?)d(.*)$','$1c$2'),
+ regex_replace('abracadabra','bra','*'),
+ regex_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_position/regexp_position.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regex_replace/regex_replace.4.query.sqlpp
similarity index 88%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regex_replace/regex_replace.4.query.sqlpp
index 7bd4fad..afdd088 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position/regexp_position.4.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regex_replace/regex_replace.4.query.sqlpp
@@ -17,6 +17,7 @@
* under the License.
*/
+// regex_replace alias
USE test;
-FROM ds SELECT VALUE regexp_position(test_str, pattern) ORDER BY id;
\ No newline at end of file
+FROM ds SELECT VALUE regex_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.5.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regex_replace/regex_replace.5.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.5.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regex_replace/regex_replace.5.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace/regexp_replace.1.ddl.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.1.ddl.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace/regexp_replace.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace/regexp_replace.2.update.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.2.update.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace/regexp_replace.2.update.sqlpp
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/regexp_replace.3.query.sqlpp
similarity index 97%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.3.query.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace/regexp_replace.3.query.sqlpp
index efd0084..6962526 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/regexp_replace.3.query.sqlpp
@@ -17,6 +17,7 @@
* under the License.
*/
+// regexp_replace function
select element a
from [
regexp_replace('abracadabra','a',''),
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/regexp_replace.4.query.sqlpp
similarity index 96%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.4.query.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace/regexp_replace.4.query.sqlpp
index cbb55de..3a99397 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/regexp_replace.4.query.sqlpp
@@ -17,6 +17,7 @@
* under the License.
*/
+// regexp_replace function
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.5.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace/regexp_replace.5.ddl.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace.5.ddl.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace/regexp_replace/regexp_replace.5.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regex_replace_with_flag/regex_replace_with_flag.1.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag.1.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regex_replace_with_flag/regex_replace_with_flag.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regex_replace_with_flag/regex_replace_with_flag.2.update.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag.2.update.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regex_replace_with_flag/regex_replace_with_flag.2.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regex_replace_with_flag/regex_replace_with_flag.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regex_replace_with_flag/regex_replace_with_flag.3.query.sqlpp
new file mode 100644
index 0000000..a051458
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regex_replace_with_flag/regex_replace_with_flag.3.query.sqlpp
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ */
+
+// regex_replace alias
+select element a
+from [
+ regex_replace('abracadabra','',null,null),
+ regex_replace('abracadabra','bra','XXX',''),
+ regex_replace(null,'hello world','XxXx','x'),
+ regex_replace('abracadabra','bra','XXX',null),
+ regex_replace('abracadabra',null,'XXX',null),
+ regex_replace('abracadabra','Bra',null,'i'),
+ regex_replace('abracadabra','Bra','','i'),
+ regex_replace('abracadabra','','XXX',''),
+ regex_replace('abracadabra','Bra','kkk',''),
+ regex_replace('abracadabra','Bra','kkk','i'),
+ regex_replace('helloworld','hello world','kkk','x'),
+ regex_replace('abracadabra','bra','kkk',-1),
+ regex_replace('abracadabra','bra','kkk',0),
+ regex_replace('abracadabra','bra','kkk',1),
+ regex_replace('abracadabra_abracadabra','bra','kkk',2),
+ regex_replace('abracadabra_abracadabra','bra','kkk',5)
+] as a;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regex_replace_with_flag/regex_replace_with_flag.4.query.sqlpp
similarity index 88%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag.4.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regex_replace_with_flag/regex_replace_with_flag.4.query.sqlpp
index 42eaae7..0355129 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag.4.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regex_replace_with_flag/regex_replace_with_flag.4.query.sqlpp
@@ -17,6 +17,7 @@
* under the License.
*/
+// regex_replace alias
USE test;
-FROM ds SELECT VALUE regexp_replace(test_str, pattern, "REPLACED", flags) ORDER BY id;
\ No newline at end of file
+FROM ds SELECT VALUE regex_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_with_flag/regexp_replace_with_flag.5.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regex_replace_with_flag/regex_replace_with_flag.5.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag.5.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regex_replace_with_flag/regex_replace_with_flag.5.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag/regexp_replace_with_flag.1.ddl.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag.1.ddl.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag/regexp_replace_with_flag.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag/regexp_replace_with_flag.2.update.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag.2.update.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag/regexp_replace_with_flag.2.update.sqlpp
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/regexp_replace_with_flag.3.query.sqlpp
similarity index 98%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag.3.query.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag/regexp_replace_with_flag.3.query.sqlpp
index 90504e5..454debc 100644
--- 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/regexp_replace_with_flag.3.query.sqlpp
@@ -17,6 +17,7 @@
* under the License.
*/
+// regexp_replace function
select element a
from [
regexp_replace('abracadabra','',null,null),
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag.4.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag/regexp_replace_with_flag.4.query.sqlpp
similarity index 96%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag.4.query.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag/regexp_replace_with_flag.4.query.sqlpp
index 42eaae7..de876a5 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag.4.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag/regexp_replace_with_flag.4.query.sqlpp
@@ -17,6 +17,7 @@
* under the License.
*/
+// regexp_replace function
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_with_flag/regexp_replace_with_flag.5.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag/regexp_replace_with_flag.5.ddl.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag.5.ddl.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_replace_with_flag/regexp_replace_with_flag/regexp_replace_with_flag.5.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/offset0/substr/substr.1.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.1.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/offset0/substr/substr.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/offset0/substr/substr.2.update.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.2.update.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/offset0/substr/substr.2.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/offset0/substr/substr.3.query.sqlpp
similarity index 67%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/offset0/substr/substr.3.query.sqlpp
index 6568d06..ad52387 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/offset0/substr/substr.3.query.sqlpp
@@ -17,4 +17,5 @@
* under the License.
*/
-{'result1': REGEXP_POSITION('helloworld','hello world','x')};
+// substr alias
+{'str2':substr('Hello World',9),'str4':substr('This is a test string',20),'str6':substr('This is a test string',21),'str8':substr('This is a test string',0),'str10':substr('This is a test string',-6),'str13':substr(`string-concat`(['This is a test string','This is a another test string']),20),'str14':substr('UC Irvine',(`string-length`('UC Irvine') div 2 - 1))};
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/offset0/substr0/substr0.1.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.1.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/offset0/substr0/substr0.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/offset0/substr0/substr0.2.update.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.2.update.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/offset0/substr0/substr0.2.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/offset0/substr0/substr0.3.query.sqlpp
similarity index 67%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/offset0/substr0/substr0.3.query.sqlpp
index 6568d06..59e99c9 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/regexp_position_with_flag/regexp_position_with_flag.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/offset0/substr0/substr0.3.query.sqlpp
@@ -17,4 +17,5 @@
* under the License.
*/
-{'result1': REGEXP_POSITION('helloworld','hello world','x')};
+// substr0 alias
+{'str2':substr0('Hello World',9),'str4':substr0('This is a test string',20),'str6':substr0('This is a test string',21),'str8':substr0('This is a test string',0),'str10':substr0('This is a test string',-6),'str13':substr0(`string-concat`(['This is a test string','This is a another test string']),20),'str14':substr0('UC Irvine',(`string-length`('UC Irvine') div 2 - 1))};
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/offset0/substring/substring.1.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.1.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/offset0/substring/substring.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/offset0/substring/substring.2.update.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.2.update.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/offset0/substring/substring.2.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/substr01.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/offset0/substring/substring.3.query.sqlpp
similarity index 86%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/substr01.3.query.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/offset0/substring/substring.3.query.sqlpp
index d39e51e..7e99d46 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/substr01.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/offset0/substring/substring.3.query.sqlpp
@@ -16,11 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-/*
- * Testcase Name : substr01.aql
- * Description : Test substring2(string,position) built in function.
- * Success : Yes
- * Date : 18th April 2012
- */
-{'str2':substring('Hello World',9),'str4':substring('This is a test string',20),'str6':substring('This is a test string',21),'str8':substring('This is a test string',0),'str10':substring('This is a test string',-6),'str13':substring(`string-concat`(['This is a test string','This is a another test string']),20),'str14':substring('UC Irvine',(`string-length`('UC Irvine') div 2 - 1))};
+// substring
+{'str2':substring('Hello World',9),'str4':substring('This is a test string',20),'str6':substring('This is a test string',21),'str8':substring('This is a test string',0),'str10':substring('This is a test string',-6),'str13':substring(`string-concat`(['This is a test string','This is a another test string']),20),'str14':substring('UC Irvine',(`string-length`('UC Irvine') div 2 - 1))};
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/offset0/substring0/substring0.1.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.1.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/offset0/substring0/substring0.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/offset0/substring0/substring0.2.update.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.2.update.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/offset0/substring0/substring0.2.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/substring2/substring2.1.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/offset0/substring0/substring0.3.query.sqlpp
similarity index 66%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/substring2/substring2.1.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/offset0/substring0/substring0.3.query.sqlpp
index 65d10b5..1bae41a 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/substring2/substring2.1.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/offset0/substring0/substring0.3.query.sqlpp
@@ -17,13 +17,5 @@
* under the License.
*/
-/* String offset is set to 1 */
-
-select value [
- substring('abcdefg',-1),
- substring('abcdefg',0),
- substring('abcdefg',1),
- substring('abcdefg',2),
- substring('abcdefg',3)
-]
-;
+// substring0 alias
+{'str2':substring0('Hello World',9),'str4':substring0('This is a test string',20),'str6':substring0('This is a test string',21),'str8':substring0('This is a test string',0),'str10':substring0('This is a test string',-6),'str13':substring0(`string-concat`(['This is a test string','This is a another test string']),20),'str14':substring0('UC Irvine',(`string-length`('UC Irvine') div 2 - 1))};
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/regexp_position_with_flag/regexp_position_with_flag.1.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/offset1/substr1/substr1.1.query.sqlpp
similarity index 83%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/regexp_position_with_flag/regexp_position_with_flag.1.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/offset1/substr1/substr1.1.query.sqlpp
index ac47eb9..71bcada 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/regexp_position_with_flag/regexp_position_with_flag.1.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/offset1/substr1/substr1.1.query.sqlpp
@@ -17,10 +17,11 @@
* under the License.
*/
-/* String offset is set to 1 */
-
+// substr1 alias
select value [
- REGEXP_POSITION('mnop','.','x'),
- REGEXP_POSITION('mnop','p','x'),
- REGEXP_POSITION('abcdefABCDEF','/d','x')
-]
+ substr1('abcdefg',-1,2),
+ substr1('abcdefg',0,2),
+ substr1('abcdefg',1,2),
+ substr1('abcdefg',2,2),
+ substr1('abcdefg',3,2)
+];
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/regexp_position_with_flag/regexp_position_with_flag.1.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/offset1/substring1/substring1.1.query.sqlpp
similarity index 82%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/regexp_position_with_flag/regexp_position_with_flag.1.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/offset1/substring1/substring1.1.query.sqlpp
index ac47eb9..4a9854f 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/regexp_position_with_flag/regexp_position_with_flag.1.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/offset1/substring1/substring1.1.query.sqlpp
@@ -17,10 +17,11 @@
* under the License.
*/
-/* String offset is set to 1 */
-
+// substring1
select value [
- REGEXP_POSITION('mnop','.','x'),
- REGEXP_POSITION('mnop','p','x'),
- REGEXP_POSITION('abcdefABCDEF','/d','x')
-]
+ substring1('abcdefg',-1,2),
+ substring1('abcdefg',0,2),
+ substring1('abcdefg',1,2),
+ substring1('abcdefg',2,2),
+ substring1('abcdefg',3,2)
+];
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/substr01.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/substr01.1.ddl.sqlpp
deleted file mode 100644
index 76880bd..0000000
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/substr01.1.ddl.sqlpp
+++ /dev/null
@@ -1,25 +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.
- */
-/*
- * Testcase Name : substr01.aql
- * Description : Test substring2(string,position) built in function.
- * Success : Yes
- * Date : 18th April 2012
- */
-
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/substr01.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/substr01.2.update.sqlpp
deleted file mode 100644
index 76880bd..0000000
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substr01/substr01.2.update.sqlpp
+++ /dev/null
@@ -1,25 +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.
- */
-/*
- * Testcase Name : substr01.aql
- * Description : Test substring2(string,position) built in function.
- * Success : Yes
- * Date : 18th April 2012
- */
-
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset0/substr/substr.1.ddl.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.1.ddl.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset0/substr/substr.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset0/substr/substr.2.update.sqlpp
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.2.update.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset0/substr/substr.2.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset0/substr/substr.3.query.sqlpp
similarity index 94%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.3.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset0/substr/substr.3.query.sqlpp
index fa3b8af..0ffd90b 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset0/substr/substr.3.query.sqlpp
@@ -19,5 +19,4 @@
use test;
-
-{'result1':test.substring('HEllow',1)};
+{'result1':test.substr('HEllow',1)};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset0/substr/substr.4.ddl.sqlpp
similarity index 93%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.3.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset0/substr/substr.4.ddl.sqlpp
index fa3b8af..ddbdccf 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset0/substr/substr.4.ddl.sqlpp
@@ -17,7 +17,5 @@
* under the License.
*/
-use test;
+drop dataverse test;
-
-{'result1':test.substring('HEllow',1)};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset0/substr0/substr0.1.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.1.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset0/substr0/substr0.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset0/substr0/substr0.2.update.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.2.update.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset0/substr0/substr0.2.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset0/substr0/substr0.3.query.sqlpp
similarity index 94%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.3.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset0/substr0/substr0.3.query.sqlpp
index fa3b8af..d79c789 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset0/substr0/substr0.3.query.sqlpp
@@ -19,5 +19,4 @@
use test;
-
-{'result1':test.substring('HEllow',1)};
+{'result1':test.substr0('HEllow',1)};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset0/substr0/substr0.4.ddl.sqlpp
similarity index 93%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.3.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset0/substr0/substr0.4.ddl.sqlpp
index fa3b8af..ddbdccf 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset0/substr0/substr0.4.ddl.sqlpp
@@ -17,7 +17,5 @@
* under the License.
*/
-use test;
+drop dataverse test;
-
-{'result1':test.substring('HEllow',1)};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset0/substring/substring.1.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.1.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset0/substring/substring.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset0/substring/substring.2.update.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.2.update.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset0/substring/substring.2.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset0/substring/substring.3.query.sqlpp
similarity index 99%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.3.query.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset0/substring/substring.3.query.sqlpp
index fa3b8af..a311558 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset0/substring/substring.3.query.sqlpp
@@ -19,5 +19,4 @@
use test;
-
{'result1':test.substring('HEllow',1)};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset0/substring/substring.4.ddl.sqlpp
similarity index 93%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.3.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset0/substring/substring.4.ddl.sqlpp
index fa3b8af..ddbdccf 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset0/substring/substring.4.ddl.sqlpp
@@ -17,7 +17,5 @@
* under the License.
*/
-use test;
+drop dataverse test;
-
-{'result1':test.substring('HEllow',1)};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset0/substring0/substring0.1.ddl.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.1.ddl.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset0/substring0/substring0.1.ddl.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.2.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset0/substring0/substring0.2.update.sqlpp
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.2.update.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset0/substring0/substring0.2.update.sqlpp
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset0/substring0/substring0.3.query.sqlpp
similarity index 94%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.3.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset0/substring0/substring0.3.query.sqlpp
index fa3b8af..289302d 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset0/substring0/substring0.3.query.sqlpp
@@ -19,5 +19,4 @@
use test;
-
-{'result1':test.substring('HEllow',1)};
+{'result1':test.substring0('HEllow',1)};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset0/substring0/substring0.4.ddl.sqlpp
similarity index 93%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.3.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset0/substring0/substring0.4.ddl.sqlpp
index fa3b8af..ddbdccf 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/substring2-1.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset0/substring0/substring0.4.ddl.sqlpp
@@ -17,7 +17,5 @@
* under the License.
*/
-use test;
+drop dataverse test;
-
-{'result1':test.substring('HEllow',1)};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/regexp_position/regexp_position.1.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset1/substr1/substr1.1.query.sqlpp
similarity index 85%
rename from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/regexp_position/regexp_position.1.query.sqlpp
rename to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset1/substr1/substr1.1.query.sqlpp
index 7a27b2f..6f3ea00 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/regexp_position/regexp_position.1.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset1/substr1/substr1.1.query.sqlpp
@@ -17,12 +17,10 @@
* under the License.
*/
-/* String offset is set to 1 */
-
select value [
- REGEXP_POSITION('mnop','.'),
- REGEXP_POSITION('mnop','p'),
- REGEXP_POSITION('abcdefABCDEF','/d')
-]
-
-
+ substr1('abcdefg',-1),
+ substr1('abcdefg',0),
+ substr1('abcdefg',1),
+ substr1('abcdefg',2),
+ substr1('abcdefg',3)
+];
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/regexp_position_with_flag/regexp_position_with_flag.1.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset1/substring1/substring1.1.query.sqlpp
similarity index 84%
copy from asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/regexp_position_with_flag/regexp_position_with_flag.1.query.sqlpp
copy to asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset1/substring1/substring1.1.query.sqlpp
index ac47eb9..5726c08 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/regexp_position_with_flag/regexp_position_with_flag.1.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/string/substring2-1/offset1/substring1/substring1.1.query.sqlpp
@@ -17,10 +17,10 @@
* under the License.
*/
-/* String offset is set to 1 */
-
select value [
- REGEXP_POSITION('mnop','.','x'),
- REGEXP_POSITION('mnop','p','x'),
- REGEXP_POSITION('abcdefABCDEF','/d','x')
-]
+ substring1('abcdefg',-1),
+ substring1('abcdefg',0),
+ substring1('abcdefg',1),
+ substring1('abcdefg',2),
+ substring1('abcdefg',3)
+];
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/findbinary/findbinary.1.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/findbinary/findbinary.1.query.sqlpp
deleted file mode 100644
index 073220f..0000000
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/findbinary/findbinary.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.
- */
-
-/* String offset is set to 1 */
-
-select value [
- find_binary(hex('aabbccddeeffaabbccddeeff'),hex('aabb'),-1),
- find_binary(hex('aabbccddeeffaabbccddeeff'),hex('aabb'),0),
- find_binary(hex('aabbccddeeffaabbccddeeff'),hex('aabb'),1),
- find_binary(hex('aabbccddeeffaabbccddeeff'),hex('aabb'),2),
- find_binary(hex('aabbccddeeffaabbccddeeff'),hex('1122'))
-]
-;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/findbinary2/findbinary2.1.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/findbinary2/findbinary2.1.query.sqlpp
deleted file mode 100644
index 7ea703e..0000000
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/findbinary2/findbinary2.1.query.sqlpp
+++ /dev/null
@@ -1,27 +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.
- */
-
-/* String offset is set to 1 */
-
-select value [
- find_binary(hex('aabbccddeeff'),hex('aabb')),
- find_binary(hex('aabbccddeeff'),hex('ccdd')),
- find_binary(hex('aabbccddeeff'),hex('1122'))
-]
-;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/subbinary/subbinary.1.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/subbinary/subbinary.1.query.sqlpp
deleted file mode 100644
index 6989cf7..0000000
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/subbinary/subbinary.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.
- */
-
-/* String offset is set to 1 */
-
-select value [
- print_binary(sub_binary(hex('aabbccddeeff'),-1,2), "hex"),
- print_binary(sub_binary(hex('aabbccddeeff'),0,2), "hex"),
- print_binary(sub_binary(hex('aabbccddeeff'),1,2), "hex"),
- print_binary(sub_binary(hex('aabbccddeeff'),2,2), "hex"),
- print_binary(sub_binary(hex('aabbccddeeff'),3,2), "hex")
-]
-;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/subbinary2/subbinary2.1.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/subbinary2/subbinary2.1.query.sqlpp
deleted file mode 100644
index 075f803..0000000
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/subbinary2/subbinary2.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.
- */
-
-/* String offset is set to 1 */
-
-select value [
- print_binary(sub_binary(hex('aabbccddeeff'),-1), 'hex'),
- print_binary(sub_binary(hex('aabbccddeeff'),0), 'hex'),
- print_binary(sub_binary(hex('aabbccddeeff'),1), 'hex'),
- print_binary(sub_binary(hex('aabbccddeeff'),2), 'hex'),
- print_binary(sub_binary(hex('aabbccddeeff'),3), 'hex')
-]
-;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/substring/substring.1.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/substring/substring.1.query.sqlpp
deleted file mode 100644
index 1c35e7f..0000000
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/stringoffset/substring/substring.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.
- */
-
-/* String offset is set to 1 */
-
-select value [
- substring('abcdefg',-1,2),
- substring('abcdefg',0,2),
- substring('abcdefg',1,2),
- substring('abcdefg',2,2),
- substring('abcdefg',3,2)
-]
-;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/position/position.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/position/offset0/pos/pos.1.adm
similarity index 89%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/string/position/position.1.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/string/position/offset0/pos/pos.1.adm
index 76e3e97..6a32c90 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/position/position.1.adm
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/position/offset0/pos/pos.1.adm
@@ -1 +1 @@
-[ 2, -1 ]
+[ 2, -1 ]
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/position/position.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/position/offset0/pos0/pos0.1.adm
similarity index 89%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/position/position.1.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/position/offset0/pos0/pos0.1.adm
index 76e3e97..6a32c90 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/position/position.1.adm
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/position/offset0/pos0/pos0.1.adm
@@ -1 +1 @@
-[ 2, -1 ]
+[ 2, -1 ]
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/position/position.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/position/offset0/position/position.1.adm
similarity index 89%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/position/position.1.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/position/offset0/position/position.1.adm
index 76e3e97..6a32c90 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/position/position.1.adm
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/position/offset0/position/position.1.adm
@@ -1 +1 @@
-[ 2, -1 ]
+[ 2, -1 ]
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/position/position.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/position/offset0/position0/position0.1.adm
similarity index 89%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/position/position.1.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/position/offset0/position0/position0.1.adm
index 76e3e97..6a32c90 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/position/position.1.adm
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/position/offset0/position0/position0.1.adm
@@ -1 +1 @@
-[ 2, -1 ]
+[ 2, -1 ]
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/stringoffset/position/position.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/position/offset1/pos1/pos1.1.adm
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/stringoffset/position/position.1.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/string/position/offset1/pos1/pos1.1.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/stringoffset/position/position.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/position/offset1/position1/position1.1.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/stringoffset/position/position.1.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/position/offset1/position1/position1.1.adm
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/contains_regex/contains_regex.3.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains/regexp_contains.3.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains/contains_regex/contains_regex.3.adm
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/contains_regex/contains_regex.4.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains/regexp_contains.4.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains/contains_regex/contains_regex.4.adm
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/contains_regexp/contains_regexp.3.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains/regexp_contains.3.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains/contains_regexp/contains_regexp.3.adm
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/contains_regexp/contains_regexp.4.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains/regexp_contains.4.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains/contains_regexp/contains_regexp.4.adm
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/regex_contains/regex_contains.3.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains/regexp_contains.3.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains/regex_contains/regex_contains.3.adm
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/regex_contains/regex_contains.4.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains/regexp_contains.4.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains/regex_contains/regex_contains.4.adm
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/regexp_contains.3.adm
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains/regexp_contains.3.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains/regexp_contains/regexp_contains.3.adm
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/regexp_contains.4.adm
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains/regexp_contains.4.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains/regexp_contains/regexp_contains.4.adm
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/contains_regex_with_flag/contains_regex_with_flag.3.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains_with_flag/regexp_contains_with_flag.3.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains_with_flag/contains_regex_with_flag/contains_regex_with_flag.3.adm
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/contains_regex_with_flag/contains_regex_with_flag.4.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains_with_flag/regexp_contains_with_flag.4.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains_with_flag/contains_regex_with_flag/contains_regex_with_flag.4.adm
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/contains_regexp_with_flag/contains_regexp_with_flag.3.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains_with_flag/regexp_contains_with_flag.3.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains_with_flag/contains_regexp_with_flag/contains_regexp_with_flag.3.adm
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/contains_regexp_with_flag/contains_regexp_with_flag.4.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains_with_flag/regexp_contains_with_flag.4.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains_with_flag/contains_regexp_with_flag/contains_regexp_with_flag.4.adm
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/regex_contains_with_flag/regex_contains_with_flag.3.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains_with_flag/regexp_contains_with_flag.3.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains_with_flag/regex_contains_with_flag/regex_contains_with_flag.3.adm
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/regex_contains_with_flag/regex_contains_with_flag.4.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains_with_flag/regexp_contains_with_flag.4.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains_with_flag/regex_contains_with_flag/regex_contains_with_flag.4.adm
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/regexp_contains_with_flag.3.adm
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains_with_flag/regexp_contains_with_flag.3.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains_with_flag/regexp_contains_with_flag/regexp_contains_with_flag.3.adm
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/regexp_contains_with_flag.4.adm
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains_with_flag/regexp_contains_with_flag.4.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_contains_with_flag/regexp_contains_with_flag/regexp_contains_with_flag.4.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_like/regexp_like.3.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_like/regex_like/regex_like.3.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_like/regexp_like.3.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_like/regex_like/regex_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/regex_like/regex_like.4.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_like/regexp_like.4.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_like/regex_like/regex_like.4.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_like/regexp_like.3.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_like/regexp_like/regexp_like.3.adm
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_like/regexp_like.3.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_like/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/regexp_like.4.adm
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_like/regexp_like.4.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_like/regexp_like/regexp_like.4.adm
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/regex_like_with_flag/regex_like_with_flag.3.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_like_with_flag/regexp_like_with_flag.3.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_like_with_flag/regex_like_with_flag/regex_like_with_flag.3.adm
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/regex_like_with_flag/regex_like_with_flag.4.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_like_with_flag/regexp_like_with_flag.4.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_like_with_flag/regex_like_with_flag/regex_like_with_flag.4.adm
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/regexp_like_with_flag.3.adm
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_like_with_flag/regexp_like_with_flag.3.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_like_with_flag/regexp_like_with_flag/regexp_like_with_flag.3.adm
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/regexp_like_with_flag.4.adm
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_like_with_flag/regexp_like_with_flag.4.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_like_with_flag/regexp_like_with_flag/regexp_like_with_flag.4.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/regexp_position.3.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/offset0/regex_pos/regex_pos.3.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/regexp_position.3.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/offset0/regex_pos/regex_pos.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/offset0/regex_pos/regex_pos.4.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/regexp_position.4.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/offset0/regex_pos/regex_pos.4.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/regexp_position.3.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/offset0/regex_pos0/regex_pos0.3.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/regexp_position.3.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/offset0/regex_pos0/regex_pos0.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/offset0/regex_pos0/regex_pos0.4.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/regexp_position.4.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/offset0/regex_pos0/regex_pos0.4.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/regexp_position.3.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/offset0/regex_position/regex_position.3.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/regexp_position.3.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/offset0/regex_position/regex_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/offset0/regex_position/regex_position.4.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/regexp_position.4.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/offset0/regex_position/regex_position.4.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/regexp_position.3.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/offset0/regex_position0/regex_position0.3.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/regexp_position.3.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/offset0/regex_position0/regex_position0.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/offset0/regex_position0/regex_position0.4.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/regexp_position.4.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/offset0/regex_position0/regex_position0.4.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/regexp_position.3.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/offset0/regexp_pos/regexp_pos.3.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/regexp_position.3.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/offset0/regexp_pos/regexp_pos.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/offset0/regexp_pos/regexp_pos.4.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/regexp_position.4.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/offset0/regexp_pos/regexp_pos.4.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/regexp_position.3.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/offset0/regexp_pos0/regexp_pos0.3.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/regexp_position.3.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/offset0/regexp_pos0/regexp_pos0.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/offset0/regexp_pos0/regexp_pos0.4.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/regexp_position.4.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/offset0/regexp_pos0/regexp_pos0.4.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/regexp_position.3.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/offset0/regexp_position/regexp_position.3.adm
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/regexp_position.3.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/offset0/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/offset0/regexp_position/regexp_position.4.adm
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/regexp_position.4.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/offset0/regexp_position/regexp_position.4.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/regexp_position.3.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/offset0/regexp_position0/regexp_position0.3.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/regexp_position.3.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/offset0/regexp_position0/regexp_position0.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/offset0/regexp_position0/regexp_position0.4.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/regexp_position.4.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/offset0/regexp_position0/regexp_position0.4.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/offset1/regex_pos1/regex_pos1.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/offset1/regex_pos1/regex_pos1.1.adm
new file mode 100644
index 0000000..bed66c3
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/offset1/regex_pos1/regex_pos1.1.adm
@@ -0,0 +1 @@
+[ 1, 4, -1, -1 ]
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/offset1/regex_position1/regex_position1.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/offset1/regex_position1/regex_position1.1.adm
new file mode 100644
index 0000000..bed66c3
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/offset1/regex_position1/regex_position1.1.adm
@@ -0,0 +1 @@
+[ 1, 4, -1, -1 ]
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/offset1/regexp_pos1/regexp_pos1.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/offset1/regexp_pos1/regexp_pos1.1.adm
new file mode 100644
index 0000000..bed66c3
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/offset1/regexp_pos1/regexp_pos1.1.adm
@@ -0,0 +1 @@
+[ 1, 4, -1, -1 ]
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/offset1/regexp_position1/regexp_position1.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/offset1/regexp_position1/regexp_position1.1.adm
new file mode 100644
index 0000000..bed66c3
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position/offset1/regexp_position1/regexp_position1.1.adm
@@ -0,0 +1 @@
+[ 1, 4, -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.3.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset0/regex_pos0_with_flag/regex_pos0_with_flag.3.adm
similarity index 93%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/regexp_position_with_flag.3.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset0/regex_pos0_with_flag/regex_pos0_with_flag.3.adm
index fa99af7..66ca9ff 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/regexp_position_with_flag.3.adm
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset0/regex_pos0_with_flag/regex_pos0_with_flag.3.adm
@@ -1 +1 @@
-{ "result1": 0 }
+{ "result1": 0 }
\ 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.4.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset0/regex_pos0_with_flag/regex_pos0_with_flag.4.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/regexp_position_with_flag.4.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset0/regex_pos0_with_flag/regex_pos0_with_flag.4.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/regexp_position_with_flag.3.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset0/regex_pos_with_flag/regex_pos_with_flag.3.adm
similarity index 93%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/regexp_position_with_flag.3.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset0/regex_pos_with_flag/regex_pos_with_flag.3.adm
index fa99af7..66ca9ff 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/regexp_position_with_flag.3.adm
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset0/regex_pos_with_flag/regex_pos_with_flag.3.adm
@@ -1 +1 @@
-{ "result1": 0 }
+{ "result1": 0 }
\ 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.4.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset0/regex_pos_with_flag/regex_pos_with_flag.4.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/regexp_position_with_flag.4.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset0/regex_pos_with_flag/regex_pos_with_flag.4.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/regexp_position_with_flag.3.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset0/regex_position0_with_flag/regex_position0_with_flag.3.adm
similarity index 93%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/regexp_position_with_flag.3.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset0/regex_position0_with_flag/regex_position0_with_flag.3.adm
index fa99af7..66ca9ff 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/regexp_position_with_flag.3.adm
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset0/regex_position0_with_flag/regex_position0_with_flag.3.adm
@@ -1 +1 @@
-{ "result1": 0 }
+{ "result1": 0 }
\ 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.4.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset0/regex_position0_with_flag/regex_position0_with_flag.4.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/regexp_position_with_flag.4.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset0/regex_position0_with_flag/regex_position0_with_flag.4.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/regexp_position_with_flag.3.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset0/regex_position_with_flag/regex_position_with_flag.3.adm
similarity index 93%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/regexp_position_with_flag.3.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset0/regex_position_with_flag/regex_position_with_flag.3.adm
index fa99af7..66ca9ff 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/regexp_position_with_flag.3.adm
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset0/regex_position_with_flag/regex_position_with_flag.3.adm
@@ -1 +1 @@
-{ "result1": 0 }
+{ "result1": 0 }
\ 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.4.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset0/regex_position_with_flag/regex_position_with_flag.4.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/regexp_position_with_flag.4.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset0/regex_position_with_flag/regex_position_with_flag.4.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/regexp_position_with_flag.3.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset0/regexp_pos0_with_flag/regexp_pos0_with_flag.3.adm
similarity index 93%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/regexp_position_with_flag.3.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset0/regexp_pos0_with_flag/regexp_pos0_with_flag.3.adm
index fa99af7..66ca9ff 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/regexp_position_with_flag.3.adm
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset0/regexp_pos0_with_flag/regexp_pos0_with_flag.3.adm
@@ -1 +1 @@
-{ "result1": 0 }
+{ "result1": 0 }
\ 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.4.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset0/regexp_pos0_with_flag/regexp_pos0_with_flag.4.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/regexp_position_with_flag.4.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset0/regexp_pos0_with_flag/regexp_pos0_with_flag.4.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/regexp_position_with_flag.3.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset0/regexp_pos_with_flag/regexp_pos_with_flag.3.adm
similarity index 93%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/regexp_position_with_flag.3.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset0/regexp_pos_with_flag/regexp_pos_with_flag.3.adm
index fa99af7..66ca9ff 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/regexp_position_with_flag.3.adm
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset0/regexp_pos_with_flag/regexp_pos_with_flag.3.adm
@@ -1 +1 @@
-{ "result1": 0 }
+{ "result1": 0 }
\ 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.4.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset0/regexp_pos_with_flag/regexp_pos_with_flag.4.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/regexp_position_with_flag.4.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset0/regexp_pos_with_flag/regexp_pos_with_flag.4.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/regexp_position_with_flag.3.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset0/regexp_position0_with_flag/regexp_position0_with_flag.3.adm
similarity index 93%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/regexp_position_with_flag.3.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset0/regexp_position0_with_flag/regexp_position0_with_flag.3.adm
index fa99af7..66ca9ff 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/regexp_position_with_flag.3.adm
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset0/regexp_position0_with_flag/regexp_position0_with_flag.3.adm
@@ -1 +1 @@
-{ "result1": 0 }
+{ "result1": 0 }
\ 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.4.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset0/regexp_position0_with_flag/regexp_position0_with_flag.4.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/regexp_position_with_flag.4.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset0/regexp_position0_with_flag/regexp_position0_with_flag.4.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/regexp_position_with_flag.3.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset0/regexp_position_with_flag/regexp_position_with_flag.3.adm
similarity index 93%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/regexp_position_with_flag.3.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset0/regexp_position_with_flag/regexp_position_with_flag.3.adm
index fa99af7..66ca9ff 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/regexp_position_with_flag.3.adm
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset0/regexp_position_with_flag/regexp_position_with_flag.3.adm
@@ -1 +1 @@
-{ "result1": 0 }
+{ "result1": 0 }
\ 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.4.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset0/regexp_position_with_flag/regexp_position_with_flag.4.adm
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/regexp_position_with_flag.4.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset0/regexp_position_with_flag/regexp_position_with_flag.4.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset1/regex_pos1_with_flag/regex_pos1_with_flag.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset1/regex_pos1_with_flag/regex_pos1_with_flag.1.adm
new file mode 100644
index 0000000..bed66c3
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset1/regex_pos1_with_flag/regex_pos1_with_flag.1.adm
@@ -0,0 +1 @@
+[ 1, 4, -1, -1 ]
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset1/regex_position1_with_flag/regex_position1_with_flag.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset1/regex_position1_with_flag/regex_position1_with_flag.1.adm
new file mode 100644
index 0000000..bed66c3
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset1/regex_position1_with_flag/regex_position1_with_flag.1.adm
@@ -0,0 +1 @@
+[ 1, 4, -1, -1 ]
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset1/regexp_pos1_with_flag/regexp_pos1_with_flag.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset1/regexp_pos1_with_flag/regexp_pos1_with_flag.1.adm
new file mode 100644
index 0000000..bed66c3
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset1/regexp_pos1_with_flag/regexp_pos1_with_flag.1.adm
@@ -0,0 +1 @@
+[ 1, 4, -1, -1 ]
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset1/regexp_position1_with_flag/regexp_position1_with_flag.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset1/regexp_position1_with_flag/regexp_position1_with_flag.1.adm
new file mode 100644
index 0000000..bed66c3
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_position_with_flag/offset1/regexp_position1_with_flag/regexp_position1_with_flag.1.adm
@@ -0,0 +1 @@
+[ 1, 4, -1, -1 ]
\ No newline at end of file
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/regex_replace/regex_replace.3.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace/regexp_replace.3.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace/regex_replace/regex_replace.3.adm
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/regex_replace/regex_replace.4.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace/regexp_replace.4.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace/regex_replace/regex_replace.4.adm
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/regexp_replace.3.adm
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace/regexp_replace.3.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace/regexp_replace/regexp_replace.3.adm
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/regexp_replace.4.adm
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace/regexp_replace.4.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace/regexp_replace/regexp_replace.4.adm
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/regex_replace_with_flag/regex_replace_with_flag.3.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace_with_flag/regexp_replace_with_flag.3.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace_with_flag/regex_replace_with_flag/regex_replace_with_flag.3.adm
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/regex_replace_with_flag/regex_replace_with_flag.4.adm
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace_with_flag/regexp_replace_with_flag.4.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace_with_flag/regex_replace_with_flag/regex_replace_with_flag.4.adm
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/regexp_replace_with_flag.3.adm
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace_with_flag/regexp_replace_with_flag.3.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace_with_flag/regexp_replace_with_flag/regexp_replace_with_flag.3.adm
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/regexp_replace_with_flag.4.adm
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace_with_flag/regexp_replace_with_flag.4.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/string/regexp_replace_with_flag/regexp_replace_with_flag/regexp_replace_with_flag.4.adm
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/substr01/substr01.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/substr01/offset0/substr/substr.1.adm
similarity index 98%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/string/substr01/substr01.1.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/string/substr01/offset0/substr/substr.1.adm
index c8cbcf0..f08055a 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/substr01/substr01.1.adm
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/substr01/offset0/substr/substr.1.adm
@@ -1 +1 @@
-{ "str2": "ld", "str4": "g", "str6": null, "str8": "This is a test string", "str10": "string", "str13": "gThis is a another test string", "str14": "Irvine" }
+{ "str2": "ld", "str4": "g", "str6": null, "str8": "This is a test string", "str10": "string", "str13": "gThis is a another test string", "str14": "Irvine" }
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/substr01/substr01.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/substr01/offset0/substr0/substr0.1.adm
similarity index 98%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/substr01/substr01.1.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/substr01/offset0/substr0/substr0.1.adm
index c8cbcf0..f08055a 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/substr01/substr01.1.adm
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/substr01/offset0/substr0/substr0.1.adm
@@ -1 +1 @@
-{ "str2": "ld", "str4": "g", "str6": null, "str8": "This is a test string", "str10": "string", "str13": "gThis is a another test string", "str14": "Irvine" }
+{ "str2": "ld", "str4": "g", "str6": null, "str8": "This is a test string", "str10": "string", "str13": "gThis is a another test string", "str14": "Irvine" }
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/substr01/substr01.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/substr01/offset0/substring/substring.1.adm
similarity index 98%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/substr01/substr01.1.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/substr01/offset0/substring/substring.1.adm
index c8cbcf0..f08055a 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/substr01/substr01.1.adm
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/substr01/offset0/substring/substring.1.adm
@@ -1 +1 @@
-{ "str2": "ld", "str4": "g", "str6": null, "str8": "This is a test string", "str10": "string", "str13": "gThis is a another test string", "str14": "Irvine" }
+{ "str2": "ld", "str4": "g", "str6": null, "str8": "This is a test string", "str10": "string", "str13": "gThis is a another test string", "str14": "Irvine" }
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/substr01/substr01.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/substr01/offset0/substring0/substring0.1.adm
similarity index 98%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/substr01/substr01.1.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/substr01/offset0/substring0/substring0.1.adm
index c8cbcf0..f08055a 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/substr01/substr01.1.adm
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/substr01/offset0/substring0/substring0.1.adm
@@ -1 +1 @@
-{ "str2": "ld", "str4": "g", "str6": null, "str8": "This is a test string", "str10": "string", "str13": "gThis is a another test string", "str14": "Irvine" }
+{ "str2": "ld", "str4": "g", "str6": null, "str8": "This is a test string", "str10": "string", "str13": "gThis is a another test string", "str14": "Irvine" }
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/stringoffset/substring/substring.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/substr01/offset1/substr1/substr1.1.adm
similarity index 96%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/stringoffset/substring/substring.1.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/string/substr01/offset1/substr1/substr1.1.adm
index a94cd89..ba46923 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/stringoffset/substring/substring.1.adm
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/substr01/offset1/substr1/substr1.1.adm
@@ -1 +1 @@
-[ "g", null, "ab", "bc", "cd" ]
+[ "g", null, "ab", "bc", "cd" ]
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/stringoffset/substring/substring.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/substr01/offset1/substring1/substring1.1.adm
similarity index 96%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/stringoffset/substring/substring.1.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/substr01/offset1/substring1/substring1.1.adm
index a94cd89..ba46923 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/stringoffset/substring/substring.1.adm
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/substr01/offset1/substring1/substring1.1.adm
@@ -1 +1 @@
-[ "g", null, "ab", "bc", "cd" ]
+[ "g", null, "ab", "bc", "cd" ]
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/substring2-1/substring2-1.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/substring2-1/offset0/substr/substr.1.adm
similarity index 95%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/string/substring2-1/substring2-1.1.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/string/substring2-1/offset0/substr/substr.1.adm
index 411e803..01dd3e4 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/substring2-1/substring2-1.1.adm
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/substring2-1/offset0/substr/substr.1.adm
@@ -1 +1 @@
-{ "result1": "Ellow" }
+{ "result1": "Ellow" }
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/substring2-1/substring2-1.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/substring2-1/offset0/substr0/substr0.1.adm
similarity index 95%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/substring2-1/substring2-1.1.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/substring2-1/offset0/substr0/substr0.1.adm
index 411e803..01dd3e4 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/substring2-1/substring2-1.1.adm
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/substring2-1/offset0/substr0/substr0.1.adm
@@ -1 +1 @@
-{ "result1": "Ellow" }
+{ "result1": "Ellow" }
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/substring2-1/substring2-1.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/substring2-1/offset0/substring/substring.1.adm
similarity index 95%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/substring2-1/substring2-1.1.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/substring2-1/offset0/substring/substring.1.adm
index 411e803..01dd3e4 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/substring2-1/substring2-1.1.adm
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/substring2-1/offset0/substring/substring.1.adm
@@ -1 +1 @@
-{ "result1": "Ellow" }
+{ "result1": "Ellow" }
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/substring2-1/substring2-1.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/substring2-1/offset0/substring0/substring0.1.adm
similarity index 95%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/string/substring2-1/substring2-1.1.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/substring2-1/offset0/substring0/substring0.1.adm
index 411e803..01dd3e4 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/string/substring2-1/substring2-1.1.adm
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/substring2-1/offset0/substring0/substring0.1.adm
@@ -1 +1 @@
-{ "result1": "Ellow" }
+{ "result1": "Ellow" }
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/stringoffset/substring2/substring2.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/substring2-1/offset1/substr1/substr1.1.adm
similarity index 97%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results/stringoffset/substring2/substring2.1.adm
rename to asterixdb/asterix-app/src/test/resources/runtimets/results/string/substring2-1/offset1/substr1/substr1.1.adm
index 9b005ca..772cf57 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/stringoffset/substring2/substring2.1.adm
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/substring2-1/offset1/substr1/substr1.1.adm
@@ -1 +1 @@
-[ "g", null, "abcdefg", "bcdefg", "cdefg" ]
+[ "g", null, "abcdefg", "bcdefg", "cdefg" ]
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/stringoffset/substring2/substring2.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/substring2-1/offset1/substring1/substring1.1.adm
similarity index 97%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results/stringoffset/substring2/substring2.1.adm
copy to asterixdb/asterix-app/src/test/resources/runtimets/results/string/substring2-1/offset1/substring1/substring1.1.adm
index 9b005ca..772cf57 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/stringoffset/substring2/substring2.1.adm
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/string/substring2-1/offset1/substring1/substring1.1.adm
@@ -1 +1 @@
-[ "g", null, "abcdefg", "bcdefg", "cdefg" ]
+[ "g", null, "abcdefg", "bcdefg", "cdefg" ]
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/stringoffset/findbinary/findbinary.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/stringoffset/findbinary/findbinary.1.adm
deleted file mode 100644
index 0fae953..0000000
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/stringoffset/findbinary/findbinary.1.adm
+++ /dev/null
@@ -1 +0,0 @@
-[ 1, 1, 1, 7, -1 ]
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/stringoffset/findbinary2/findbinary2.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/stringoffset/findbinary2/findbinary2.1.adm
deleted file mode 100644
index 299ae43..0000000
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/stringoffset/findbinary2/findbinary2.1.adm
+++ /dev/null
@@ -1 +0,0 @@
-[ 1, 3, -1 ]
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/stringoffset/regexp_position/regexp_position.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/stringoffset/regexp_position/regexp_position.1.adm
deleted file mode 100644
index 613f89b..0000000
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/stringoffset/regexp_position/regexp_position.1.adm
+++ /dev/null
@@ -1 +0,0 @@
-[ 1, 4, -1 ]
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/stringoffset/regexp_position_with_flag/regexp_position_with_flag.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/stringoffset/regexp_position_with_flag/regexp_position_with_flag.1.adm
deleted file mode 100644
index 613f89b..0000000
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/stringoffset/regexp_position_with_flag/regexp_position_with_flag.1.adm
+++ /dev/null
@@ -1 +0,0 @@
-[ 1, 4, -1 ]
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/stringoffset/subbinary/subbinary.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/stringoffset/subbinary/subbinary.1.adm
deleted file mode 100644
index f5e809d..0000000
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/stringoffset/subbinary/subbinary.1.adm
+++ /dev/null
@@ -1 +0,0 @@
-[ "AABB", "AABB", "AABB", "BBCC", "CCDD" ]
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/stringoffset/subbinary2/subbinary2.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/stringoffset/subbinary2/subbinary2.1.adm
deleted file mode 100644
index 275d27a..0000000
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/stringoffset/subbinary2/subbinary2.1.adm
+++ /dev/null
@@ -1 +0,0 @@
-[ "AABBCCDDEEFF", "AABBCCDDEEFF", "AABBCCDDEEFF", "BBCCDDEEFF", "CCDDEEFF" ]
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substr01/substr01.1.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substr01/offset0/substring/substring.1.ast
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substr01/substr01.1.ast
rename to asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substr01/offset0/substring/substring.1.ast
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substr01/substr01.2.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substr01/offset0/substring/substring.2.ast
similarity index 100%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substr01/substr01.2.ast
rename to asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substr01/offset0/substring/substring.2.ast
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substr01/substr01.3.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substr01/offset0/substring/substring.3.ast
similarity index 99%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substr01/substr01.3.ast
rename to asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substr01/offset0/substring/substring.3.ast
index 9d1c274..31a6a19 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substr01/substr01.3.ast
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substr01/offset0/substring/substring.3.ast
@@ -71,4 +71,4 @@
]
]
)
-]
+]
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substr01/substr01.1.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substr01/offset0/substring/substring.4.ast
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substr01/substr01.1.ast
copy to asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substr01/offset0/substring/substring.4.ast
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substr01/substr01.1.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substring2-1/offset0/substring/substring.1.ast
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substr01/substr01.1.ast
copy to asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substring2-1/offset0/substring/substring.1.ast
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substr01/substr01.2.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substring2-1/offset0/substring/substring.2.ast
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substr01/substr01.2.ast
copy to asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substring2-1/offset0/substring/substring.2.ast
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substring2-1/substring2-1.3.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substring2-1/offset0/substring/substring.3.ast
similarity index 98%
rename from asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substring2-1/substring2-1.3.ast
rename to asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substring2-1/offset0/substring/substring.3.ast
index c170655..f0f9f15 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substring2-1/substring2-1.3.ast
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substring2-1/offset0/substring/substring.3.ast
@@ -9,4 +9,4 @@
LiteralExpr [LONG] [1]
]
)
-]
+]
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substr01/substr01.1.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substring2-1/offset0/substring/substring.4.ast
similarity index 100%
copy from asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substr01/substr01.1.ast
copy to asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substring2-1/offset0/substring/substring.4.ast
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substring2-1/substring2-1.1.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substring2-1/substring2-1.1.ast
deleted file mode 100644
index e69de29..0000000
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substring2-1/substring2-1.1.ast
+++ /dev/null
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substring2-1/substring2-1.2.ast b/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substring2-1/substring2-1.2.ast
deleted file mode 100644
index e69de29..0000000
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results_parser_sqlpp/string/substring2-1/substring2-1.2.ast
+++ /dev/null
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 0f82c9e..f30b965 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
@@ -8694,38 +8694,213 @@
</compilation-unit>
</test-case>
<test-case FilePath="string">
- <compilation-unit name="position">
- <output-dir compare="Text">position</output-dir>
+ <compilation-unit name="position/offset0/position">
+ <output-dir compare="Text">position/offset0/position</output-dir>
</compilation-unit>
</test-case>
<test-case FilePath="string">
- <compilation-unit name="regexp_contains">
- <output-dir compare="Text">regexp_contains</output-dir>
+ <compilation-unit name="position/offset0/pos">
+ <output-dir compare="Text">position/offset0/pos</output-dir>
</compilation-unit>
</test-case>
<test-case FilePath="string">
- <compilation-unit name="regexp_contains_with_flag">
- <output-dir compare="Text">regexp_contains_with_flag</output-dir>
+ <compilation-unit name="position/offset0/position0">
+ <output-dir compare="Text">position/offset0/position0</output-dir>
</compilation-unit>
</test-case>
<test-case FilePath="string">
- <compilation-unit name="regexp_like">
- <output-dir compare="Text">regexp_like</output-dir>
+ <compilation-unit name="position/offset0/pos0">
+ <output-dir compare="Text">position/offset0/pos0</output-dir>
</compilation-unit>
</test-case>
<test-case FilePath="string">
- <compilation-unit name="regexp_like_with_flag">
- <output-dir compare="Text">regexp_like_with_flag</output-dir>
+ <compilation-unit name="position/offset1/position1">
+ <output-dir compare="Text">position/offset1/position1</output-dir>
</compilation-unit>
</test-case>
<test-case FilePath="string">
- <compilation-unit name="regexp_position">
- <output-dir compare="Text">regexp_position</output-dir>
+ <compilation-unit name="position/offset1/pos1">
+ <output-dir compare="Text">position/offset1/pos1</output-dir>
</compilation-unit>
</test-case>
<test-case FilePath="string">
- <compilation-unit name="regexp_position_with_flag">
- <output-dir compare="Text">regexp_position_with_flag</output-dir>
+ <compilation-unit name="regexp_contains/regexp_contains">
+ <output-dir compare="Text">regexp_contains/regexp_contains</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="regexp_contains/regex_contains">
+ <output-dir compare="Text">regexp_contains/regex_contains</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="regexp_contains/contains_regexp">
+ <output-dir compare="Text">regexp_contains/contains_regexp</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="regexp_contains/contains_regex">
+ <output-dir compare="Text">regexp_contains/contains_regex</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="regexp_contains_with_flag/regexp_contains_with_flag">
+ <output-dir compare="Text">regexp_contains_with_flag/regexp_contains_with_flag</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="regexp_contains_with_flag/regex_contains_with_flag">
+ <output-dir compare="Text">regexp_contains_with_flag/regex_contains_with_flag</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="regexp_contains_with_flag/contains_regexp_with_flag">
+ <output-dir compare="Text">regexp_contains_with_flag/contains_regexp_with_flag</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="regexp_contains_with_flag/contains_regex_with_flag">
+ <output-dir compare="Text">regexp_contains_with_flag/contains_regex_with_flag</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="regexp_like/regexp_like">
+ <output-dir compare="Text">regexp_like/regexp_like</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="regexp_like/regex_like">
+ <output-dir compare="Text">regexp_like/regex_like</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="regexp_like_with_flag/regexp_like_with_flag">
+ <output-dir compare="Text">regexp_like_with_flag/regexp_like_with_flag</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="regexp_like_with_flag/regex_like_with_flag">
+ <output-dir compare="Text">regexp_like_with_flag/regex_like_with_flag</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="regexp_position/offset0/regexp_position">
+ <output-dir compare="Text">regexp_position/offset0/regexp_position</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="regexp_position/offset0/regexp_pos">
+ <output-dir compare="Text">regexp_position/offset0/regexp_pos</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="regexp_position/offset0/regexp_position0">
+ <output-dir compare="Text">regexp_position/offset0/regexp_position0</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="regexp_position/offset0/regexp_pos0">
+ <output-dir compare="Text">regexp_position/offset0/regexp_pos0</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="regexp_position/offset0/regex_position">
+ <output-dir compare="Text">regexp_position/offset0/regex_position</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="regexp_position/offset0/regex_pos">
+ <output-dir compare="Text">regexp_position/offset0/regex_pos</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="regexp_position/offset0/regex_position0">
+ <output-dir compare="Text">regexp_position/offset0/regex_position0</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="regexp_position/offset0/regex_pos0">
+ <output-dir compare="Text">regexp_position/offset0/regex_pos0</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="regexp_position/offset1/regexp_position1">
+ <output-dir compare="Text">regexp_position/offset1/regexp_position1</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="regexp_position/offset1/regexp_pos1">
+ <output-dir compare="Text">regexp_position/offset1/regexp_pos1</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="regexp_position/offset1/regex_position1">
+ <output-dir compare="Text">regexp_position/offset1/regex_position1</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="regexp_position/offset1/regex_pos1">
+ <output-dir compare="Text">regexp_position/offset1/regex_pos1</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="regexp_position_with_flag/offset0/regexp_position_with_flag">
+ <output-dir compare="Text">regexp_position_with_flag/offset0/regexp_position_with_flag</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="regexp_position_with_flag/offset0/regexp_pos_with_flag">
+ <output-dir compare="Text">regexp_position_with_flag/offset0/regexp_pos_with_flag</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="regexp_position_with_flag/offset0/regexp_position0_with_flag">
+ <output-dir compare="Text">regexp_position_with_flag/offset0/regexp_position0_with_flag</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="regexp_position_with_flag/offset0/regexp_pos0_with_flag">
+ <output-dir compare="Text">regexp_position_with_flag/offset0/regexp_pos0_with_flag</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="regexp_position_with_flag/offset0/regex_position_with_flag">
+ <output-dir compare="Text">regexp_position_with_flag/offset0/regex_position_with_flag</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="regexp_position_with_flag/offset0/regex_pos_with_flag">
+ <output-dir compare="Text">regexp_position_with_flag/offset0/regex_pos_with_flag</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="regexp_position_with_flag/offset0/regex_position0_with_flag">
+ <output-dir compare="Text">regexp_position_with_flag/offset0/regex_position0_with_flag</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="regexp_position_with_flag/offset0/regex_pos0_with_flag">
+ <output-dir compare="Text">regexp_position_with_flag/offset0/regex_pos0_with_flag</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="regexp_position_with_flag/offset1/regexp_position1_with_flag">
+ <output-dir compare="Text">regexp_position_with_flag/offset1/regexp_position1_with_flag</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="regexp_position_with_flag/offset1/regexp_pos1_with_flag">
+ <output-dir compare="Text">regexp_position_with_flag/offset1/regexp_pos1_with_flag</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="regexp_position_with_flag/offset1/regex_position1_with_flag">
+ <output-dir compare="Text">regexp_position_with_flag/offset1/regex_position1_with_flag</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="regexp_position_with_flag/offset1/regex_pos1_with_flag">
+ <output-dir compare="Text">regexp_position_with_flag/offset1/regex_pos1_with_flag</output-dir>
</compilation-unit>
</test-case>
<test-case FilePath="string">
@@ -8744,13 +8919,23 @@
</compilation-unit>
</test-case>
<test-case FilePath="string">
- <compilation-unit name="regexp_replace">
- <output-dir compare="Text">regexp_replace</output-dir>
+ <compilation-unit name="regexp_replace/regexp_replace">
+ <output-dir compare="Text">regexp_replace/regexp_replace</output-dir>
</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 name="regexp_replace/regex_replace">
+ <output-dir compare="Text">regexp_replace/regex_replace</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="regexp_replace_with_flag/regexp_replace_with_flag">
+ <output-dir compare="Text">regexp_replace_with_flag/regexp_replace_with_flag</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="regexp_replace_with_flag/regex_replace_with_flag">
+ <output-dir compare="Text">regexp_replace_with_flag/regex_replace_with_flag</output-dir>
</compilation-unit>
</test-case>
<test-case FilePath="string">
@@ -8879,8 +9064,33 @@
</compilation-unit>
</test-case>
<test-case FilePath="string">
- <compilation-unit name="substr01">
- <output-dir compare="Text">substr01</output-dir>
+ <compilation-unit name="substr01/offset0/substring">
+ <output-dir compare="Text">substr01/offset0/substring</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="substr01/offset0/substr">
+ <output-dir compare="Text">substr01/offset0/substr</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="substr01/offset0/substring0">
+ <output-dir compare="Text">substr01/offset0/substring0</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="substr01/offset0/substr0">
+ <output-dir compare="Text">substr01/offset0/substr0</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="substr01/offset1/substring1">
+ <output-dir compare="Text">substr01/offset1/substring1</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="substr01/offset1/substr1">
+ <output-dir compare="Text">substr01/offset1/substr1</output-dir>
</compilation-unit>
</test-case>
<test-case FilePath="string">
@@ -8934,8 +9144,33 @@
</compilation-unit>
</test-case>
<test-case FilePath="string">
- <compilation-unit name="substring2-1">
- <output-dir compare="Text">substring2-1</output-dir>
+ <compilation-unit name="substring2-1/offset0/substring">
+ <output-dir compare="Text">substring2-1/offset0/substring</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="substring2-1/offset0/substr">
+ <output-dir compare="Text">substring2-1/offset0/substr</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="substring2-1/offset0/substring0">
+ <output-dir compare="Text">substring2-1/offset0/substring0</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="substring2-1/offset0/substr0">
+ <output-dir compare="Text">substring2-1/offset0/substr0</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="substring2-1/offset1/substring1">
+ <output-dir compare="Text">substring2-1/offset1/substring1</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="string">
+ <compilation-unit name="substring2-1/offset1/substr1">
+ <output-dir compare="Text">substring2-1/offset1/substr1</output-dir>
</compilation-unit>
</test-case>
<test-case FilePath="string">
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp_parser.xml b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp_parser.xml
index 55f4962..ffde5ff 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp_parser.xml
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp_parser.xml
@@ -5063,8 +5063,8 @@
</compilation-unit>
</test-case>
<test-case FilePath="string">
- <compilation-unit name="substr01">
- <output-dir compare="AST">substr01</output-dir>
+ <compilation-unit name="substr01/offset0/substring">
+ <output-dir compare="AST">substr01/offset0/substring</output-dir>
</compilation-unit>
</test-case>
<test-case FilePath="string">
@@ -5118,8 +5118,8 @@
</compilation-unit>
</test-case>
<test-case FilePath="string">
- <compilation-unit name="substring2-1">
- <output-dir compare="AST">substring2-1</output-dir>
+ <compilation-unit name="substring2-1/offset0/substring">
+ <output-dir compare="AST">substring2-1/offset0/substring</output-dir>
</compilation-unit>
</test-case>
<test-case FilePath="string">
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_stringoffset.xml b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_stringoffset.xml
deleted file mode 100644
index f7da162..0000000
--- a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_stringoffset.xml
+++ /dev/null
@@ -1,67 +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.
- !-->
-<test-suite xmlns="urn:xml.testframework.asterix.apache.org" ResultOffsetPath="results" QueryOffsetPath="queries_sqlpp" QueryFileExtension=".sqlpp">
- <test-group name="stringoffset">
- <test-case FilePath="stringoffset">
- <compilation-unit name="position">
- <output-dir compare="Text">position</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="stringoffset">
- <compilation-unit name="regexp_position">
- <output-dir compare="Text">regexp_position</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="stringoffset">
- <compilation-unit name="regexp_position_with_flag">
- <output-dir compare="Text">regexp_position_with_flag</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="stringoffset">
- <compilation-unit name="substring">
- <output-dir compare="Text">substring</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="stringoffset">
- <compilation-unit name="substring2">
- <output-dir compare="Text">substring2</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="stringoffset">
- <compilation-unit name="subbinary">
- <output-dir compare="Text">subbinary</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="stringoffset">
- <compilation-unit name="subbinary2">
- <output-dir compare="Text">subbinary2</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="stringoffset">
- <compilation-unit name="findbinary">
- <output-dir compare="Text">findbinary</output-dir>
- </compilation-unit>
- </test-case>
- <test-case FilePath="stringoffset">
- <compilation-unit name="findbinary2">
- <output-dir compare="Text">findbinary2</output-dir>
- </compilation-unit>
- </test-case>
- </test-group>
-</test-suite>
\ No newline at end of file
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/CompilerProperties.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/CompilerProperties.java
index 9428e6f..bdeaddb 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/CompilerProperties.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/CompilerProperties.java
@@ -23,7 +23,6 @@
import static org.apache.hyracks.control.common.config.OptionTypes.INTEGER_BYTE_UNIT;
import static org.apache.hyracks.control.common.config.OptionTypes.LONG_BYTE_UNIT;
import static org.apache.hyracks.control.common.config.OptionTypes.POSITIVE_INTEGER;
-import static org.apache.hyracks.control.common.config.OptionTypes.UNSIGNED_INTEGER;
import static org.apache.hyracks.util.StorageUtil.StorageUnit.KILOBYTE;
import static org.apache.hyracks.util.StorageUtil.StorageUnit.MEGABYTE;
@@ -68,7 +67,6 @@
+ "other integer values dictate the number of query execution parallel partitions. The system will "
+ "fall back to use the number of all available CPU cores in the cluster as the degree of parallelism "
+ "if the number set by a user is too large or too small"),
- COMPILER_STRINGOFFSET(UNSIGNED_INTEGER, 0, "Position of a first character in a String/Binary (0 or 1)"),
COMPILER_SORT_PARALLEL(BOOLEAN, AlgebricksConfig.SORT_PARALLEL, "Enabling/Disabling full parallel sort"),
COMPILER_SORT_SAMPLES(
POSITIVE_INTEGER,
@@ -104,11 +102,6 @@
public Object defaultValue() {
return defaultValue;
}
-
- @Override
- public boolean hidden() {
- return this == COMPILER_STRINGOFFSET;
- }
}
public static final String COMPILER_SORTMEMORY_KEY = Option.COMPILER_SORTMEMORY.ini();
@@ -161,11 +154,6 @@
return accessor.getInt(Option.COMPILER_PARALLELISM);
}
- public int getStringOffset() {
- int value = accessor.getInt(Option.COMPILER_STRINGOFFSET);
- return value > 0 ? 1 : 0;
- }
-
public boolean getSortParallel() {
return accessor.getBoolean(Option.COMPILER_SORT_PARALLEL);
}
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/util/CommonFunctionMapUtil.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/util/CommonFunctionMapUtil.java
index 202fe4e..7701502 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/util/CommonFunctionMapUtil.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/util/CommonFunctionMapUtil.java
@@ -37,7 +37,6 @@
addFunctionMapping("substr", "substring"); // substr, internal: substring
addFunctionMapping("upper", "uppercase"); // upper, internal: uppercase
addFunctionMapping("title", "initcap"); // title, internal: initcap
- addFunctionMapping("regexp_contains", "matches"); // regexp_contains, internal: matches
addFunctionMapping("int", "integer"); // int, internal: integer
// The "mapped-to" names are to be deprecated.
@@ -46,6 +45,32 @@
addFunctionMapping("integer", "int32"); // integer, internal: int32
addFunctionMapping("bigint", "int64"); // bigint, internal: int64
+ // String functions
+ addFunctionMapping("pos", "position");
+ addFunctionMapping("pos0", "position");
+ addFunctionMapping("position0", "position");
+ addFunctionMapping("pos1", "position1");
+ addFunctionMapping("substr", "substring");
+ addFunctionMapping("substr0", "substring");
+ addFunctionMapping("substring0", "substring");
+ addFunctionMapping("substr1", "substring1");
+ addFunctionMapping("regex_contains", "matches");
+ addFunctionMapping("contains_regex", "matches");
+ addFunctionMapping("regexp_contains", "matches");
+ addFunctionMapping("contains_regexp", "matches");
+ addFunctionMapping("regex_like", "regexp-like");
+ addFunctionMapping("regex_pos", "regexp-position");
+ addFunctionMapping("regex_position", "regexp-position");
+ addFunctionMapping("regex_pos0", "regexp-position");
+ addFunctionMapping("regex_position0", "regexp-position");
+ addFunctionMapping("regexp_pos", "regexp-position");
+ addFunctionMapping("regexp_pos0", "regexp-position");
+ addFunctionMapping("regexp_position0", "regexp-position");
+ addFunctionMapping("regex_pos1", "regexp-position1");
+ addFunctionMapping("regex_position1", "regexp-position1");
+ addFunctionMapping("regexp_pos1", "regexp-position1");
+ addFunctionMapping("regex_replace", "regexp-replace");
+
// Type functions.
addFunctionMapping("isnull", "is-null"); // isnull, internal: is-null
addFunctionMapping("ismissing", "is-missing"); // ismissing, internal: is-missing
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/functions/BuiltinFunctions.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/functions/BuiltinFunctions.java
index 5f42dfb..f080728 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/functions/BuiltinFunctions.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/functions/BuiltinFunctions.java
@@ -432,8 +432,12 @@
new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "regexp-like", 3);
public static final FunctionIdentifier STRING_REGEXP_POSITION =
new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "regexp-position", 2);
+ public static final FunctionIdentifier STRING_REGEXP_POSITION_OFFSET_1 =
+ new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "regexp-position1", 2);
public static final FunctionIdentifier STRING_REGEXP_POSITION_WITH_FLAG =
new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "regexp-position", 3);
+ public static final FunctionIdentifier STRING_REGEXP_POSITION_OFFSET_1_WITH_FLAG =
+ new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "regexp-position1", 3);
public static final FunctionIdentifier STRING_REGEXP_REPLACE =
new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "regexp-replace", 3);
public static final FunctionIdentifier STRING_REGEXP_REPLACE_WITH_FLAG =
@@ -458,6 +462,8 @@
new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "rtrim", 2);
public static final FunctionIdentifier STRING_POSITION =
new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "position", 2);
+ public static final FunctionIdentifier STRING_POSITION_OFFSET_1 =
+ new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "position1", 2);
public static final FunctionIdentifier STRING_REPLACE =
new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "replace", 3);
public static final FunctionIdentifier STRING_REPLACE_WITH_LIMIT =
@@ -476,8 +482,12 @@
new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "ends-with", 2);
public static final FunctionIdentifier SUBSTRING =
new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "substring", 3);
+ public static final FunctionIdentifier SUBSTRING_OFFSET_1 =
+ new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "substring1", 3);
public static final FunctionIdentifier SUBSTRING2 =
new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "substring", 2);
+ public static final FunctionIdentifier SUBSTRING2_OFFSET_1 =
+ new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "substring1", 2);
public static final FunctionIdentifier SUBSTRING_BEFORE =
new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "substring-before", 2);
public static final FunctionIdentifier SUBSTRING_AFTER =
@@ -1704,7 +1714,9 @@
addFunction(CODEPOINT_TO_STRING, AStringTypeComputer.INSTANCE, true); // TODO
addFunction(STRING_CONCAT, ConcatTypeComputer.INSTANCE_STRING, true); // TODO
addFunction(SUBSTRING, SubstringTypeComputer.INSTANCE, true); // TODO
+ addFunction(SUBSTRING_OFFSET_1, SubstringTypeComputer.INSTANCE, true); // TODO
addFunction(SUBSTRING2, AStringTypeComputer.INSTANCE_NULLABLE, true);
+ addFunction(SUBSTRING2_OFFSET_1, AStringTypeComputer.INSTANCE_NULLABLE, true);
addFunction(STRING_LENGTH, UnaryStringInt64TypeComputer.INSTANCE, true);
addFunction(STRING_LOWERCASE, StringStringTypeComputer.INSTANCE, true);
addFunction(STRING_UPPERCASE, StringStringTypeComputer.INSTANCE, true);
@@ -1716,6 +1728,7 @@
addFunction(STRING_LTRIM2, StringStringTypeComputer.INSTANCE, true);
addFunction(STRING_RTRIM2, StringStringTypeComputer.INSTANCE, true);
addFunction(STRING_POSITION, StringInt32TypeComputer.INSTANCE, true);
+ addFunction(STRING_POSITION_OFFSET_1, StringInt32TypeComputer.INSTANCE, true);
addFunction(STRING_STARTS_WITH, StringBooleanTypeComputer.INSTANCE, true);
addFunction(STRING_ENDS_WITH, StringBooleanTypeComputer.INSTANCE, true);
addFunction(STRING_MATCHES, StringBooleanTypeComputer.INSTANCE, true);
@@ -1723,7 +1736,9 @@
addFunction(STRING_REGEXP_LIKE, StringBooleanTypeComputer.INSTANCE, true);
addFunction(STRING_REGEXP_LIKE_WITH_FLAG, StringBooleanTypeComputer.INSTANCE, true);
addFunction(STRING_REGEXP_POSITION, StringInt32TypeComputer.INSTANCE, true);
+ addFunction(STRING_REGEXP_POSITION_OFFSET_1, StringInt32TypeComputer.INSTANCE, true);
addFunction(STRING_REGEXP_POSITION_WITH_FLAG, StringInt32TypeComputer.INSTANCE, true);
+ addFunction(STRING_REGEXP_POSITION_OFFSET_1_WITH_FLAG, StringInt32TypeComputer.INSTANCE, true);
addFunction(STRING_REGEXP_REPLACE, StringStringTypeComputer.INSTANCE, true);
addFunction(STRING_REGEXP_REPLACE_WITH_FLAG, AStringTypeComputer.INSTANCE_NULLABLE, true);
addFunction(STRING_REPLACE, StringStringTypeComputer.INSTANCE, true);
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractStringOffsetConfigurableDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractStringOffsetConfigurableDescriptor.java
deleted file mode 100644
index 3f8f45f..0000000
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractStringOffsetConfigurableDescriptor.java
+++ /dev/null
@@ -1,34 +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.
- */
-
-package org.apache.asterix.runtime.evaluators.functions;
-
-import org.apache.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
-
-public abstract class AbstractStringOffsetConfigurableDescriptor extends AbstractScalarFunctionDynamicDescriptor {
-
- private static final long serialVersionUID = 1L;
-
- protected int stringOffset;
-
- @Override
- public void setImmutableStates(Object... states) {
- stringOffset = (int) states[0];
- }
-}
\ No newline at end of file
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringPositionDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringPositionDescriptor.java
index 3391b74..f7177fd 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringPositionDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringPositionDescriptor.java
@@ -19,14 +19,10 @@
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;
import org.apache.asterix.om.functions.IFunctionDescriptorFactory;
-import org.apache.asterix.om.functions.IFunctionTypeInferer;
-import org.apache.asterix.runtime.functions.FunctionTypeInferers;
+import org.apache.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
import org.apache.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import org.apache.hyracks.algebricks.runtime.base.IEvaluatorContext;
import org.apache.hyracks.algebricks.runtime.base.IScalarEvaluator;
@@ -35,37 +31,24 @@
import org.apache.hyracks.data.std.primitive.UTF8StringPointable;
@MissingNullInOutFunction
-public class StringPositionDescriptor extends AbstractStringOffsetConfigurableDescriptor {
+public class StringPositionDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
- @Override
- public IFunctionDescriptor createFunctionDescriptor() {
- return new StringPositionDescriptor();
- }
-
- @Override
- public IFunctionTypeInferer createFunctionTypeInferer() {
- return FunctionTypeInferers.SET_STRING_OFFSET;
- }
- };
+ public static final IFunctionDescriptorFactory FACTORY = StringPositionDescriptor::new;
@Override
public IScalarEvaluatorFactory createEvaluatorFactory(final IScalarEvaluatorFactory[] args) {
return new IScalarEvaluatorFactory() {
private static final long serialVersionUID = 1L;
- private final int baseOffset = stringOffset;
-
@Override
public IScalarEvaluator createScalarEvaluator(IEvaluatorContext ctx) throws HyracksDataException {
return new AbstractBinaryStringIntEval(ctx, args[0], args[1],
StringPositionDescriptor.this.getIdentifier(), sourceLoc) {
@Override
- protected int compute(UTF8StringPointable left, UTF8StringPointable right) throws IOException {
- int pos = UTF8StringPointable.find(left, right, false);
- return pos < 0 ? pos : pos + baseOffset;
+ protected int compute(UTF8StringPointable left, UTF8StringPointable right) {
+ return UTF8StringPointable.find(left, right, false);
}
};
}
@@ -76,5 +59,4 @@
public FunctionIdentifier getIdentifier() {
return BuiltinFunctions.STRING_POSITION;
}
-
}
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringPositionOffset1Descriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringPositionOffset1Descriptor.java
new file mode 100644
index 0000000..10cc779
--- /dev/null
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringPositionOffset1Descriptor.java
@@ -0,0 +1,63 @@
+/*
+ * 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.asterix.runtime.evaluators.functions;
+
+import org.apache.asterix.common.annotations.MissingNullInOutFunction;
+import org.apache.asterix.om.functions.BuiltinFunctions;
+import org.apache.asterix.om.functions.IFunctionDescriptorFactory;
+import org.apache.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
+import org.apache.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+import org.apache.hyracks.algebricks.runtime.base.IEvaluatorContext;
+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.data.std.primitive.UTF8StringPointable;
+
+@MissingNullInOutFunction
+public class StringPositionOffset1Descriptor extends AbstractScalarFunctionDynamicDescriptor {
+ private static final long serialVersionUID = 1L;
+
+ public static final IFunctionDescriptorFactory FACTORY = StringPositionOffset1Descriptor::new;
+
+ @Override
+ public IScalarEvaluatorFactory createEvaluatorFactory(final IScalarEvaluatorFactory[] args) {
+ return new IScalarEvaluatorFactory() {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public IScalarEvaluator createScalarEvaluator(IEvaluatorContext ctx) throws HyracksDataException {
+ return new AbstractBinaryStringIntEval(ctx, args[0], args[1],
+ StringPositionOffset1Descriptor.this.getIdentifier(), sourceLoc) {
+
+ @Override
+ protected int compute(UTF8StringPointable left, UTF8StringPointable right) {
+ int pos = UTF8StringPointable.find(left, right, false);
+ return pos < 0 ? pos : pos + 1;
+ }
+ };
+ }
+ };
+ }
+
+ @Override
+ public FunctionIdentifier getIdentifier() {
+ return BuiltinFunctions.STRING_POSITION_OFFSET_1;
+ }
+}
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 1d1d011..abeaf9f 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
@@ -20,7 +20,6 @@
import org.apache.asterix.common.annotations.MissingNullInOutFunction;
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;
@@ -35,12 +34,7 @@
public class StringRegExpContainsDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
- @Override
- public IFunctionDescriptor createFunctionDescriptor() {
- return new StringRegExpContainsDescriptor();
- }
- };
+ public static final IFunctionDescriptorFactory FACTORY = StringRegExpContainsDescriptor::new;
@Override
public IScalarEvaluatorFactory createEvaluatorFactory(final IScalarEvaluatorFactory[] args) {
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 7016581..5f6e782 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
@@ -24,7 +24,6 @@
import org.apache.asterix.common.annotations.MissingNullInOutFunction;
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;
@@ -39,12 +38,7 @@
public class StringRegExpContainsWithFlagDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
- @Override
- public IFunctionDescriptor createFunctionDescriptor() {
- return new StringRegExpContainsWithFlagDescriptor();
- }
- };
+ public static final IFunctionDescriptorFactory FACTORY = StringRegExpContainsWithFlagDescriptor::new;
@Override
public IScalarEvaluatorFactory createEvaluatorFactory(final IScalarEvaluatorFactory[] args) {
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 bfdcb1e..c84c62d 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
@@ -21,11 +21,9 @@
import org.apache.asterix.common.annotations.MissingNullInOutFunction;
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.om.functions.IFunctionTypeInferer;
+import org.apache.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
import org.apache.asterix.runtime.evaluators.functions.utils.RegExpMatcher;
-import org.apache.asterix.runtime.functions.FunctionTypeInferers;
import org.apache.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import org.apache.hyracks.algebricks.runtime.base.IEvaluatorContext;
import org.apache.hyracks.algebricks.runtime.base.IScalarEvaluator;
@@ -34,28 +32,16 @@
import org.apache.hyracks.data.std.primitive.UTF8StringPointable;
@MissingNullInOutFunction
-public class StringRegExpPositionDescriptor extends AbstractStringOffsetConfigurableDescriptor {
+public class StringRegExpPositionDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
- @Override
- public IFunctionDescriptor createFunctionDescriptor() {
- return new StringRegExpPositionDescriptor();
- }
-
- @Override
- public IFunctionTypeInferer createFunctionTypeInferer() {
- return FunctionTypeInferers.SET_STRING_OFFSET;
- }
- };
+ public static final IFunctionDescriptorFactory FACTORY = StringRegExpPositionDescriptor::new;
@Override
public IScalarEvaluatorFactory createEvaluatorFactory(final IScalarEvaluatorFactory[] args) {
return new IScalarEvaluatorFactory() {
private static final long serialVersionUID = 1L;
- private final int baseOffset = stringOffset;
-
@Override
public IScalarEvaluator createScalarEvaluator(IEvaluatorContext ctx) throws HyracksDataException {
return new AbstractBinaryStringIntEval(ctx, args[0], args[1],
@@ -66,8 +52,7 @@
protected int compute(UTF8StringPointable srcPtr, UTF8StringPointable patternPtr)
throws HyracksDataException {
matcher.build(srcPtr, patternPtr);
- int pos = matcher.position();
- return pos < 0 ? pos : pos + baseOffset;
+ return matcher.position();
}
};
}
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringRegExpPositionOffset1Descriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringRegExpPositionOffset1Descriptor.java
new file mode 100644
index 0000000..dd6925c
--- /dev/null
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringRegExpPositionOffset1Descriptor.java
@@ -0,0 +1,67 @@
+/*
+ * 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.asterix.runtime.evaluators.functions;
+
+import org.apache.asterix.common.annotations.MissingNullInOutFunction;
+import org.apache.asterix.om.functions.BuiltinFunctions;
+import org.apache.asterix.om.functions.IFunctionDescriptorFactory;
+import org.apache.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
+import org.apache.asterix.runtime.evaluators.functions.utils.RegExpMatcher;
+import org.apache.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+import org.apache.hyracks.algebricks.runtime.base.IEvaluatorContext;
+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.data.std.primitive.UTF8StringPointable;
+
+@MissingNullInOutFunction
+public class StringRegExpPositionOffset1Descriptor extends AbstractScalarFunctionDynamicDescriptor {
+ private static final long serialVersionUID = 1L;
+
+ public static final IFunctionDescriptorFactory FACTORY = StringRegExpPositionOffset1Descriptor::new;
+
+ @Override
+ public IScalarEvaluatorFactory createEvaluatorFactory(final IScalarEvaluatorFactory[] args) {
+ return new IScalarEvaluatorFactory() {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public IScalarEvaluator createScalarEvaluator(IEvaluatorContext ctx) throws HyracksDataException {
+ return new AbstractBinaryStringIntEval(ctx, args[0], args[1],
+ StringRegExpPositionOffset1Descriptor.this.getIdentifier(), sourceLoc) {
+ private final RegExpMatcher matcher = new RegExpMatcher();
+
+ @Override
+ protected int compute(UTF8StringPointable srcPtr, UTF8StringPointable patternPtr)
+ throws HyracksDataException {
+ matcher.build(srcPtr, patternPtr);
+ int pos = matcher.position();
+ return pos < 0 ? pos : pos + 1;
+ }
+ };
+ }
+ };
+ }
+
+ @Override
+ public FunctionIdentifier getIdentifier() {
+ return BuiltinFunctions.STRING_REGEXP_POSITION_OFFSET_1;
+ }
+}
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringRegExpPositionOffset1WithFlagDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringRegExpPositionOffset1WithFlagDescriptor.java
new file mode 100644
index 0000000..f0c8181
--- /dev/null
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringRegExpPositionOffset1WithFlagDescriptor.java
@@ -0,0 +1,67 @@
+/*
+ * 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.asterix.runtime.evaluators.functions;
+
+import org.apache.asterix.common.annotations.MissingNullInOutFunction;
+import org.apache.asterix.om.functions.BuiltinFunctions;
+import org.apache.asterix.om.functions.IFunctionDescriptorFactory;
+import org.apache.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
+import org.apache.asterix.runtime.evaluators.functions.utils.RegExpMatcher;
+import org.apache.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+import org.apache.hyracks.algebricks.runtime.base.IEvaluatorContext;
+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.data.std.primitive.UTF8StringPointable;
+
+@MissingNullInOutFunction
+public class StringRegExpPositionOffset1WithFlagDescriptor extends AbstractScalarFunctionDynamicDescriptor {
+ private static final long serialVersionUID = 1L;
+
+ public static final IFunctionDescriptorFactory FACTORY = StringRegExpPositionOffset1WithFlagDescriptor::new;
+
+ @Override
+ public IScalarEvaluatorFactory createEvaluatorFactory(final IScalarEvaluatorFactory[] args) {
+ return new IScalarEvaluatorFactory() {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public IScalarEvaluator createScalarEvaluator(IEvaluatorContext ctx) throws HyracksDataException {
+ return new AbstractTripleStringIntEval(ctx, args[0], args[1], args[2],
+ StringRegExpPositionOffset1WithFlagDescriptor.this.getIdentifier(), sourceLoc) {
+ private final RegExpMatcher matcher = new RegExpMatcher();
+
+ @Override
+ protected int compute(UTF8StringPointable srcPtr, UTF8StringPointable patternPtr,
+ UTF8StringPointable flagPtr) throws HyracksDataException {
+ matcher.build(srcPtr, patternPtr, flagPtr);
+ int pos = matcher.position();
+ return pos < 0 ? pos : pos + 1;
+ }
+ };
+ }
+ };
+ }
+
+ @Override
+ public FunctionIdentifier getIdentifier() {
+ return BuiltinFunctions.STRING_REGEXP_POSITION_OFFSET_1_WITH_FLAG;
+ }
+}
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 339b989..8dfd2a1 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
@@ -21,11 +21,9 @@
import org.apache.asterix.common.annotations.MissingNullInOutFunction;
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.om.functions.IFunctionTypeInferer;
+import org.apache.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
import org.apache.asterix.runtime.evaluators.functions.utils.RegExpMatcher;
-import org.apache.asterix.runtime.functions.FunctionTypeInferers;
import org.apache.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import org.apache.hyracks.algebricks.runtime.base.IEvaluatorContext;
import org.apache.hyracks.algebricks.runtime.base.IScalarEvaluator;
@@ -34,28 +32,16 @@
import org.apache.hyracks.data.std.primitive.UTF8StringPointable;
@MissingNullInOutFunction
-public class StringRegExpPositionWithFlagDescriptor extends AbstractStringOffsetConfigurableDescriptor {
+public class StringRegExpPositionWithFlagDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
- @Override
- public IFunctionDescriptor createFunctionDescriptor() {
- return new StringRegExpPositionWithFlagDescriptor();
- }
-
- @Override
- public IFunctionTypeInferer createFunctionTypeInferer() {
- return FunctionTypeInferers.SET_STRING_OFFSET;
- }
- };
+ public static final IFunctionDescriptorFactory FACTORY = StringRegExpPositionWithFlagDescriptor::new;
@Override
public IScalarEvaluatorFactory createEvaluatorFactory(final IScalarEvaluatorFactory[] args) {
return new IScalarEvaluatorFactory() {
private static final long serialVersionUID = 1L;
- private final int baseOffset = stringOffset;
-
@Override
public IScalarEvaluator createScalarEvaluator(IEvaluatorContext ctx) throws HyracksDataException {
return new AbstractTripleStringIntEval(ctx, args[0], args[1], args[2],
@@ -66,8 +52,7 @@
protected int compute(UTF8StringPointable srcPtr, UTF8StringPointable patternPtr,
UTF8StringPointable flagPtr) throws HyracksDataException {
matcher.build(srcPtr, patternPtr, flagPtr);
- int pos = matcher.position();
- return pos < 0 ? pos : pos + baseOffset;
+ return matcher.position();
}
};
}
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 9819d63..de32e12 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
@@ -20,7 +20,6 @@
import org.apache.asterix.common.annotations.MissingNullInOutFunction;
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;
@@ -35,12 +34,7 @@
public class StringRegExpReplaceDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
- @Override
- public IFunctionDescriptor createFunctionDescriptor() {
- return new StringRegExpReplaceDescriptor();
- }
- };
+ public static final IFunctionDescriptorFactory FACTORY = StringRegExpReplaceDescriptor::new;
@Override
public IScalarEvaluatorFactory createEvaluatorFactory(final IScalarEvaluatorFactory[] args) {
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/Substring2Descriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/Substring2Descriptor.java
index 41ae0c3..2ceca76 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/Substring2Descriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/Substring2Descriptor.java
@@ -18,103 +18,29 @@
*/
package org.apache.asterix.runtime.evaluators.functions;
-import java.io.DataOutput;
-import java.io.IOException;
-
import org.apache.asterix.common.annotations.MissingNullInOutFunction;
-import org.apache.asterix.om.base.AMutableInt32;
-import org.apache.asterix.om.exceptions.ExceptionUtil;
import org.apache.asterix.om.functions.BuiltinFunctions;
import org.apache.asterix.om.functions.IFunctionDescriptorFactory;
-import org.apache.asterix.om.types.ATypeTag;
-import org.apache.asterix.runtime.evaluators.common.ArgumentUtils;
-import org.apache.asterix.runtime.functions.FunctionTypeInferers;
-import org.apache.asterix.runtime.utils.DescriptorFactoryUtil;
+import org.apache.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
import org.apache.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import org.apache.hyracks.algebricks.runtime.base.IEvaluatorContext;
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.data.std.api.IPointable;
-import org.apache.hyracks.data.std.primitive.UTF8StringPointable;
-import org.apache.hyracks.data.std.primitive.VoidPointable;
-import org.apache.hyracks.data.std.util.ArrayBackedValueStorage;
-import org.apache.hyracks.data.std.util.GrowableArray;
-import org.apache.hyracks.data.std.util.UTF8StringBuilder;
-import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
@MissingNullInOutFunction
-public class Substring2Descriptor extends AbstractStringOffsetConfigurableDescriptor {
+public class Substring2Descriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public static final IFunctionDescriptorFactory FACTORY =
- DescriptorFactoryUtil.createFactory(Substring2Descriptor::new, FunctionTypeInferers.SET_STRING_OFFSET);
+ public static final IFunctionDescriptorFactory FACTORY = Substring2Descriptor::new;
@Override
public IScalarEvaluatorFactory createEvaluatorFactory(final IScalarEvaluatorFactory[] args) {
return new IScalarEvaluatorFactory() {
private static final long serialVersionUID = 1L;
- private final int baseOffset = stringOffset;
-
@Override
public IScalarEvaluator createScalarEvaluator(final IEvaluatorContext ctx) throws HyracksDataException {
- return new IScalarEvaluator() {
- private final ArrayBackedValueStorage resultStorage = new ArrayBackedValueStorage();
- private final DataOutput out = resultStorage.getDataOutput();
- private final IPointable argString = new VoidPointable();
- private final IPointable argStart = new VoidPointable();
- private final IScalarEvaluator evalString = args[0].createScalarEvaluator(ctx);
- private final IScalarEvaluator evalStart = args[1].createScalarEvaluator(ctx);
- private final GrowableArray array = new GrowableArray();
- private final UTF8StringBuilder builder = new UTF8StringBuilder();
- private final UTF8StringPointable string = new UTF8StringPointable();
- private final FunctionIdentifier funID = getIdentifier();
- private final AMutableInt32 mutableInt = new AMutableInt32(0);
-
- @Override
- public void evaluate(IFrameTupleReference tuple, IPointable result) throws HyracksDataException {
- resultStorage.reset();
- evalString.evaluate(tuple, argString);
- evalStart.evaluate(tuple, argStart);
-
- if (PointableHelper.checkAndSetMissingOrNull(result, argString, argStart)) {
- return;
- }
-
- byte[] bytes = argStart.getByteArray();
- int offset = argStart.getStartOffset();
- // check that the int argument is numeric without fractions (in case arg is double or float)
- if (!ArgumentUtils.checkWarnOrSetInteger(ctx, sourceLoc, funID, 1, bytes, offset, mutableInt)) {
- PointableHelper.setNull(result);
- return;
- }
- int start = mutableInt.getIntegerValue();
- bytes = argString.getByteArray();
- offset = argString.getStartOffset();
- int len = argString.getLength();
- if (bytes[offset] != ATypeTag.SERIALIZED_STRING_TYPE_TAG) {
- PointableHelper.setNull(result);
- ExceptionUtil.warnTypeMismatch(ctx, sourceLoc, funID, bytes[offset], 0, ATypeTag.STRING);
- return;
- }
- string.set(bytes, offset + 1, len - 1);
- array.reset();
- try {
- int actualStart = start >= 0 ? start - baseOffset : string.getStringLength() + start;
- boolean success =
- UTF8StringPointable.substr(string, actualStart, Integer.MAX_VALUE, builder, array);
- if (success) {
- out.writeByte(ATypeTag.SERIALIZED_STRING_TYPE_TAG);
- out.write(array.getByteArray(), 0, array.getLength());
- result.set(resultStorage);
- } else {
- PointableHelper.setNull(result);
- }
- } catch (IOException e) {
- throw HyracksDataException.create(e);
- }
- }
- };
+ return new Substring2Eval(ctx, args, getIdentifier(), sourceLoc, 0);
}
};
}
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/Substring2Eval.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/Substring2Eval.java
new file mode 100644
index 0000000..55cacb9
--- /dev/null
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/Substring2Eval.java
@@ -0,0 +1,113 @@
+/*
+ * 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.asterix.runtime.evaluators.functions;
+
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.asterix.common.annotations.MissingNullInOutFunction;
+import org.apache.asterix.om.base.AMutableInt32;
+import org.apache.asterix.om.exceptions.ExceptionUtil;
+import org.apache.asterix.om.types.ATypeTag;
+import org.apache.asterix.runtime.evaluators.common.ArgumentUtils;
+import org.apache.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+import org.apache.hyracks.algebricks.runtime.base.IEvaluatorContext;
+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.api.IPointable;
+import org.apache.hyracks.data.std.primitive.UTF8StringPointable;
+import org.apache.hyracks.data.std.primitive.VoidPointable;
+import org.apache.hyracks.data.std.util.ArrayBackedValueStorage;
+import org.apache.hyracks.data.std.util.GrowableArray;
+import org.apache.hyracks.data.std.util.UTF8StringBuilder;
+import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
+
+@MissingNullInOutFunction
+class Substring2Eval extends AbstractScalarEval {
+
+ private final IEvaluatorContext context;
+
+ private final ArrayBackedValueStorage resultStorage = new ArrayBackedValueStorage();
+ private final DataOutput out = resultStorage.getDataOutput();
+ private final IPointable argString = new VoidPointable();
+ private final IPointable argStart = new VoidPointable();
+ private final IScalarEvaluator evalString;
+ private final IScalarEvaluator evalStart;
+ private final GrowableArray array = new GrowableArray();
+ private final UTF8StringBuilder builder = new UTF8StringBuilder();
+ private final UTF8StringPointable string = new UTF8StringPointable();
+ private final AMutableInt32 mutableInt = new AMutableInt32(0);
+
+ private final int baseOffset;
+
+ Substring2Eval(IEvaluatorContext context, IScalarEvaluatorFactory[] args, FunctionIdentifier functionIdentifier,
+ SourceLocation sourceLoc, int baseOffset) throws HyracksDataException {
+ super(sourceLoc, functionIdentifier);
+ this.context = context;
+ this.baseOffset = baseOffset;
+ evalString = args[0].createScalarEvaluator(context);
+ evalStart = args[1].createScalarEvaluator(context);
+ }
+
+ @Override
+ public void evaluate(IFrameTupleReference tuple, IPointable result) throws HyracksDataException {
+ resultStorage.reset();
+ evalString.evaluate(tuple, argString);
+ evalStart.evaluate(tuple, argStart);
+
+ if (PointableHelper.checkAndSetMissingOrNull(result, argString, argStart)) {
+ return;
+ }
+
+ byte[] bytes = argStart.getByteArray();
+ int offset = argStart.getStartOffset();
+ // check that the int argument is numeric without fractions (in case arg is double or float)
+ if (!ArgumentUtils.checkWarnOrSetInteger(context, sourceLoc, functionIdentifier, 1, bytes, offset,
+ mutableInt)) {
+ PointableHelper.setNull(result);
+ return;
+ }
+ int start = mutableInt.getIntegerValue();
+ bytes = argString.getByteArray();
+ offset = argString.getStartOffset();
+ int len = argString.getLength();
+ if (bytes[offset] != ATypeTag.SERIALIZED_STRING_TYPE_TAG) {
+ PointableHelper.setNull(result);
+ ExceptionUtil.warnTypeMismatch(context, sourceLoc, functionIdentifier, bytes[offset], 0, ATypeTag.STRING);
+ return;
+ }
+ string.set(bytes, offset + 1, len - 1);
+ array.reset();
+ try {
+ int actualStart = start >= 0 ? start - baseOffset : string.getStringLength() + start;
+ boolean success = UTF8StringPointable.substr(string, actualStart, Integer.MAX_VALUE, builder, array);
+ if (success) {
+ out.writeByte(ATypeTag.SERIALIZED_STRING_TYPE_TAG);
+ out.write(array.getByteArray(), 0, array.getLength());
+ result.set(resultStorage);
+ } else {
+ PointableHelper.setNull(result);
+ }
+ } catch (IOException e) {
+ throw HyracksDataException.create(e);
+ }
+ }
+}
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/Substring2Offset1Descriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/Substring2Offset1Descriptor.java
new file mode 100644
index 0000000..9d8d1b8
--- /dev/null
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/Substring2Offset1Descriptor.java
@@ -0,0 +1,53 @@
+/*
+ * 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.asterix.runtime.evaluators.functions;
+
+import org.apache.asterix.common.annotations.MissingNullInOutFunction;
+import org.apache.asterix.om.functions.BuiltinFunctions;
+import org.apache.asterix.om.functions.IFunctionDescriptorFactory;
+import org.apache.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
+import org.apache.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+import org.apache.hyracks.algebricks.runtime.base.IEvaluatorContext;
+import org.apache.hyracks.algebricks.runtime.base.IScalarEvaluator;
+import org.apache.hyracks.algebricks.runtime.base.IScalarEvaluatorFactory;
+import org.apache.hyracks.api.exceptions.HyracksDataException;
+
+@MissingNullInOutFunction
+public class Substring2Offset1Descriptor extends AbstractScalarFunctionDynamicDescriptor {
+ private static final long serialVersionUID = 1L;
+ public static final IFunctionDescriptorFactory FACTORY = Substring2Offset1Descriptor::new;
+
+ @Override
+ public IScalarEvaluatorFactory createEvaluatorFactory(final IScalarEvaluatorFactory[] args) {
+ return new IScalarEvaluatorFactory() {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public IScalarEvaluator createScalarEvaluator(final IEvaluatorContext ctx) throws HyracksDataException {
+ return new Substring2Eval(ctx, args, getIdentifier(), sourceLoc, 1);
+ }
+ };
+ }
+
+ @Override
+ public FunctionIdentifier getIdentifier() {
+ return BuiltinFunctions.SUBSTRING2_OFFSET_1;
+ }
+
+}
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/SubstringDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/SubstringDescriptor.java
index 0dd2561..d1f8c3f 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/SubstringDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/SubstringDescriptor.java
@@ -18,115 +18,31 @@
*/
package org.apache.asterix.runtime.evaluators.functions;
-import java.io.DataOutput;
-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;
import org.apache.asterix.om.functions.IFunctionDescriptorFactory;
-import org.apache.asterix.om.functions.IFunctionTypeInferer;
-import org.apache.asterix.om.types.ATypeTag;
-import org.apache.asterix.om.types.hierachy.ATypeHierarchy;
-import org.apache.asterix.runtime.exceptions.TypeMismatchException;
-import org.apache.asterix.runtime.functions.FunctionTypeInferers;
+import org.apache.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
import org.apache.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import org.apache.hyracks.algebricks.runtime.base.IEvaluatorContext;
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.data.std.api.IPointable;
-import org.apache.hyracks.data.std.primitive.UTF8StringPointable;
-import org.apache.hyracks.data.std.primitive.VoidPointable;
-import org.apache.hyracks.data.std.util.ArrayBackedValueStorage;
-import org.apache.hyracks.data.std.util.GrowableArray;
-import org.apache.hyracks.data.std.util.UTF8StringBuilder;
-import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
@MissingNullInOutFunction
-public class SubstringDescriptor extends AbstractStringOffsetConfigurableDescriptor {
+public class SubstringDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
- @Override
- public IFunctionDescriptor createFunctionDescriptor() {
- return new SubstringDescriptor();
- }
-
- @Override
- public IFunctionTypeInferer createFunctionTypeInferer() {
- return FunctionTypeInferers.SET_STRING_OFFSET;
- }
- };
+ public static final IFunctionDescriptorFactory FACTORY = SubstringDescriptor::new;
@Override
public IScalarEvaluatorFactory createEvaluatorFactory(final IScalarEvaluatorFactory[] args) {
return new IScalarEvaluatorFactory() {
private static final long serialVersionUID = 1L;
- private final int baseOffset = stringOffset;
-
@Override
public IScalarEvaluator createScalarEvaluator(final IEvaluatorContext ctx) throws HyracksDataException {
- return new IScalarEvaluator() {
-
- private final ArrayBackedValueStorage resultStorage = new ArrayBackedValueStorage();
- private final DataOutput out = resultStorage.getDataOutput();
- private IPointable argString = new VoidPointable();
- private IPointable argStart = new VoidPointable();
- private IPointable argLen = new VoidPointable();
- private final IScalarEvaluator evalString = args[0].createScalarEvaluator(ctx);
- private final IScalarEvaluator evalStart = args[1].createScalarEvaluator(ctx);
- private final IScalarEvaluator evalLen = args[2].createScalarEvaluator(ctx);
-
- private final GrowableArray array = new GrowableArray();
- private final UTF8StringBuilder builder = new UTF8StringBuilder();
- private final UTF8StringPointable string = new UTF8StringPointable();
-
- @Override
- public void evaluate(IFrameTupleReference tuple, IPointable result) throws HyracksDataException {
- resultStorage.reset();
- evalString.evaluate(tuple, argString);
- evalStart.evaluate(tuple, argStart);
- evalLen.evaluate(tuple, argLen);
-
- if (PointableHelper.checkAndSetMissingOrNull(result, argString, argStart, argLen)) {
- return;
- }
-
- byte[] bytes = argStart.getByteArray();
- int offset = argStart.getStartOffset();
- int start = ATypeHierarchy.getIntegerValue(getIdentifier().getName(), 0, bytes, offset);
-
- bytes = argLen.getByteArray();
- offset = argLen.getStartOffset();
- int len = ATypeHierarchy.getIntegerValue(getIdentifier().getName(), 1, bytes, offset);
-
- bytes = argString.getByteArray();
- offset = argString.getStartOffset();
- int length = argString.getLength();
- if (bytes[offset] != ATypeTag.SERIALIZED_STRING_TYPE_TAG) {
- throw new TypeMismatchException(sourceLoc, getIdentifier(), 0, bytes[offset],
- ATypeTag.SERIALIZED_STRING_TYPE_TAG);
- }
- string.set(bytes, offset + 1, length - 1);
- array.reset();
- try {
- int actualStart = start >= 0 ? start - baseOffset : string.getStringLength() + start;
- boolean success = UTF8StringPointable.substr(string, actualStart, len, builder, array);
- if (success) {
- out.writeByte(ATypeTag.SERIALIZED_STRING_TYPE_TAG);
- out.write(array.getByteArray(), 0, array.getLength());
- result.set(resultStorage);
- } else {
- PointableHelper.setNull(result);
- }
- } catch (IOException e) {
- throw HyracksDataException.create(e);
- }
- }
- };
+ return new SubstringEval(ctx, args, getIdentifier(), sourceLoc, 0);
}
};
}
@@ -135,5 +51,4 @@
public FunctionIdentifier getIdentifier() {
return BuiltinFunctions.SUBSTRING;
}
-
}
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/SubstringEval.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/SubstringEval.java
new file mode 100644
index 0000000..993f5e6
--- /dev/null
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/SubstringEval.java
@@ -0,0 +1,112 @@
+/*
+ * 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.asterix.runtime.evaluators.functions;
+
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.asterix.common.annotations.MissingNullInOutFunction;
+import org.apache.asterix.om.types.ATypeTag;
+import org.apache.asterix.om.types.hierachy.ATypeHierarchy;
+import org.apache.asterix.runtime.exceptions.TypeMismatchException;
+import org.apache.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+import org.apache.hyracks.algebricks.runtime.base.IEvaluatorContext;
+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.api.IPointable;
+import org.apache.hyracks.data.std.primitive.UTF8StringPointable;
+import org.apache.hyracks.data.std.primitive.VoidPointable;
+import org.apache.hyracks.data.std.util.ArrayBackedValueStorage;
+import org.apache.hyracks.data.std.util.GrowableArray;
+import org.apache.hyracks.data.std.util.UTF8StringBuilder;
+import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
+
+@MissingNullInOutFunction
+class SubstringEval extends AbstractScalarEval {
+
+ private final ArrayBackedValueStorage resultStorage = new ArrayBackedValueStorage();
+ private final DataOutput out = resultStorage.getDataOutput();
+ private IPointable argString = new VoidPointable();
+ private IPointable argStart = new VoidPointable();
+ private IPointable argLen = new VoidPointable();
+ private final IScalarEvaluator evalString;
+ private final IScalarEvaluator evalStart;
+ private final IScalarEvaluator evalLen;
+ private final int baseOffset;
+
+ private final GrowableArray array = new GrowableArray();
+ private final UTF8StringBuilder builder = new UTF8StringBuilder();
+ private final UTF8StringPointable string = new UTF8StringPointable();
+
+ SubstringEval(IEvaluatorContext ctx, IScalarEvaluatorFactory[] args, FunctionIdentifier functionIdentifier,
+ SourceLocation sourceLoc, int baseOffset) throws HyracksDataException {
+ super(sourceLoc, functionIdentifier);
+
+ evalString = args[0].createScalarEvaluator(ctx);
+ evalStart = args[1].createScalarEvaluator(ctx);
+ evalLen = args[2].createScalarEvaluator(ctx);
+
+ this.baseOffset = baseOffset;
+ }
+
+ @Override
+ public void evaluate(IFrameTupleReference tuple, IPointable result) throws HyracksDataException {
+ resultStorage.reset();
+ evalString.evaluate(tuple, argString);
+ evalStart.evaluate(tuple, argStart);
+ evalLen.evaluate(tuple, argLen);
+
+ if (PointableHelper.checkAndSetMissingOrNull(result, argString, argStart, argLen)) {
+ return;
+ }
+
+ byte[] bytes = argStart.getByteArray();
+ int offset = argStart.getStartOffset();
+ int start = ATypeHierarchy.getIntegerValue(functionIdentifier.getName(), 0, bytes, offset);
+
+ bytes = argLen.getByteArray();
+ offset = argLen.getStartOffset();
+ int len = ATypeHierarchy.getIntegerValue(functionIdentifier.getName(), 1, bytes, offset);
+
+ bytes = argString.getByteArray();
+ offset = argString.getStartOffset();
+ int length = argString.getLength();
+ if (bytes[offset] != ATypeTag.SERIALIZED_STRING_TYPE_TAG) {
+ throw new TypeMismatchException(sourceLoc, functionIdentifier, 0, bytes[offset],
+ ATypeTag.SERIALIZED_STRING_TYPE_TAG);
+ }
+ string.set(bytes, offset + 1, length - 1);
+ array.reset();
+ try {
+ int actualStart = start >= 0 ? start - baseOffset : string.getStringLength() + start;
+ boolean success = UTF8StringPointable.substr(string, actualStart, len, builder, array);
+ if (success) {
+ out.writeByte(ATypeTag.SERIALIZED_STRING_TYPE_TAG);
+ out.write(array.getByteArray(), 0, array.getLength());
+ result.set(resultStorage);
+ } else {
+ PointableHelper.setNull(result);
+ }
+ } catch (IOException e) {
+ throw HyracksDataException.create(e);
+ }
+ }
+}
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/SubstringOffset1Descriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/SubstringOffset1Descriptor.java
new file mode 100644
index 0000000..6eda0ad
--- /dev/null
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/SubstringOffset1Descriptor.java
@@ -0,0 +1,54 @@
+/*
+ * 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.asterix.runtime.evaluators.functions;
+
+import org.apache.asterix.common.annotations.MissingNullInOutFunction;
+import org.apache.asterix.om.functions.BuiltinFunctions;
+import org.apache.asterix.om.functions.IFunctionDescriptorFactory;
+import org.apache.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
+import org.apache.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+import org.apache.hyracks.algebricks.runtime.base.IEvaluatorContext;
+import org.apache.hyracks.algebricks.runtime.base.IScalarEvaluator;
+import org.apache.hyracks.algebricks.runtime.base.IScalarEvaluatorFactory;
+import org.apache.hyracks.api.exceptions.HyracksDataException;
+
+@MissingNullInOutFunction
+public class SubstringOffset1Descriptor extends AbstractScalarFunctionDynamicDescriptor {
+
+ private static final long serialVersionUID = 1L;
+
+ public static final IFunctionDescriptorFactory FACTORY = SubstringOffset1Descriptor::new;
+
+ @Override
+ public IScalarEvaluatorFactory createEvaluatorFactory(final IScalarEvaluatorFactory[] args) {
+ return new IScalarEvaluatorFactory() {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public IScalarEvaluator createScalarEvaluator(final IEvaluatorContext ctx) throws HyracksDataException {
+ return new SubstringEval(ctx, args, getIdentifier(), sourceLoc, 1);
+ }
+ };
+ }
+
+ @Override
+ public FunctionIdentifier getIdentifier() {
+ return BuiltinFunctions.SUBSTRING_OFFSET_1;
+ }
+}
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/binary/AbstractFindBinaryEvaluator.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/binary/AbstractFindBinaryEvaluator.java
index 3ab47ee..56ceb49 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/binary/AbstractFindBinaryEvaluator.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/binary/AbstractFindBinaryEvaluator.java
@@ -38,7 +38,6 @@
public abstract class AbstractFindBinaryEvaluator extends AbstractBinaryScalarEvaluator {
private static final ATypeTag[] EXPECTED_INPUT_TAG = { ATypeTag.BINARY, ATypeTag.BINARY };
- protected final int baseOffset;
protected final AMutableInt64 result = new AMutableInt64(-1);
protected final ByteArrayPointable textPtr = new ByteArrayPointable();
protected final ByteArrayPointable wordPtr = new ByteArrayPointable();
@@ -48,9 +47,8 @@
SerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.AINT64);
public AbstractFindBinaryEvaluator(IEvaluatorContext context, IScalarEvaluatorFactory[] copyEvaluatorFactories,
- int baseOffset, FunctionIdentifier funcId, SourceLocation sourceLoc) throws HyracksDataException {
+ FunctionIdentifier funcId, SourceLocation sourceLoc) throws HyracksDataException {
super(context, copyEvaluatorFactories, funcId, sourceLoc);
- this.baseOffset = baseOffset;
}
@Override
@@ -85,7 +83,7 @@
wordPtr.set(pointables[1].getByteArray(), pointables[0].getStartOffset() + 1, pointables[1].getLength() - 1);
int pos = indexOf(textPtr.getByteArray(), textPtr.getContentStartOffset(), textPtr.getContentLength(),
wordPtr.getByteArray(), wordPtr.getContentStartOffset(), wordPtr.getContentLength(), fromOffset);
- result.setValue(pos < 0 ? pos : pos + baseOffset);
+ result.setValue(pos);
intSerde.serialize(result, dataOutput);
resultPointable.set(resultStorage);
}
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/binary/AbstractSubBinaryEvaluator.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/binary/AbstractSubBinaryEvaluator.java
index 345f753..078d2bd 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/binary/AbstractSubBinaryEvaluator.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/binary/AbstractSubBinaryEvaluator.java
@@ -39,14 +39,12 @@
private ByteArrayPointable byteArrayPointable = new ByteArrayPointable();
private byte[] metaBuffer = new byte[5];
- protected final int baseOffset;
private static final ATypeTag[] EXPECTED_INPUT_TAGS = { ATypeTag.BINARY, ATypeTag.INTEGER };
public AbstractSubBinaryEvaluator(IEvaluatorContext context, IScalarEvaluatorFactory[] copyEvaluatorFactories,
- int baseOffset, FunctionIdentifier funcId, SourceLocation sourceLoc) throws HyracksDataException {
+ FunctionIdentifier funcId, SourceLocation sourceLoc) throws HyracksDataException {
super(context, copyEvaluatorFactories, funcId, sourceLoc);
- this.baseOffset = baseOffset;
}
@Override
@@ -86,8 +84,7 @@
int subStart;
- subStart = ATypeHierarchy.getIntegerValue(BuiltinFunctions.SUBBINARY_FROM.getName(), 1, startBytes, offset)
- - baseOffset;
+ subStart = ATypeHierarchy.getIntegerValue(BuiltinFunctions.SUBBINARY_FROM.getName(), 1, startBytes, offset);
int totalLength = byteArrayPointable.getContentLength();
int subLength = getSubLength(tuple);
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/binary/FindBinaryDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/binary/FindBinaryDescriptor.java
index 54b146f..c59699f 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/binary/FindBinaryDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/binary/FindBinaryDescriptor.java
@@ -21,11 +21,8 @@
import org.apache.asterix.common.annotations.MissingNullInOutFunction;
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.om.functions.IFunctionTypeInferer;
-import org.apache.asterix.runtime.evaluators.functions.AbstractStringOffsetConfigurableDescriptor;
-import org.apache.asterix.runtime.functions.FunctionTypeInferers;
+import org.apache.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
import org.apache.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import org.apache.hyracks.algebricks.runtime.base.IEvaluatorContext;
import org.apache.hyracks.algebricks.runtime.base.IScalarEvaluator;
@@ -34,19 +31,9 @@
import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
@MissingNullInOutFunction
-public class FindBinaryDescriptor extends AbstractStringOffsetConfigurableDescriptor {
+public class FindBinaryDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
- @Override
- public IFunctionDescriptor createFunctionDescriptor() {
- return new FindBinaryDescriptor();
- }
-
- @Override
- public IFunctionTypeInferer createFunctionTypeInferer() {
- return FunctionTypeInferers.SET_STRING_OFFSET;
- }
- };
+ public static final IFunctionDescriptorFactory FACTORY = FindBinaryDescriptor::new;
@Override
public FunctionIdentifier getIdentifier() {
@@ -58,11 +45,9 @@
return new IScalarEvaluatorFactory() {
private static final long serialVersionUID = 1L;
- private final int baseOffset = stringOffset;
-
@Override
public IScalarEvaluator createScalarEvaluator(final IEvaluatorContext ctx) throws HyracksDataException {
- return new AbstractFindBinaryEvaluator(ctx, args, baseOffset, getIdentifier(), sourceLoc) {
+ return new AbstractFindBinaryEvaluator(ctx, args, getIdentifier(), sourceLoc) {
@Override
protected int getFromOffset(IFrameTupleReference tuple) {
return 0;
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/binary/FindBinaryFromDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/binary/FindBinaryFromDescriptor.java
index 80ffbca..a573394 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/binary/FindBinaryFromDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/binary/FindBinaryFromDescriptor.java
@@ -21,12 +21,9 @@
import org.apache.asterix.common.annotations.MissingNullInOutFunction;
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.om.functions.IFunctionTypeInferer;
import org.apache.asterix.om.types.hierachy.ATypeHierarchy;
-import org.apache.asterix.runtime.evaluators.functions.AbstractStringOffsetConfigurableDescriptor;
-import org.apache.asterix.runtime.functions.FunctionTypeInferers;
+import org.apache.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
import org.apache.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import org.apache.hyracks.algebricks.runtime.base.IEvaluatorContext;
import org.apache.hyracks.algebricks.runtime.base.IScalarEvaluator;
@@ -35,20 +32,10 @@
import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
@MissingNullInOutFunction
-public class FindBinaryFromDescriptor extends AbstractStringOffsetConfigurableDescriptor {
+public class FindBinaryFromDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
- @Override
- public IFunctionDescriptor createFunctionDescriptor() {
- return new FindBinaryFromDescriptor();
- }
-
- @Override
- public IFunctionTypeInferer createFunctionTypeInferer() {
- return FunctionTypeInferers.SET_STRING_OFFSET;
- }
- };
+ public static final IFunctionDescriptorFactory FACTORY = FindBinaryFromDescriptor::new;
@Override
public FunctionIdentifier getIdentifier() {
@@ -60,15 +47,13 @@
return new IScalarEvaluatorFactory() {
private static final long serialVersionUID = 1L;
- private final int baseOffset = stringOffset;
-
@Override
public IScalarEvaluator createScalarEvaluator(final IEvaluatorContext ctx) throws HyracksDataException {
- return new AbstractFindBinaryEvaluator(ctx, args, baseOffset, getIdentifier(), sourceLoc) {
+ return new AbstractFindBinaryEvaluator(ctx, args, getIdentifier(), sourceLoc) {
@Override
protected int getFromOffset(IFrameTupleReference tuple) throws HyracksDataException {
return ATypeHierarchy.getIntegerValue(getIdentifier().getName(), 2,
- pointables[2].getByteArray(), pointables[2].getStartOffset()) - baseOffset;
+ pointables[2].getByteArray(), pointables[2].getStartOffset());
}
};
}
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/binary/SubBinaryFromDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/binary/SubBinaryFromDescriptor.java
index fa6ff88..16a181d 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/binary/SubBinaryFromDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/binary/SubBinaryFromDescriptor.java
@@ -21,11 +21,8 @@
import org.apache.asterix.common.annotations.MissingNullInOutFunction;
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.om.functions.IFunctionTypeInferer;
-import org.apache.asterix.runtime.evaluators.functions.AbstractStringOffsetConfigurableDescriptor;
-import org.apache.asterix.runtime.functions.FunctionTypeInferers;
+import org.apache.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
import org.apache.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import org.apache.hyracks.algebricks.runtime.base.IEvaluatorContext;
import org.apache.hyracks.algebricks.runtime.base.IScalarEvaluator;
@@ -34,19 +31,9 @@
import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
@MissingNullInOutFunction
-public class SubBinaryFromDescriptor extends AbstractStringOffsetConfigurableDescriptor {
+public class SubBinaryFromDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
- @Override
- public IFunctionDescriptor createFunctionDescriptor() {
- return new SubBinaryFromDescriptor();
- }
-
- @Override
- public IFunctionTypeInferer createFunctionTypeInferer() {
- return FunctionTypeInferers.SET_STRING_OFFSET;
- }
- };
+ public static final IFunctionDescriptorFactory FACTORY = SubBinaryFromDescriptor::new;
@Override
public FunctionIdentifier getIdentifier() {
@@ -58,11 +45,9 @@
return new IScalarEvaluatorFactory() {
private static final long serialVersionUID = 1L;
- private final int baseOffset = stringOffset;
-
@Override
public IScalarEvaluator createScalarEvaluator(final IEvaluatorContext ctx) throws HyracksDataException {
- return new AbstractSubBinaryEvaluator(ctx, args, baseOffset, getIdentifier(), sourceLoc) {
+ return new AbstractSubBinaryEvaluator(ctx, args, getIdentifier(), sourceLoc) {
@Override
protected int getSubLength(IFrameTupleReference tuple) {
return Integer.MAX_VALUE;
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/binary/SubBinaryFromToDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/binary/SubBinaryFromToDescriptor.java
index 8926e21..6a1c688 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/binary/SubBinaryFromToDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/binary/SubBinaryFromToDescriptor.java
@@ -21,12 +21,9 @@
import org.apache.asterix.common.annotations.MissingNullInOutFunction;
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.om.functions.IFunctionTypeInferer;
import org.apache.asterix.om.types.hierachy.ATypeHierarchy;
-import org.apache.asterix.runtime.evaluators.functions.AbstractStringOffsetConfigurableDescriptor;
-import org.apache.asterix.runtime.functions.FunctionTypeInferers;
+import org.apache.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
import org.apache.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import org.apache.hyracks.algebricks.runtime.base.IEvaluatorContext;
import org.apache.hyracks.algebricks.runtime.base.IScalarEvaluator;
@@ -35,19 +32,9 @@
import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
@MissingNullInOutFunction
-public class SubBinaryFromToDescriptor extends AbstractStringOffsetConfigurableDescriptor {
+public class SubBinaryFromToDescriptor extends AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
- public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
- @Override
- public IFunctionDescriptor createFunctionDescriptor() {
- return new SubBinaryFromToDescriptor();
- }
-
- @Override
- public IFunctionTypeInferer createFunctionTypeInferer() {
- return FunctionTypeInferers.SET_STRING_OFFSET;
- }
- };
+ public static final IFunctionDescriptorFactory FACTORY = SubBinaryFromToDescriptor::new;
@Override
public FunctionIdentifier getIdentifier() {
@@ -59,12 +46,10 @@
return new IScalarEvaluatorFactory() {
private static final long serialVersionUID = 1L;
- private final int baseOffset = stringOffset;
-
@Override
public IScalarEvaluator createScalarEvaluator(final IEvaluatorContext ctx) throws HyracksDataException {
- return new AbstractSubBinaryEvaluator(ctx, args, baseOffset, getIdentifier(), sourceLoc) {
+ return new AbstractSubBinaryEvaluator(ctx, args, getIdentifier(), sourceLoc) {
@Override
protected int getSubLength(IFrameTupleReference tuple) throws HyracksDataException {
return ATypeHierarchy.getIntegerValue(getIdentifier().getName(), 2,
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/functions/FunctionCollection.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/functions/FunctionCollection.java
index 1fa9462..d526d34 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/functions/FunctionCollection.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/functions/FunctionCollection.java
@@ -408,6 +408,7 @@
import org.apache.asterix.runtime.evaluators.functions.StringLikeDescriptor;
import org.apache.asterix.runtime.evaluators.functions.StringLowerCaseDescriptor;
import org.apache.asterix.runtime.evaluators.functions.StringPositionDescriptor;
+import org.apache.asterix.runtime.evaluators.functions.StringPositionOffset1Descriptor;
import org.apache.asterix.runtime.evaluators.functions.StringRTrim2Descriptor;
import org.apache.asterix.runtime.evaluators.functions.StringRTrimDescriptor;
import org.apache.asterix.runtime.evaluators.functions.StringRegExpContainsDescriptor;
@@ -415,6 +416,8 @@
import org.apache.asterix.runtime.evaluators.functions.StringRegExpLikeDescriptor;
import org.apache.asterix.runtime.evaluators.functions.StringRegExpLikeWithFlagDescriptor;
import org.apache.asterix.runtime.evaluators.functions.StringRegExpPositionDescriptor;
+import org.apache.asterix.runtime.evaluators.functions.StringRegExpPositionOffset1Descriptor;
+import org.apache.asterix.runtime.evaluators.functions.StringRegExpPositionOffset1WithFlagDescriptor;
import org.apache.asterix.runtime.evaluators.functions.StringRegExpPositionWithFlagDescriptor;
import org.apache.asterix.runtime.evaluators.functions.StringRegExpReplaceDescriptor;
import org.apache.asterix.runtime.evaluators.functions.StringRegExpReplaceWithFlagDescriptor;
@@ -429,9 +432,11 @@
import org.apache.asterix.runtime.evaluators.functions.StringTrimDescriptor;
import org.apache.asterix.runtime.evaluators.functions.StringUpperCaseDescriptor;
import org.apache.asterix.runtime.evaluators.functions.Substring2Descriptor;
+import org.apache.asterix.runtime.evaluators.functions.Substring2Offset1Descriptor;
import org.apache.asterix.runtime.evaluators.functions.SubstringAfterDescriptor;
import org.apache.asterix.runtime.evaluators.functions.SubstringBeforeDescriptor;
import org.apache.asterix.runtime.evaluators.functions.SubstringDescriptor;
+import org.apache.asterix.runtime.evaluators.functions.SubstringOffset1Descriptor;
import org.apache.asterix.runtime.evaluators.functions.SwitchCaseDescriptor;
import org.apache.asterix.runtime.evaluators.functions.ToArrayDescriptor;
import org.apache.asterix.runtime.evaluators.functions.ToAtomicDescriptor;
@@ -966,11 +971,13 @@
fc.add(StringEndsWithDescriptor.FACTORY);
fc.add(StringStartsWithDescriptor.FACTORY);
fc.add(SubstringDescriptor.FACTORY);
+ fc.add(SubstringOffset1Descriptor.FACTORY);
fc.add(StringEqualDescriptor.FACTORY);
fc.add(StringLowerCaseDescriptor.FACTORY);
fc.add(StringUpperCaseDescriptor.FACTORY);
fc.add(StringLengthDescriptor.FACTORY);
fc.add(Substring2Descriptor.FACTORY);
+ fc.add(Substring2Offset1Descriptor.FACTORY);
fc.add(SubstringBeforeDescriptor.FACTORY);
fc.add(SubstringAfterDescriptor.FACTORY);
fc.add(StringToCodePointDescriptor.FACTORY);
@@ -982,7 +989,9 @@
fc.add(StringRegExpLikeDescriptor.FACTORY);
fc.add(StringRegExpLikeWithFlagDescriptor.FACTORY);
fc.add(StringRegExpPositionDescriptor.FACTORY);
+ fc.add(StringRegExpPositionOffset1Descriptor.FACTORY);
fc.add(StringRegExpPositionWithFlagDescriptor.FACTORY);
+ fc.add(StringRegExpPositionOffset1WithFlagDescriptor.FACTORY);
fc.add(StringRegExpReplaceDescriptor.FACTORY);
fc.add(StringRegExpReplaceWithFlagDescriptor.FACTORY);
fc.add(StringInitCapDescriptor.FACTORY);
@@ -993,6 +1002,7 @@
fc.add(StringLTrim2Descriptor.FACTORY);
fc.add(StringRTrim2Descriptor.FACTORY);
fc.add(StringPositionDescriptor.FACTORY);
+ fc.add(StringPositionOffset1Descriptor.FACTORY);
fc.add(StringRepeatDescriptor.FACTORY);
fc.add(StringReplaceDescriptor.FACTORY);
fc.add(StringReplaceWithLimitDescriptor.FACTORY);
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/functions/FunctionTypeInferers.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/functions/FunctionTypeInferers.java
index 5dc56dd..414f0eb 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/functions/FunctionTypeInferers.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/functions/FunctionTypeInferers.java
@@ -61,14 +61,6 @@
}
};
- public static final IFunctionTypeInferer SET_STRING_OFFSET = new IFunctionTypeInferer() {
- @Override
- public void infer(ILogicalExpression expr, IFunctionDescriptor fd, IVariableTypeEnvironment context,
- CompilerProperties compilerProps) {
- fd.setImmutableStates(compilerProps.getStringOffset());
- }
- };
-
public static final IFunctionTypeInferer SET_ARGUMENT_TYPE = new IFunctionTypeInferer() {
@Override
public void infer(ILogicalExpression expr, IFunctionDescriptor fd, IVariableTypeEnvironment context,