forked from vesoft-inc/nebula
/
yield.feature
712 lines (692 loc) · 24.4 KB
/
yield.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
Feature: Yield Sentence
Background: Prepare space
Given a graph with space named "nba"
Scenario: Base
When executing query:
"""
YIELD 1
"""
Then the result should be, in any order:
| 1 |
| 1 |
When executing query:
"""
YIELD [1, 1.1, 1e2, 1.1e2, .3e4, 1.e4, 1234E-10, true] AS basic_value
"""
Then the result should be, in any order, with relax comparison:
| basic_value |
| [1, 1.1, 100.0, 110.0, 3000.0, 10000.0, 0.0000001234, true] |
When executing query:
"""
YIELD {p1: 1, p2: true, p3: "test"} AS r
"""
Then the result should be, in any order:
| r |
| {p1: 1, p2: true, p3: "test"} |
When executing query:
"""
YIELD true and false
"""
Then the result should be, in any order:
| (true AND false) |
| false |
When executing query:
"""
YIELD datetime('2012-03-04T22:11').year
"""
Then the result should be, in any order:
| datetime("2012-03-04T22:11").year |
| 2012 |
When executing query:
"""
YIELD datetime('2012-03-04T22:11').not_exists
"""
Then the result should be, in any order:
| datetime("2012-03-04T22:11").not_exists |
| UNKNOWN_PROP |
When executing query:
"""
YIELD CASE 1 WHEN 1 THEN 2 ELSE 3 END
"""
Then the result should be, in any order:
| CASE 1 WHEN 1 THEN 2 ELSE 3 END |
| 2 |
When executing query:
"""
YIELD abs(-1)
"""
Then the result should be, in any order:
| abs(-(1)) |
| 1 |
When executing query:
"""
YIELD v.l1.p1
"""
Then a SemanticError should be raised at runtime: Invalid label identifiers: v
When executing query:
"""
YIELD l1
"""
Then a SemanticError should be raised at runtime: Invalid label identifiers: l1
When executing query:
"""
YIELD [i in [1, 2, 3] where i > 1 | i + 1] AS r
"""
Then the result should be, in any order:
| r |
| [3, 4] |
When executing query:
"""
YIELD all(n IN range(1, 5) WHERE n > 2)
"""
Then the result should be, in any order:
| all(n IN range(1,5) WHERE (n>2)) |
| false |
When executing query:
"""
YIELD like._dst
"""
Then a SemanticError should be raised at runtime: Only support input and variable in yield sentence.
When executing query:
"""
YIELD reduce(totalNum = 10, n IN range(1, 3) | totalNum + n) AS r
"""
Then the result should be, in any order:
| r |
| 16 |
When executing query:
"""
YIELD [1, 2, 3][2]
"""
Then the result should be, in any order:
| [1,2,3][2] |
| 3 |
When executing query:
"""
YIELD [1, 2, 3][0..1]
"""
Then the result should be, in any order:
| [1,2,3][0..1] |
| [1] |
When executing query:
"""
YIELD prefix(edge1.prop1,"高")
"""
Then a SyntaxError should be raised at runtime: syntax error near `(edge1.p'
When executing query:
"""
YIELD (int)"1"
"""
Then the result should be, in any order:
| (INT)"1" |
| 1 |
When executing query:
"""
YIELD -(1)
"""
Then the result should be, in any order:
| -(1) |
| -1 |
When executing query:
"""
YIELD uuid()
"""
Then a SemanticError should be raised at runtime: Not supported expression `uuid()' for props deduction.
When executing query:
"""
YIELD $v
"""
Then a SyntaxError should be raised at runtime: Direct output of variable is prohibited near `$v'
When executing query:
"""
YIELD 1 AS num
"""
Then the result should be, in any order:
| num |
| 1 |
When executing query:
"""
YIELD 1+1, (int)3.14, (string)(1+1), (string)true,"1+1"
"""
Then the result should be, in any order, with relax comparison:
| (1+1) | (INT)3.14 | (STRING)(1+1) | (STRING)true | "1+1" |
| 2 | 3 | "2" | "true" | "1+1" |
When executing query:
"""
YIELD "Hello", hash("Hello")
"""
Then the result should be, in any order, with relax comparison:
| "Hello" | hash("Hello") |
| "Hello" | 2275118702903107253 |
# TODO fix it
@skip
Scenario: Mistake
When executing query:
"""
YIELD count(*)
"""
Then a SemanticError should be raised at runtime: Don't support aggregate function without input.
When executing query:
"""
YIELD (v)-[:like]-()
"""
Then a SemanticError should be raised at runtime: Not support pattern expression.
Scenario: HashCall
When executing query:
"""
YIELD hash("Boris")
"""
Then the result should be, in any order, with relax comparison:
| hash("Boris") |
| 9126854228122744212 |
When executing query:
"""
YIELD hash(123)
"""
Then the result should be, in any order, with relax comparison:
| hash(123) |
| 123 |
When executing query:
"""
YIELD hash(123+456)
"""
Then the result should be, in any order, with relax comparison:
| hash((123+456)) |
| 579 |
When executing query:
"""
YIELD hash(123.0)
"""
Then the result should be, in any order, with relax comparison:
| hash(123) |
| -2256853663865737834 |
When executing query:
"""
YIELD hash(!false)
"""
Then the result should be, in any order, with relax comparison:
| hash(!(false)) |
| 1 |
Scenario: Logic
When executing query:
"""
YIELD NOT false OR false AND false XOR false
"""
Then the result should be, in any order, with relax comparison:
| ((!(false) OR (false AND false)) XOR false) |
| true |
When executing query:
"""
YIELD (NOT false OR false) AND false XOR true
"""
Then the result should be, in any order, with relax comparison:
| (((!(false) OR false) AND false) XOR true) |
| true |
When executing query:
"""
YIELD 2.5 % 1.2
"""
Then the result should be, in any order, with relax comparison:
| (2.5%1.2) |
| 0.10000000000000009 |
@skip
Scenario: InCall
When executing query:
"""
YIELD udf_is_in(1,0,1,2), 123
"""
Then the result should be, in any order, with relax comparison:
| udf_is_in(1,0,1,2) | 123 |
| true | 123 |
Scenario: YieldPipe
When executing query:
"""
GO FROM "Boris Diaw" OVER serve YIELD $^.player.name as name, serve.start_year as start, $$.team.name as team | YIELD $-.team AS team
"""
Then the result should be, in any order, with relax comparison:
| team |
| "Hawks" |
| "Hornets" |
| "Jazz" |
| "Spurs" |
| "Suns" |
When executing query:
"""
GO FROM "Boris Diaw" OVER serve YIELD $^.player.name as name, serve.start_year as start, $$.team.name as team | YIELD $-.team WHERE 1 == 1
"""
Then the result should be, in any order, with relax comparison:
| $-.team |
| "Hawks" |
| "Hornets" |
| "Jazz" |
| "Spurs" |
| "Suns" |
When executing query:
"""
GO FROM "Boris Diaw" OVER serve YIELD $^.player.name as name, serve.start_year as start, $$.team.name as team | YIELD $-.team WHERE $-.start > 2005
"""
Then the result should be, in any order, with relax comparison:
| $-.team |
| "Hornets" |
| "Jazz" |
| "Spurs" |
When executing query:
"""
GO FROM "Boris Diaw" OVER serve YIELD $^.player.name as name, serve.start_year as start, $$.team.name as team | YIELD $-.*
"""
Then the result should be, in any order, with relax comparison:
| $-.name | $-.start | $-.team |
| "Boris Diaw" | 2003 | "Hawks" |
| "Boris Diaw" | 2008 | "Hornets" |
| "Boris Diaw" | 2016 | "Jazz" |
| "Boris Diaw" | 2012 | "Spurs" |
| "Boris Diaw" | 2005 | "Suns" |
When executing query:
"""
GO FROM "Boris Diaw" OVER serve YIELD $^.player.name as name, serve.start_year as start, $$.team.name as team | YIELD $-.* WHERE $-.start > 2005
"""
Then the result should be, in any order, with relax comparison:
| $-.name | $-.start | $-.team |
| "Boris Diaw" | 2008 | "Hornets" |
| "Boris Diaw" | 2016 | "Jazz" |
| "Boris Diaw" | 2012 | "Spurs" |
When executing query:
"""
GO FROM "Boris Diaw" OVER serve YIELD $^.player.name as name, serve.start_year as start, $$.team.name as team | YIELD $-.*,hash(123) as hash WHERE $-.start > 2005
"""
Then the result should be, in any order, with relax comparison:
| $-.name | $-.start | $-.team | hash |
| "Boris Diaw" | 2008 | "Hornets" | 123 |
| "Boris Diaw" | 2016 | "Jazz" | 123 |
| "Boris Diaw" | 2012 | "Spurs" | 123 |
Scenario: YieldPipeDistinct
When executing query:
"""
GO 2 STEPS FROM "Tim Duncan" OVER like YIELD like._dst AS dst | YIELD DISTINCT $-.dst AS dst
"""
Then the result should be, in any order, with relax comparison:
| dst |
| "Tim Duncan" |
| "LaMarcus Aldridge" |
| "Manu Ginobili" |
When executing query:
"""
GO 2 STEPS FROM "Tim Duncan" OVER like YIELD like._dst AS dst | YIELD $-.dst AS dst
"""
Then the result should be, in any order, with relax comparison:
| dst |
| "Tim Duncan" |
| "Tim Duncan" |
| "LaMarcus Aldridge" |
| "Manu Ginobili" |
When executing query:
"""
GO FROM "Tim Duncan" OVER like YIELD like._dst AS dst | YIELD DISTINCT $-.dst AS dst
"""
Then the result should be, in any order, with relax comparison:
| dst |
| "Tony Parker" |
| "Manu Ginobili" |
Scenario: YieldVar
When executing query:
"""
$var = GO FROM "Boris Diaw" OVER serve YIELD $^.player.name as name, serve.start_year as start, $$.team.name as team;YIELD $var.team
"""
Then the result should be, in any order, with relax comparison:
| $var.team |
| "Hawks" |
| "Hornets" |
| "Jazz" |
| "Spurs" |
| "Suns" |
When executing query:
"""
$var = GO FROM "Boris Diaw" OVER serve YIELD $^.player.name as name, serve.start_year as start, $$.team.name as team;YIELD $var.team WHERE 1 == 1
"""
Then the result should be, in any order, with relax comparison:
| $var.team |
| "Hawks" |
| "Hornets" |
| "Jazz" |
| "Spurs" |
| "Suns" |
When executing query:
"""
$var = GO FROM "Boris Diaw" OVER serve YIELD $^.player.name as name, serve.start_year as start, $$.team.name as team;YIELD $var.team WHERE $var.start > 2005
"""
Then the result should be, in any order, with relax comparison:
| $var.team |
| "Hornets" |
| "Jazz" |
| "Spurs" |
When executing query:
"""
$var = GO FROM "Boris Diaw" OVER serve YIELD $^.player.name as name, serve.start_year as start, $$.team.name as team;YIELD $var.*
"""
Then the result should be, in any order, with relax comparison:
| $var.name | $var.start | $var.team |
| "Boris Diaw" | 2003 | "Hawks" |
| "Boris Diaw" | 2008 | "Hornets" |
| "Boris Diaw" | 2016 | "Jazz" |
| "Boris Diaw" | 2012 | "Spurs" |
| "Boris Diaw" | 2005 | "Suns" |
When executing query:
"""
$var = GO FROM "Boris Diaw" OVER serve YIELD $^.player.name as name, serve.start_year as start, $$.team.name as team;YIELD $var.* WHERE $var.start > 2005
"""
Then the result should be, in any order, with relax comparison:
| $var.name | $var.start | $var.team |
| "Boris Diaw" | 2008 | "Hornets" |
| "Boris Diaw" | 2016 | "Jazz" |
| "Boris Diaw" | 2012 | "Spurs" |
When executing query:
"""
$var = GO FROM "Boris Diaw" OVER serve YIELD $^.player.name as name, serve.start_year as start, $$.team.name as team;YIELD $var.*, hash(123) as hash WHERE $var.start > 2005
"""
Then the result should be, in any order, with relax comparison:
| $var.name | $var.start | $var.team | hash |
| "Boris Diaw" | 2008 | "Hornets" | 123 |
| "Boris Diaw" | 2016 | "Jazz" | 123 |
| "Boris Diaw" | 2012 | "Spurs" | 123 |
Scenario: YieldVarDistinct
When executing query:
"""
$a = GO 2 STEPS FROM "Tim Duncan" OVER like YIELD like._dst AS dst;YIELD DISTINCT $a.dst AS dst
"""
Then the result should be, in any order, with relax comparison:
| dst |
| "Tim Duncan" |
| "LaMarcus Aldridge" |
| "Manu Ginobili" |
When executing query:
"""
$a = GO 2 STEPS FROM "Tim Duncan" OVER like YIELD like._dst AS dst;YIELD $a.dst AS dst
"""
Then the result should be, in any order, with relax comparison:
| dst |
| "Tim Duncan" |
| "LaMarcus Aldridge" |
| "Manu Ginobili" |
| "Tim Duncan" |
When executing query:
"""
$a = GO FROM "Tim Duncan" OVER like YIELD like._dst AS dst;YIELD DISTINCT $a.dst AS dst
"""
Then the result should be, in any order, with relax comparison:
| dst |
| "Manu Ginobili" |
| "Tony Parker" |
Scenario: Error
When executing query:
"""
YIELD count(rand32());
"""
Then a SyntaxError should be raised at runtime: Can't use non-deterministic (random) functions inside of aggregate functions near `rand32()'
When executing query:
"""
YIELD avg(ranD()+1);
"""
Then a SyntaxError should be raised at runtime: Can't use non-deterministic (random) functions inside of aggregate functions near `ranD()+1'
When executing query:
"""
$var = GO FROM "Boris Diaw" OVER serve YIELD $^.player.name AS name, serve.start_year AS start, $$.team.name AS team;YIELD $var.team WHERE $-.start > 2005
"""
Then a SemanticError should be raised at runtime: Not support both input and variable.
When executing query:
"""
$var = GO FROM "Boris Diaw" OVER serve YIELD $^.player.name AS name, serve.start_year AS start, $$.team.name AS team;YIELD $var.team WHERE $var1.start > 2005
"""
Then a SemanticError should be raised at runtime: Only one variable allowed to use.
When executing query:
"""
$var = GO FROM "Boris Diaw" OVER serve YIELD $^.player.name AS name, serve.start_year AS start, $$.team.name AS team;YIELD $var.abc
"""
Then a SemanticError should be raised at runtime: `$var.abc', not exist prop `abc'
When executing query:
"""
$var = GO FROM "Boris Diaw" OVER serve YIELD $^.player.name AS name, serve.start_year AS start, $$.team.name AS team;YIELD $$.a.team
"""
Then a ExecutionError should be raised at runtime: TagNotFound: TagName `a`
When executing query:
"""
$var = GO FROM "Boris Diaw" OVER serve YIELD $^.player.name AS name, serve.start_year AS start, $$.team.name AS team;YIELD $^.a.team
"""
Then a ExecutionError should be raised at runtime: TagNotFound: TagName `a`
When executing query:
"""
$var = GO FROM "Boris Diaw" OVER serve YIELD $^.player.name AS name, serve.start_year AS start, $$.team.name AS team;YIELD a.team
"""
Then a SemanticError should be raised at runtime: Invalid label identifiers: a
When executing query:
"""
$var = GO FROM "Boris Diaw" OVER like YIELD $-.abc
"""
Then a SemanticError should be raised at runtime: `$-.abc', not exist prop `abc'
Scenario: CalculateOverflow
When executing query:
"""
YIELD 9223372036854775807+1
"""
Then a SemanticError should be raised at runtime: result of (9223372036854775807+1) cannot be represented as an integer
When executing query:
"""
YIELD -9223372036854775807-2
"""
Then a SemanticError should be raised at runtime: result of (-9223372036854775807-2) cannot be represented as an integer
When executing query:
"""
YIELD -9223372036854775807+-2
"""
Then a SemanticError should be raised at runtime: result of (-9223372036854775807+-2) cannot be represented as an integer
When executing query:
"""
YIELD 9223372036854775807*2
"""
Then a SemanticError should be raised at runtime: result of (9223372036854775807*2) cannot be represented as an integer
When executing query:
"""
YIELD -9223372036854775807*-2
"""
Then a SemanticError should be raised at runtime: result of (-9223372036854775807*-2) cannot be represented as an integer
When executing query:
"""
YIELD 9223372036854775807*-2
"""
Then a SemanticError should be raised at runtime: result of (9223372036854775807*-2) cannot be represented as an integer
When executing query:
"""
YIELD 1/0
"""
Then a SemanticError should be raised at runtime: Divide by 0
When executing query:
"""
YIELD 2%0
"""
Then a SemanticError should be raised at runtime: Divide by 0
When executing query:
"""
YIELD -9223372036854775808
"""
Then the result should be, in any order, with relax comparison:
| -9223372036854775808 |
| -9223372036854775808 |
When executing query:
"""
YIELD --9223372036854775808
"""
Then a SemanticError should be raised at runtime: result of -(-9223372036854775808) cannot be represented as an integer
When executing query:
"""
YIELD -9223372036854775809
"""
Then a SyntaxError should be raised at runtime: Out of range: near `9223372036854775809'
When executing query:
"""
YIELD 9223372036854775807
"""
Then the result should be, in any order, with relax comparison:
| 9223372036854775807 |
| 9223372036854775807 |
When executing query:
"""
YIELD -2*4611686018427387904
"""
Then the result should be, in any order, with relax comparison:
| (-(2)*4611686018427387904) |
| -9223372036854775808 |
Scenario: AggCall
When executing query:
"""
YIELD COUNT(1), $-.name
"""
Then a SemanticError should be raised at runtime: `$-.name', not exist prop `name'
When executing query:
"""
YIELD COUNT(*), 1+1
"""
Then the result should be, in any order, with relax comparison:
| COUNT(*) | (1+1) |
| 1 | 2 |
When executing query:
"""
GO FROM "Carmelo Anthony" OVER like YIELD $$.player.age as age, like.likeness AS like | YIELD AVG($-.age),SUM($-.like),COUNT(*),1+1
"""
Then the result should be, in any order, with relax comparison:
| AVG($-.age) | SUM($-.like) | COUNT(*) | (1+1) |
| 34.666666666666664 | 270 | 3 | 2 |
When executing query:
"""
GO FROM "Carmelo Anthony" OVER like YIELD like._dst| YIELD COUNT(*)
"""
Then the result should be, in any order, with relax comparison:
| COUNT(*) |
| 3 |
When executing query:
"""
GO FROM "Carmelo Anthony" OVER like YIELD edge as e| YIELD 1
"""
Then the result should be, in any order, with relax comparison:
| 1 |
| 1 |
| 1 |
| 1 |
When executing query:
"""
GO FROM "Nobody" OVER like YIELD like._dst| YIELD 1
"""
Then the result should be, in any order, with relax comparison:
| 1 |
When executing query:
"""
$var=GO FROM "Carmelo Anthony" OVER like YIELD $$.player.age as age, like.likeness AS like ; YIELD AVG($var.age),SUM($var.like),COUNT(*)
"""
Then the result should be, in any order, with relax comparison:
| AVG($var.age) | SUM($var.like) | COUNT(*) |
| 34.666666666666664 | 270 | 3 |
Scenario: EmptyInput
When executing query:
"""
GO FROM "NON EXIST VERTEX ID" OVER serve YIELD $^.player.name as name, serve.start_year as start, $$.team.name as team | YIELD $-.team
"""
Then the result should be, in any order, with relax comparison:
| $-.team |
When executing query:
"""
$var=GO FROM "NON EXIST VERTEX ID" OVER serve YIELD $^.player.name as name, serve.start_year as start, $$.team.name as team ; YIELD $var.team
"""
Then the result should be, in any order, with relax comparison:
| $var.team |
When executing query:
"""
GO FROM "NON EXIST VERTEX ID" OVER serve YIELD $^.player.name as name, serve.start_year as start, $$.team.name as team | YIELD $-.name as name WHERE $-.start > 20000 | YIELD $-.name AS name
"""
Then the result should be, in any order, with relax comparison:
| name |
When executing query:
"""
GO FROM "Tim Duncan" OVER like YIELD like._dst as id, $$ as dst | YIELD $-.dst where count($-.id) > 2
"""
Then a SyntaxError should be raised at runtime: Invalid use of aggregating function in where clause. near `count($-.id) > 2'
When executing query:
"""
$var = go from "Tim Duncan" over like yield like._dst as id, $$ as dst; yield $var.dst where count($var.id) > 2
"""
Then a SyntaxError should be raised at runtime: Invalid use of aggregating function in where clause. near `count($var.id) > 2'
Scenario: DuplicateColumn
When executing query:
"""
YIELD 1,1
"""
Then the result should be, in any order, with relax comparison:
| 1 | 1 |
| 1 | 1 |
When executing query:
"""
GO FROM "Boris Diaw" OVER serve YIELD $^.player.name as name, serve.start_year as start, $$.team.name as team | YIELD $-.team
"""
Then the result should be, in any order, with relax comparison:
| $-.team |
| "Hawks" |
| "Hornets" |
| "Jazz" |
| "Spurs" |
| "Suns" |
Scenario: PipeYieldGo
When executing query:
"""
GO FROM "Tim Duncan" OVER serve YIELD serve._src as id | YIELD $-.id as id | GO FROM $-.id OVER serve YIELD $$.team.name AS name
"""
Then the result should be, in any order, with relax comparison:
| name |
| "Spurs" |
When executing query:
"""
$var=GO FROM "Tim Duncan" OVER serve YIELD serve._src as id;$var2 = YIELD $var.id as id ; GO FROM $var2.id OVER serve YIELD $$.team.name AS name
"""
Then the result should be, in any order, with relax comparison:
| name |
| "Spurs" |
Scenario: WithComment
When executing query:
"""
YIELD 1--1
"""
Then the result should be, in any order, with relax comparison:
| (1--(1)) |
| 2 |
Scenario: deduce typecase
When executing query:
"""
yield split('123,456,789', ',') as l| yield [e in $-.l | (int)(e)] as c;
"""
Then the result should be, in any order, with relax comparison:
| c |
| [123,456,789] |
When executing query:
"""
yield [e in ['123', '456', '789'] | (int)(e)] as c;
"""
Then the result should be, in any order, with relax comparison:
| c |
| [123,456,789] |
Scenario: function name case test
When executing query:
"""
yield [aBs(-3), tofloat(3), bit_Or(1, 2)] AS function_case_test
"""
Then the result should be, in any order, with relax comparison:
| function_case_test |
| [3, 3.0, 3] |
When executing query:
"""
yield counT(*), aVg(3), bit_Or(1)
"""
Then the result should be, in any order, with relax comparison:
| counT(*) | aVg(3) | bit_Or(1) |
| 1 | 3.0 | 1 |
Scenario: Error message for and/or
When executing query:
"""
YIELD -1 AND TRUE;
"""
Then a SemanticError should be raised at runtime: `(-(1) AND true)' is not a valid expression, can not apply `&&' or `AND' operator to `INT' and `BOOL'.