Skip to content

Commit 875a24b

Browse files
author
Ghislain Fourny
committed
Add a test
1 parent 9f513b4 commit 875a24b

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

tests/iterator_bug.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
from jsoniq import RumbleSession
2+
from unittest import TestCase
3+
import json
4+
class TryTesting(TestCase):
5+
def test1(self):
6+
# The syntax to start a session is similar to that of Spark.
7+
# A RumbleSession is a SparkSession that additionally knows about RumbleDB.
8+
# All attributes and methods of SparkSession are also available on RumbleSession.
9+
rumble = RumbleSession.builder.appName("PyRumbleExample").getOrCreate();
10+
# A more complex, standalone query
11+
12+
seq = rumble.jsoniq("""
13+
%%jsoniq
14+
max(
15+
let $path := "http://www.rumbledb.org/samples/git-archive-small.json"
16+
for $event in json-lines($path)
17+
return 1
18+
)
19+
""");
20+
21+
expected = (1)
22+
23+
self.assertTrue(json.dumps(seq.json()) == json.dumps(expected))

0 commit comments

Comments
 (0)