wecisecode 2 hete
szülő
commit
4d92e22db0

+ 3 - 1
odbctest/mql/basic/10basic/39init.mql

@@ -1,5 +1,6 @@
 
 create class if not exists /test() with namespace="test"
+;
 
 delete from /test/foo with version
 /**
@@ -16,6 +17,7 @@ create class if not exists /test/foo (
 		v_varchar		varchar,
 		v_text			text,
 		v_string		text,
+		v_chars         varchar,
 		v_int			int,
 		v_bigint		bigint,
 		v_double		double,
@@ -26,7 +28,7 @@ create class if not exists /test/foo (
 		v_map           map<varchar,float>,
 		v_list          list<varchar>,
 		
-		indexes(v_varchar, v_text, v_string, v_int, v_bigint, v_double, v_float, v_bool, v_set, v_map, v_list),
+		indexes(v_varchar, v_text, v_string, v_chars, v_int, v_bigint, v_double, v_float, v_bool, v_set, v_map, v_list),
 		keys(v_varchar, v_text)
 	) with core=cassandraonly;
 

+ 22 - 22
odbctest/mql/basic/10basic/41.insert.mql

@@ -1,10 +1,10 @@
 
-insert into /test/foo (v_varchar, v_text, v_int, v_bigint, v_float, v_double, v_bool, v_set, v_list, v_map, v_blob, vtime)
- values ('1', '1', 1, 1, 1.1234567890123456, 1.1234567890123457, true, ["a"], ["a"], {"a":1.1}, "hello", "1970-01-01 00:00:00.000001"  )
+insert into /test/foo (v_varchar, v_text, v_string, v_chars, v_int, v_bigint, v_float, v_double, v_bool, v_set, v_list, v_map, v_blob, vtime)
+ values ('1', '1', '1', 'x', 1, 1, 1.1234567890123456, 1.1234567890123457, true, ["a"], ["a"], {"a":1.1}, "hello", "1970-01-01 00:00:00.000001"  )
 ;
 
-insert into /test/foo (v_varchar, v_text, v_int, v_bigint, v_float, v_double, v_bool, v_set, v_list, v_map, v_blob, vtime)
- values ('1', '1', 1, 1, 1.1234567890123456, 1.1234567890123457, true, ["a"], ["a"], {"a":1.1}, "hello", "0001-01-01 00:00:00.000000"   )
+insert into /test/foo (v_varchar, v_text, v_string, v_chars, v_int, v_bigint, v_float, v_double, v_bool, v_set, v_list, v_map, v_blob, vtime)
+ values ('1', '1', '1', 'a', 1, 1, 1.1234567890123456, 1.1234567890123457, true, ["a"], ["a"], {"a":1.1}, "hello", "0001-01-01 00:00:00.000000"   )
 ;
 
 update /test/foo set vtime='0001-01-03 00:00:00.000000' where v_varchar='1'
@@ -16,41 +16,41 @@ params('1900-12-31 23:59:59.000001')
 **/
 ;
 
-insert into /test/foo (v_varchar, v_text, v_int, v_bigint, v_float, v_double, v_bool, v_set, v_list, v_map, v_blob)
- values ('2', '2', 2, 2, 2.1, 2.1, false, ["a"], ["a"], {"a":1.1}, "hello"  )
+insert into /test/foo (v_varchar, v_text, v_string, v_chars, v_int, v_bigint, v_float, v_double, v_bool, v_set, v_list, v_map, v_blob)
+ values ('2', '2', '2', 'b', 2, 2, 2.1, 2.1, false, ["a"], ["a"], {"a":1.1}, "hello"  )
 ;
 
-insert into /test/foo (v_varchar, v_text, v_int, v_bigint, v_float, v_double, v_bool, v_set, v_list, v_map, v_blob)
- values ('3', '2', 2, 2, 2.2, 2.2, true, ["a"], ["a"], {"a":1.1}, "hello"  )
+insert into /test/foo (v_varchar, v_text, v_string, v_chars, v_int, v_bigint, v_float, v_double, v_bool, v_set, v_list, v_map, v_blob)
+ values ('3', '2', '2', 'b', 2, 2, 2.2, 2.2, true, ["a"], ["a"], {"a":1.1}, "hello"  )
 ;
 
-insert into /test/foo (v_varchar, v_text, v_int, v_bigint, v_float, v_double, v_bool, v_set, v_list, v_map, v_blob)
- values ('4', '3', 3, 3, 3.1, 3.1, false, ["a"], ["a"], {"a":1.1}, "hello"  )
+insert into /test/foo (v_varchar, v_text, v_string, v_chars, v_int, v_bigint, v_float, v_double, v_bool, v_set, v_list, v_map, v_blob)
+ values ('4', '3', '3', 'c', 3, 3, 3.1, 3.1, false, ["a"], ["a"], {"a":1.1}, "hello"  )
 ;
 
-insert into /test/foo (v_varchar, v_text, v_int, v_bigint, v_float, v_double, v_bool, v_set, v_list, v_map, v_blob)
- values ('5', '3', 3, 3, 3.2, 3.3, false, ["a"], ["a"], {"a":1.1}, "hello"  )
+insert into /test/foo (v_varchar, v_text, v_string, v_chars, v_int, v_bigint, v_float, v_double, v_bool, v_set, v_list, v_map, v_blob)
+ values ('5', '3', '3', 'c', 3, 3, 3.2, 3.3, false, ["a"], ["a"], {"a":1.1}, "hello"  )
 ;
 
-insert into /test/foo (v_varchar, v_text, v_int, v_bigint, v_float, v_double, v_bool, v_set, v_list, v_map, v_blob)
- values ('6', '3', 3, 3, 3.3, 3.5, false, ["a"], ["a"], {"a":1.1}, "hello"  )
+insert into /test/foo (v_varchar, v_text, v_string, v_chars, v_int, v_bigint, v_float, v_double, v_bool, v_set, v_list, v_map, v_blob)
+ values ('6', '3', '3', 'c', 3, 3, 3.3, 3.5, false, ["a"], ["a"], {"a":1.1}, "hello"  )
 ;
 
 
-insert into /test/foo (v_varchar, v_text, v_int, v_bigint, v_float, v_double, v_bool, v_set, v_list, v_map, v_blob)
- values ('7', '4', 4, 4, 3.1, 3.1, false, ["a"], ["a"], {"a":1.1}, "hello"  )
+insert into /test/foo (v_varchar, v_text, v_string, v_chars, v_int, v_bigint, v_float, v_double, v_bool, v_set, v_list, v_map, v_blob)
+ values ('7', '4', '4', 'd', 4, 4, 3.1, 3.1, false, ["a"], ["a"], {"a":1.1}, "hello"  )
 ;
 
-insert into /test/foo (v_varchar, v_text, v_int, v_bigint, v_float, v_double, v_bool, v_set, v_list, v_map, v_blob)
- values ('8', '4', 4, 4, 3.2, 3.3, false, ["a"], ["a"], {"a":1.1}, "hello"  )
+insert into /test/foo (v_varchar, v_text, v_string, v_chars, v_int, v_bigint, v_float, v_double, v_bool, v_set, v_list, v_map, v_blob)
+ values ('8', '4', '4', 'd', 4, 4, 3.2, 3.3, false, ["a"], ["a"], {"a":1.1}, "hello"  )
 ;
 
-insert into /test/foo (v_varchar, v_text, v_int, v_bigint, v_float, v_double, v_bool, v_set, v_list, v_map, v_blob)
- values ('9', '4', 4, 4, 3.3, 3.5, false, ["a"], ["a"], {"a":1.1}, "hello"  )
+insert into /test/foo (v_varchar, v_text, v_string, v_chars, v_int, v_bigint, v_float, v_double, v_bool, v_set, v_list, v_map, v_blob)
+ values ('9', '4', '4', 'd', 4, 4, 3.3, 3.5, false, ["a"], ["a"], {"a":1.1}, "hello"  )
 ;
 
-insert into /test/foo (v_varchar, v_text, v_int, v_bigint, v_float, v_double, v_bool, v_set, v_list, v_map, v_blob)
- values ('a', '4', 4, 4, 3.4, 3.7, false, ["a"], ["a"], {"a":1.1}, "hello"  )
+insert into /test/foo (v_varchar, v_text, v_string, v_chars, v_int, v_bigint, v_float, v_double, v_bool, v_set, v_list, v_map, v_blob)
+ values ('a', '4', '4', 'd', 4, 4, 3.4, 3.7, false, ["a"], ["a"], {"a":1.1}, "hello"  )
 ;
 
 

+ 31 - 0
odbctest/mql/basic/10basic/51orderby.mql

@@ -0,0 +1,31 @@
+
+
+
+select id,v_chars as "文字" from /test/foo order by "文字"
+/**
+output()
+**/
+;
+
+select count(*), aa.v_chars as "文字" from /test/foo aa
+group by aa.v_chars order by "文字" desc
+/**
+output()
+match('文字','d',count,4)
+match('文字','c',count,3)
+match('文字','b',count,2)
+match('文字','a',count,1)
+**/
+;
+
+select count(*), aa.v_chars as "文字" from 
+(select * from /test/foo) aa
+group by aa.v_chars order by "文字" desc
+/**
+output()
+match('文字','d',count,4)
+match('文字','c',count,3)
+match('文字','b',count,2)
+match('文字','a',count,1)
+**/
+;

+ 183 - 0
odbctest/mql/basic/10basic/52count.mql

@@ -0,0 +1,183 @@
+
+
+select count(), v_chars as "文字" from /test/foo 
+group by v_chars order by "文字" desc
+/**
+output()
+match('文字','d',count,4)
+match('文字','c',count,3)
+match('文字','b',count,2)
+match('文字','a',count,1)
+**/
+;
+
+select count(*), v_chars as "文字" from /test/foo 
+group by v_chars order by "文字" desc
+/**
+output()
+match('文字','d',count,4)
+match('文字','c',count,3)
+match('文字','b',count,2)
+match('文字','a',count,1)
+**/
+;
+
+select count(id), v_chars as "文字" from /test/foo 
+group by v_chars order by "文字" desc
+/**
+output()
+match('文字','d',count,4)
+match('文字','c',count,3)
+match('文字','b',count,2)
+match('文字','a',count,1)
+**/
+;
+
+-- 不支持这种写法 distinct 后面必须带字段名
+select count(distinct), v_chars as "文字" from /test/foo 
+group by v_chars order by "文字" desc
+/**
+onerror(continue,"not exist")
+noerrinfo()
+**/
+;
+
+select count(distinct *), v_chars as "文字" from /test/foo 
+group by v_chars order by "文字" desc
+/**
+output()
+match('文字','d',count,4)
+match('文字','c',count,3)
+match('文字','b',count,2)
+match('文字','a',count,1)
+**/
+;
+
+select count(distinct id), v_chars as "文字" from /test/foo 
+group by v_chars order by "文字" desc
+/**
+output()
+match('文字','d',count,4)
+match('文字','c',count,3)
+match('文字','b',count,2)
+match('文字','a',count,1)
+**/
+;
+
+select count(distinct v_chars), v_chars as "文字" from /test/foo 
+group by v_chars order by "文字" desc
+/**
+output()
+match('文字','d',count,1)
+match('文字','c',count,1)
+match('文字','b',count,1)
+match('文字','a',count,1)
+**/
+;
+
+select count(distinct xx.v_chars), xx.v_chars as "文字" from /test/foo xx
+group by xx.v_chars order by "文字" desc
+/**
+output()
+match('文字','d',count,1)
+match('文字','c',count,1)
+match('文字','b',count,1)
+match('文字','a',count,1)
+**/
+;
+
+select count(), v_chars as "文字" from
+(select * from /test/foo) xx
+group by v_chars order by "文字" desc
+/**
+output()
+match('文字','d',count,4)
+match('文字','c',count,3)
+match('文字','b',count,2)
+match('文字','a',count,1)
+**/
+;
+
+select count(*), v_chars as "文字" from
+(select * from /test/foo) xx
+group by v_chars order by "文字" desc
+/**
+output()
+match('文字','d',count,4)
+match('文字','c',count,3)
+match('文字','b',count,2)
+match('文字','a',count,1)
+**/
+;
+
+select count(id), v_chars as "文字" from
+(select * from /test/foo) xx
+group by v_chars order by "文字" desc
+/**
+output()
+match('文字','d',count,4)
+match('文字','c',count,3)
+match('文字','b',count,2)
+match('文字','a',count,1)
+**/
+;
+
+select count(distinct), v_chars as "文字" from
+(select v_chars, id as distinct from /test/foo) xx
+group by v_chars order by "文字" desc
+/**
+output()
+match('文字','d',count,4)
+match('文字','c',count,3)
+match('文字','b',count,2)
+match('文字','a',count,1)
+**/
+;
+
+select count(distinct *), v_chars as "文字" from
+(select * from /test/foo) xx
+group by v_chars order by "文字" desc
+/**
+output()
+match('文字','d',count,4)
+match('文字','c',count,3)
+match('文字','b',count,2)
+match('文字','a',count,1)
+**/
+;
+
+select count(distinct id), v_chars as "文字" from
+(select * from /test/foo) xx
+group by v_chars order by "文字" desc
+/**
+output()
+match('文字','d',count,4)
+match('文字','c',count,3)
+match('文字','b',count,2)
+match('文字','a',count,1)
+**/
+;
+
+select count(distinct v_chars), v_chars as "文字" from
+(select * from /test/foo) xx
+group by v_chars order by "文字" desc
+/**
+output()
+match('文字','d',count,1)
+match('文字','c',count,1)
+match('文字','b',count,1)
+match('文字','a',count,1)
+**/
+;
+
+select count(distinct xx.v_chars), xx.v_chars as "文字" from 
+(select * from /test/foo) xx 
+group by xx.v_chars order by "文字" desc
+/**
+output()
+match('文字','d',count,1)
+match('文字','c',count,1)
+match('文字','b',count,1)
+match('文字','a',count,1)
+**/
+;

+ 39 - 7
odbctest/mql/basic/24bucket_promdb/1094.subquery.aggr.mql

@@ -10,58 +10,47 @@
 
 
 
-
-
-
+select count(id),prom.avg().max().sum().count().min() from (
+SELECT id,prom.time('2024-01-02 00:00:00', '2024-01-10 00:00:00').find(name='test1').unit('sum','1d') FROM /test/bucketpromdb
+) group by prom
+/**
+timeout(60m)
+output()
+todomatch(id, 3, prom, null)
+match(count, 3)
+match(count, 1, "prom.0.2", 2880, "prom.0.8", 23040, "prom.0.11", 8)
+**/
+;
+
+
+select count(id),prom from (
+SELECT id,prom.time('2024-01-02 00:00:00', '2024-01-10 00:00:00').find(name='test1').unit('sum','1d') FROM /test/bucketpromdb
+) group by prom
+/**
+timeout(60m)
+output()
+todomatch(id, 3, prom, null)
+match(id, 3)
+match(id, 1, "prom.0.2", 2880, "prom.7.2", 2880)
+**/
+;
+
+
+
+
+select count(id),prom.avg().max().sum().count().min() from (
+SELECT id,prom.time('2024-01-02 00:00:00', '2024-01-10 00:00:00').find(name='test1').unit('sum','1d') FROM /test/bucketpromdb
+) group by prom
+/**
+timeout(60m)
+output()
+todomatch(id, 3, prom, null)
+match(count, 3)
+match(count, 1, "prom.0.2", 2880, "prom.0.8", 23040, "prom.0.11", 8)
+**/
+;
 
 
 
-
-
-
-
 
 

+ 19 - 0
odbctest/mql/basic/24bucket_promdb/1094.subquery.mql

@@ -1,4 +1,23 @@
 
+select count(id), id.count() from /test/bucketpromdb
+/**
+timeout(60m)
+output()
+**/
+;
+
+
+select id.count(),prom.count(),prom from (
+SELECT id,prom.time('2024-01-02 00:00:00', '2024-01-10 00:00:00').find(name='test1').unit('sum','1d') FROM /test/bucketpromdb
+) group by prom
+/**
+timeout(60m)
+output()
+match(id, 3, "prom.0.2", 0)
+match(id, 1, "prom.0.2", 8)
+**/
+;
+
 
 -- select count(id),prom from(SELECT id,prom.time('2024-01-02 00:00:00', '2024-01-10 00:00:00').find(name='test1').unit('sum','1d') FROM /test/bucketpromdb)group by prom
 -- /**

+ 20 - 0
odbctest/mql/matrix/entity/601glob通配支持.mql

@@ -1,8 +1,28 @@
 
 
 
+
+match ("biz:查账系统")-[*]->("linux:linux[0-9]")-[*1]->(x:/m3entity/entity/esx)
+/**
+output()
+**/;
+
+
 match ("biz:查账系统")-[*]->("linux:linux[0-9]")-[*1]->("esx:esx[1-4]")
 /**
 output()
 **/;
 
+
+match ("biz:查账系统")-[*]->("linux:linux[0-9]")-[*1]->(x:/m3entity/entity/esx) return x.id, x.name, x.day
+/**
+output()
+count(12)
+**/;
+
+
+match ("biz:查账系统")-[*]->("linux:linux[0-9]")-[*1]->(x:/m3entity/entity/esx) return distinct x.id, x.name, x.day
+/**
+output()
+count(3)
+**/;

+ 29 - 0
odbctest/mql/matrix/icbctest/097.mql

@@ -0,0 +1,29 @@
+
+
+
+select count(distinct model),model FROM
+/m3event/entity/node
+group by model 
+/**
+output()
+**/
+;
+
+
+select count(distinct model),model FROM
+(SELECT 	* FROM 	 /m3event/entity/node) 
+group by model 
+/**
+output()
+**/
+;
+
+
+
+select count(*), aa.model as "中文" from  /m3event/entity/node aa
+group by aa.model order by "中文" desc /**output()**/;
+
+
+select count(*), aa.model as "中文" from (
+SELECT 	* FROM 	 /m3event/entity/node) aa 
+group by aa.model order by "中文" desc /**output()**/;

+ 28 - 0
odbctest/mql/uino/070.match.mql

@@ -0,0 +1,28 @@
+
+
+
+-- MATCH (grpcont:/aia/grpcont WHERE grpcontno = 'G09***956C')-[:grpcont_risk*1..1]->(risk:/aia/risk), 
+-- (grpcont)-[:grpcont_plan*1..1]->(plan:/aia/plan), 
+-- (plan:/aia/plan)-[:plan_risk*1..1]->(risk:/aia/risk) 
+-- /**
+-- output()
+-- **/
+-- ;
+
+
+MATCH (grpcont:/aia/grpcont WHERE grpcontno = 'G09***956C')-[:grpcont_risk*1..1]->(risk:/aia/risk), 
+(grpcont)-[:grpcont_plan*1..1]->(plan:/aia/plan), 
+(plan:/aia/plan)-[:plan_risk*1..1]->(risk:/aia/risk) 
+RETURN
+grpcont.id, plan.id, risk.id
+-- grpcont.grpcontno AS "grpcontno", grpcont.grppropno AS "grppropno", grpcont.grpname AS "grpname", 
+-- grpcont.grpcity AS "grpcity", risk.riskcode AS "riskcode", risk.riskname AS "riskname", 
+-- risk.risktype AS "risktype", risk.terminationdate AS "terminationdate", grpcont.polprem AS "polprem", 
+-- grpcont.anpvalue AS "anpvalue", grpcont.anpvaluenovat AS "anpvaluenovat", plan.plancode AS "plancode", 
+-- plan.plandesc AS "plandesc", plan.plansumprem AS "plansumprem"
+WITH TIMEOUT = 600m
+/**
+output()
+**/
+;
+