File tree Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -263,17 +263,13 @@ def walk(f):
263
263
264
264
# SQL-ish operators here:
265
265
def INDEX (stream ; idx_expr ):
266
- reduce stream as $row ({};
267
- . [$row | idx_expr |
268
- if type != "string" then tojson
269
- else .
270
- end ] |= $row );
266
+ reduce stream as $row ({}; . [$row | idx_expr | tostring ] = $row );
271
267
def INDEX (idx_expr ): INDEX (. []; idx_expr );
272
268
def JOIN ($idx ; idx_expr ):
273
269
[. [] | [. , $idx [idx_expr ]]];
274
270
def JOIN ($idx ; stream ; idx_expr ):
275
271
stream | [. , $idx [idx_expr ]];
276
272
def JOIN ($idx ; stream ; idx_expr ; join_expr ):
277
273
stream | [. , $idx [idx_expr ]] | join_expr ;
278
- def IN (s ): reduce ( first ( select ( . == s )) | true ) as $v ( false ; if . or $v then true else false end );
279
- def IN (src ; s ): reduce (src | IN ( s )) as $v ( false ; if . or $v then true else false end );
274
+ def IN (s ): any ( s == . ; . );
275
+ def IN (src ; s ): any (src == s ; . );
Original file line number Diff line number Diff line change @@ -1575,6 +1575,17 @@ true
1575
1575
true
1576
1576
true
1577
1577
1578
+ range(5;13)|IN(range(0;10;3))
1579
+ null
1580
+ false
1581
+ true
1582
+ false
1583
+ false
1584
+ true
1585
+ false
1586
+ false
1587
+ false
1588
+
1578
1589
range(10;12)|IN(range(10))
1579
1590
null
1580
1591
false
You can’t perform that action at this time.
0 commit comments