Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/super/db/manage/ztests/compact-size.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ script: |
seq 100 150 | super -c '{ts:this,x:1}' - | super db load -q -
seq 200 250 | super -c '{ts:this,x:1}' - | super db load -q -
super db manage -q
super db query -z 'from test@main:objects |> drop id'
super db query -z 'from test@main:objects | drop id'

outputs:
- name: stdout
Expand Down
2 changes: 1 addition & 1 deletion cmd/super/db/manage/ztests/compact.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ script: |
seq 200 | super -c '{ts:this}' - | super db load -q -
done
super db manage -q
super db query -z 'from test@main:objects |> drop id'
super db query -z 'from test@main:objects | drop id'

outputs:
- name: stdout
Expand Down
2 changes: 1 addition & 1 deletion cmd/super/db/manage/ztests/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ script: |
super db create -q test3
super db branch -use test2 -q live
super db manage -config=inherit.yaml -log.path=inherit.log
super -Z -c 'msg == "updating pool" |> cut name, branch |> sort name' inherit.log > inherit.jsup
super -Z -c 'msg == "updating pool" | cut name, branch | sort name' inherit.log > inherit.jsup

inputs:
- name: inherit.yaml
Expand Down
2 changes: 1 addition & 1 deletion cmd/super/db/manage/ztests/overlap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ script: |
seq 100 | super -c '{ts:this,x:1}' - | super db load -q -
done
super db manage -q
super db query -z 'from test@main:objects |> drop id'
super db query -z 'from test@main:objects | drop id'

outputs:
- name: stdout
Expand Down
2 changes: 1 addition & 1 deletion cmd/super/db/manage/ztests/pool-flag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ script: |
super db create -q test3
super db create -q test4
super db manage -pool test2 -pool test4 -log.path=manage.log
super -z -c 'msg == "updating pool" |> yield name' manage.log
super -z -c 'msg == "updating pool" | yield name' manage.log

outputs:
- name: stdout
Expand Down
4 changes: 2 additions & 2 deletions cmd/super/db/manage/ztests/vectors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ script: |
seq 1 10 | super -c '{ts:this}' - | super db load -q -
seq 1 10 | super -c '{ts:this}' - | super db load -q -
super db manage -log.level=warn -q -vectors
super db query -z 'from test1@main:vectors |> drop id'
super db query -z 'from test1@main:vectors | drop id'
echo '// Test create vector on single object.'
super db create -use -q test2
seq 1 10 | super -c '{ts:this}' - | super db load -q -
super db manage -log.level=warn -q -vectors
super db query -z 'from test2@main:vectors |> drop id'
super db query -z 'from test2@main:vectors | drop id'

outputs:
- name: stdout
Expand Down
2 changes: 1 addition & 1 deletion cmd/super/db/ztests/query-stats.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ script: |
super db init -q
super db create -q test
super db load -q -use test babble.jsup
super db query -s -z "from test |> count()"
super db query -s -z "from test | count()"

inputs:
- name: babble.jsup
Expand Down
4 changes: 2 additions & 2 deletions cmd/super/internal/lakemanage/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ func scan(ctx context.Context, it *objectIterator, pool *pools.Config, runCh cha

const iteratorQuery = `
from %q@%q:objects
|> left join (from %q@%q:vectors) on id=id vector:=true
|> sort min
| left join (from %q@%q:vectors) on id=id vector:=true
| sort min
`

type objectIterator struct {
Expand Down
2 changes: 1 addition & 1 deletion cmd/super/root/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ the input and then transforms or analyzes the filtered stream.
Output is written to one or more files or to standard output.

A query is comprised of one or more operators interconnected
into a pipeline using the pipe symbol "|>".
into a pipeline using the pipe symbol "|" or the alternate "|>".
See https://zed.brimdata.io/docs/language
for details. The "select" and "from" operators provide backward
compatibility with SQL. In fact, you can use SQL exclusively and
Expand Down
2 changes: 1 addition & 1 deletion cmd/super/ztests/call-user-op-with-src.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ inputs:
- name: countfile.zed
data: |
op countfile(): (
file test.jsup |> count()
file test.jsup | count()
)
- name: test.jsup
data: '{} {} {} {}'
Expand Down
8 changes: 4 additions & 4 deletions cmd/super/ztests/single-arg-error.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
script: |
! super -c 'file sample.jsup |> count('
! super -c 'file sample.jsup | count('

outputs:
- name: stderr
data: |
parse error at line 1, column 27:
file sample.jsup |> count(
=== ^ ===
parse error at line 1, column 26:
file sample.jsup | count(
=== ^ ===
2 changes: 1 addition & 1 deletion compiler/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func VectorFilterCompile(rctx *runtime.Context, query string, env *exec.Environm
if err != nil {
return nil, err
}
ast, err := parser.ParseQuery(fmt.Sprintf("%s |> %s", spec, query))
ast, err := parser.ParseQuery(fmt.Sprintf("%s | %s", spec, query))
if err != nil {
return nil, err
}
Expand Down
12 changes: 6 additions & 6 deletions compiler/parser/valid.zed
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
?foo
?foo |> count()
?foo | count()
count() with -limit 10
count() by _path with -limit 10
count() by _path,every(1h) with -limit 10
Expand All @@ -9,13 +9,13 @@ _path=='conn' and id.resp_p==80
count(), sum(foo)
fork (=>count() by _path =>count() by addr)
switch (case grep("foo") => count() by _path case field==1 => count() by addr)
count() by _path |> count() by addr
fork (=>count() by _path =>sort) |> fork (=>count() by addr)
switch (case grep("foo") => count() by _path case field==1 => sort) |> switch (default => count() by addr)
count() by _path | count() by addr
fork (=>count() by _path =>sort) | fork (=>count() by addr)
switch (case grep("foo") => count() by _path case field==1 => sort) | switch (default => count() by addr)
sort -r
sort -r a, b, c
sort -r a, b, c
count() |> sort
count() | sort
top 1
top 1 -flush
? foo\tbar
Expand All @@ -37,4 +37,4 @@ nullkeys()
truevals()
falsevals()
yield 2600:1901:101::/126, ::1/1, 2001:0db8:85a3:0000:0000:8a2e:0370:7334/55
func head(): (1) func tail(): (1) func uniq(): (1) func pass(): (1) head() |> tail() |> uniq() |> pass()
func head(): (1) func tail(): (1) func uniq(): (1) func pass(): (1) head() | tail() | uniq() | pass()
2 changes: 1 addition & 1 deletion compiler/parser/ztests/comments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ script: |
inputs:
- name: count.zed
data: |
?2 |> c := count() //,
?2 | c := count() //,
, sum(v) // moon
- name: in.jsup
data: |
Expand Down
14 changes: 7 additions & 7 deletions compiler/parser/ztests/from.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ script: |
super compile -C 'from(get http://a)'
super compile -C 'from(pool a)'
echo === No space before vertical bar.
super compile -C 'file a|> ?b'
super compile -C 'get http://a|> ?b'
super compile -C 'from a|> ?b'
super compile -C 'file a| ?b'
super compile -C 'get http://a| ?b'
super compile -C 'from a| ?b'

outputs:
- name: stdout
data: |
fork (
=>
from a
|> search x and pool and b
| search x and pool and b
)
=== No spaces around parentheses.
fork (
Expand All @@ -32,8 +32,8 @@ outputs:
)
=== No space before vertical bar.
from a
|> search b
| search b
from "http://a"
|> search b
| search b
from a
|> search b
| search b
20 changes: 10 additions & 10 deletions compiler/parser/ztests/over-expr.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
script: |
echo === aggregation and locals
super compile -C 'collect(over a with b=c |> ?d)'
super compile -C 'collect(over a with b=c | ?d)'
echo === cast
super compile -C 'uint8(over a |> ?b)'
super compile -C 'uint8(over a | ?b)'
echo === expression
super compile -C 'yield (over a |> ?b)'
super compile -C 'yield (over a | ?b)'
echo === function
super compile -C 'quiet(over a |> ?b)'
super compile -C 'quiet(over a | ?b)'
echo === grep
super compile -C 'grep(/regexp/, over a |> ?b)'
super compile -C 'grep(/regexp/, over a | ?b)'

outputs:
- name: stdout
Expand All @@ -17,25 +17,25 @@ outputs:
summarize
collect((
over a with b=c
|> search d
| search d
))
=== cast
uint8((
over a
|> search b
| search b
))
=== expression
yield (
over a
|> search b
| search b
)
=== function
quiet((
over a
|> search b
| search b
))
=== grep
where grep(/regexp/,(
over a
|> search b
| search b
))
4 changes: 2 additions & 2 deletions compiler/parser/ztests/sql-comments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ inputs:
- name: yield.spq
data: |
yield 1
|> yield this, 2, 3 -- , 4
-- |> yield 5
| yield this, 2, 3 -- , 4
-- | yield 5

outputs:
- name: stdout
Expand Down
2 changes: 1 addition & 1 deletion compiler/parser/ztests/where-expr.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
script: |
super -z -c "_path == 'conn' |> count()" in.jsup
super -z -c "_path == 'conn' | count()" in.jsup
echo ===
super -z -c "count() where _path == 'conn'" in.jsup

Expand Down
2 changes: 1 addition & 1 deletion compiler/parser/ztests/where-search.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
script: |
super -z -c 'count() where grep("foo")' in.jsup
echo ===
super -z -c "?foo |> count()" in.jsup
super -z -c "?foo | count()" in.jsup

inputs:
- name: in.jsup
Expand Down
2 changes: 1 addition & 1 deletion compiler/ztests/anycase-funcs.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
script: |
super -z -c 'c:=COUNT(),d:=Count(),Collect(LoweR(s)) by key |> sort key' in.jsup
super -z -c 'c:=COUNT(),d:=Count(),Collect(LoweR(s)) by key | sort key' in.jsup
echo ===
super -z -c 'yield LOWER(s),Collect(LoweR(s))' in.jsup
echo ===
Expand Down
2 changes: 1 addition & 1 deletion compiler/ztests/const-from.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ inputs:
from (
file a.jsup => put x:=A+1
file b.jsup => put x:=A
) |> sort x
) | sort x

- name: a.jsup
data: |
Expand Down
6 changes: 3 additions & 3 deletions compiler/ztests/const-source.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@ outputs:
const POOL = "test"

pool XXX
|> output main
| output main
)
===
(
const FILE = "A.jsup"

file A.jsup
|> output main
| output main
)
===
(
const URL = "http://brimdata.io"

get http://brimdata.io
|> output main
| output main
)
- name: stderr
data: |
Expand Down
2 changes: 1 addition & 1 deletion compiler/ztests/const-switch.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
zed: const THREE = 3 switch x ( case 1 => y:=3 case 2 => y:=2 case THREE => y:=1 ) |> sort x
zed: const THREE = 3 switch x ( case 1 => y:=3 case 2 => y:=2 case THREE => y:=1 ) | sort x

input: |
{x:1}
Expand Down
2 changes: 1 addition & 1 deletion compiler/ztests/equal-compare.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
script: |
super -z -c 'yield a=11' d.json
echo ===
super -z -c 'select distinct a,c from "d.json" where c=1 |> sort this'
super -z -c 'select distinct a,c from "d.json" where c=1 | sort this'

inputs:
- name: d.json
Expand Down
2 changes: 1 addition & 1 deletion compiler/ztests/fork-from.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ inputs:
fork (
=> from (file a.jsup => pass)
=> from (file b.jsup => pass)
) |> sort a
) | sort a
- name: a.jsup
data: |
{a:1}
Expand Down
2 changes: 1 addition & 1 deletion compiler/ztests/from-fork.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
script: |
super -z -c 'from (file in.jsup file in.jsup ) |> fork (=> count() => count())'
super -z -c 'from (file in.jsup file in.jsup ) | fork (=> count() => count())'

inputs:
- name: in.jsup
Expand Down
2 changes: 1 addition & 1 deletion compiler/ztests/from-pass.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ inputs:
from (
pass
file right.jsup
) |> inner join on x=y matched:=true
) | inner join on x=y matched:=true
- name: left.jsup
data: |
{x:1,s:"one"}
Expand Down
8 changes: 4 additions & 4 deletions compiler/ztests/head.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ outputs:
- name: stdout
data: |
null
|> head 1
|> output main
| head 1
| output main
===
null
|> (
| (
const x = 1

head 2
|> output main
| output main
)
- name: stderr
data: |
Expand Down
6 changes: 3 additions & 3 deletions compiler/ztests/join-desc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ inputs:
{"name":"figs","color":"brown","flavor":"plain"}
- name: file.zed
data: |
file fruits.jsup |> sort -r flavor
|> join (file people.jsup |> sort -r likes) on flavor=likes eater:=name
file fruits.jsup | sort -r flavor
| join (file people.jsup | sort -r likes) on flavor=likes eater:=name
- name: pool.zed
data: |
from fruits
|> join (from people) on flavor=likes eater:=name
| join (from people) on flavor=likes eater:=name

outputs:
- name: stdout
Expand Down
Loading