This is an automated email from the ASF dual-hosted git repository.
zstan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
The following commit(s) were added to refs/heads/main by this push:
new a201106e59 IGNITE-21958: Extend test coverage for SQL E021-11(POSITION
function) (#3883)
a201106e59 is described below
commit a201106e59304756ea7114a10285ebafc164a68a
Author: Max Zhuravkov <[email protected]>
AuthorDate: Fri Jun 7 12:38:06 2024 +0300
IGNITE-21958: Extend test coverage for SQL E021-11(POSITION function)
(#3883)
---
.../sql/function/blob/test_position.test | 11 ++++
.../sql/function/string/test_position.test | 66 +++++++++++++++++-----
2 files changed, 63 insertions(+), 14 deletions(-)
diff --git
a/modules/sql-engine/src/integrationTest/sql/function/blob/test_position.test
b/modules/sql-engine/src/integrationTest/sql/function/blob/test_position.test
index 6d724c4230..2c9ebed903 100644
---
a/modules/sql-engine/src/integrationTest/sql/function/blob/test_position.test
+++
b/modules/sql-engine/src/integrationTest/sql/function/blob/test_position.test
@@ -1,6 +1,7 @@
# name: sql/function/blob/test_position.test
# description: BLOB functions tests
# feature: T021(BINARY and VARBINARY data types)
+# feature: SQL E021-11(POSITION function)
# group: [blob]
#sql standard, 6.30 <numeric value function> If <binary position expression>
is specified
@@ -46,3 +47,13 @@ null
statement error
SELECT POSITION('a' IN x'0B03B0B0');
+
+#Update error message
+#https://issues.apache.org/jira/browse/IGNITE-22418 parser does not expect
USING clause
+statement error
+SELECT POSITION(x'03' IN x'0B03' USING CHARACTERS);
+
+#Update error message
+#https://issues.apache.org/jira/browse/IGNITE-22418 parser does not expect
USING clause
+statement error
+SELECT POSITION(x'03' IN x'0B03' USING OCTETS);
diff --git
a/modules/sql-engine/src/integrationTest/sql/function/string/test_position.test
b/modules/sql-engine/src/integrationTest/sql/function/string/test_position.test
index a27b3afd2a..56fbc50a07 100644
---
a/modules/sql-engine/src/integrationTest/sql/function/string/test_position.test
+++
b/modules/sql-engine/src/integrationTest/sql/function/string/test_position.test
@@ -1,58 +1,96 @@
# name: test/sql/function/string/test_position.test
# description: Just simple test to check support of POSITION function.
+# feature: SQL E021-11(POSITION function)
# group: [string]
query T
-select position('g' in 'Gridgain.com')
+SELECT POSITION('c' IN 'Concrete')
----
-5
+4
query T
-select position('G' in 'Gridgain.com')
+SELECT POSITION('C' IN 'Concrete')
----
1
query T
-select position('Z' in 'Gridgain.com')
+SELECT POSITION('Z' IN 'Concrete')
----
0
query T
-select position('i' in 'Gridgain.com')
+SELECT POSITION('e' IN 'Concrete')
----
-3
+6
query T
-select position('i' in null)
+SELECT POSITION('e' IN null)
----
NULL
query T
-select position(NULL in 'Gridgain.com')
+SELECT POSITION(NULL IN 'Concrete')
----
NULL
query T
-select position(NULL in null)
+select position(NULL IN null)
----
NULL
query T
-select position('i' in 'Gridgain.com' FROM 5)
+SELECT POSITION('e' IN 'Concrete' FROM 7)
----
-7
+8
query T
-select position('i' in 'Gridgain.com' FROM 8)
+SELECT POSITION('i' IN 'Concrete' FROM 8)
----
0
query T
-select position('i' in 'Gridgain.com' FROM 100)
+SELECT POSITION('e' IN 'Concrete' FROM 100)
----
0
query T
-select position('i' in null FROM 8)
+SELECT POSITION('e' IN null FROM 8)
----
NULL
+
+query IIT
+SELECT i, p, c FROM
+ (SELECT i, POSITION(c IN 'abc') as p, c FROM (VALUES (1, 'a'), (2, 'b'), (3,
'c'), (4, null), (5, 'x') ) t(i, c))
+ t (i, p, c) ORDER BY i
+----
+1 1 a
+2 2 b
+3 3 c
+4 NULL NULL
+5 0 x
+
+
+#TODO https://issues.apache.org/jira/browse/IGNITE-22417
+#The Actual error i while resolving method 'position[class java.lang.String,
class java.lang.Object, long]
+statement error: while resolving method 'position
+SELECT POSITION('i' IN null FROM 0::BIGINT)
+
+#TODO https://issues.apache.org/jira/browse/IGNITE-22417
+#The Actual error i while resolving method 'position[class java.lang.String,
class java.lang.String, long]
+statement error: while resolving method 'position
+SELECT POSITION('a' IN 'abc' FROM p) FROM (VALUES (0::BIGINT), (1)) t(p)
+
+
+skipif ignite3
+#https://issues.apache.org/jira/browse/IGNITE-22418 parser does not expect
USING clause
+query T
+SELECT POSITION('C' IN 'Concrete' USING CHARACTERS)
+----
+1
+
+skipif ignite3
+#https://issues.apache.org/jira/browse/IGNITE-22418 parser does not expect
USING clause
+query T
+SELECT POSITION('C' IN 'Concrete' USING OCTETS)
+----
+1