Repository: brimsec/zq
Pull request #2433 (2021-03-26 14:16:05)

ztest: Fix zq lookup
When checking if a path is an executable exec will return a wrapped
os.ErrNotExist error and NOT a wrapped exec.ErrNotFound. Fix this.


Patch:
diff --git a/zson/context.go b/zson/context.go
index 0594596d0..c52dd187e 100644
--- a/zson/context.go
+++ b/zson/context.go
@@ -254,10 +254,10 @@ func (c *Context) LookupByName(zson string) (zng.Type, error) {
 	// each component of a nested type.
 	c.mu.Unlock()
 	typ, err := ParseType(c, zson)
+	c.mu.Lock()
 	if err != nil {
 		return nil, err
 	}
-	c.mu.Lock()
 	// ParseType will ensure the canonical zson is in the toType table,
 	// but the zson argument here may be any conforming zson type string.
 	// Since this string may appear repeatedly (e.g., type values


Test patch:
diff --git a/compiler/parser/parser_test.go b/compiler/parser/parser_test.go
index 7fe6f4596..b88d2a68c 100644
--- a/compiler/parser/parser_test.go
+++ b/compiler/parser/parser_test.go
@@ -31,7 +31,7 @@ func searchForZqls() ([]string, error) {
 			if err != nil {
 				return err
 			}
-			z := zt.ZQL
+			z := zt.Zed
 			if z == "" || z == "*" {
 				return nil
 			}
diff --git a/compiler/parser/ztests/esc-quote.yaml b/compiler/parser/ztests/esc-quote.yaml
index 56d995572..ca2bf44a7 100644
--- a/compiler/parser/ztests/esc-quote.yaml
+++ b/compiler/parser/ztests/esc-quote.yaml
@@ -1,4 +1,4 @@
-zql: '"foo\"bar"'
+zed: '"foo\"bar"'
 
 input: |
   {s:"foo\"bar"}
diff --git a/compiler/parser/ztests/expr-pred.yaml b/compiler/parser/ztests/expr-pred.yaml
index 9269c1889..27ee40e1f 100644
--- a/compiler/parser/ztests/expr-pred.yaml
+++ b/compiler/parser/ztests/expr-pred.yaml
@@ -1,4 +1,4 @@
-zql: 'a+b>=2'
+zed: 'a+b>=2'
 
 input: |
   {a:1 (int32),b:2 (int32)} (=0)
diff --git a/compiler/parser/ztests/ipv6-in.yaml b/compiler/parser/ztests/ipv6-in.yaml
index 116a79da7..570531a5b 100644
--- a/compiler/parser/ztests/ipv6-in.yaml
+++ b/compiler/parser/ztests/ipv6-in.yaml
@@ -1,4 +1,4 @@
-zql: 'fe80::58d2:2d09:e8cb:a8ad in a OR ::58d2:2d09:e8cb:a8ad in a OR 2d09:e8cb:a8ad:: in a OR :: in a'
+zed: 'fe80::58d2:2d09:e8cb:a8ad in a OR ::58d2:2d09:e8cb:a8ad in a OR 2d09:e8cb:a8ad:: in a OR :: in a'
 
 input: &input |
   {a:[fe80::58d2:2d09:e8cb:a8ad]}
diff --git a/compiler/parser/ztests/ipv6.yaml b/compiler/parser/ztests/ipv6.yaml
index 9d06aa42e..707c17be7 100644
--- a/compiler/parser/ztests/ipv6.yaml
+++ b/compiler/parser/ztests/ipv6.yaml
@@ -1,4 +1,4 @@
-zql: 'fe80::58d2:2d09:e8cb:a8ad OR ::58d2:2d09:e8cb:a8ad OR 2d09:e8cb:a8ad:: OR ::'
+zed: 'fe80::58d2:2d09:e8cb:a8ad OR ::58d2:2d09:e8cb:a8ad OR 2d09:e8cb:a8ad:: OR ::'
 
 input: &input |
   {a:fe80::58d2:2d09:e8cb:a8ad}
diff --git a/compiler/parser/ztests/match-double.yaml b/compiler/parser/ztests/match-double.yaml
index 48f9a5cd7..bbef68a2a 100644
--- a/compiler/parser/ztests/match-double.yaml
+++ b/compiler/parser/ztests/match-double.yaml
@@ -1,4 +1,4 @@
-zql: match(a) match(b)
+zed: match(a) match(b)
 
 input: |
   {s1:"a",s2:"b"}
diff --git a/compiler/parser/ztests/match-expr.yaml b/compiler/parser/ztests/match-expr.yaml
index 46ee2328c..fc5f87bf8 100644
--- a/compiler/parser/ztests/match-expr.yaml
+++ b/compiler/parser/ztests/match-expr.yaml
@@ -1,4 +1,4 @@
-zql: 'c=a+b'
+zed: 'c=a+b'
 
 input: |
   {a:1 (int32),b:2 (int32),c:3 (int32)} (=0)
diff --git a/compiler/parser/ztests/match-is.yaml b/compiler/parser/ztests/match-is.yaml
index 02d62c78f..46092d8a8 100644
--- a/compiler/parser/ztests/match-is.yaml
+++ b/compiler/parser/ztests/match-is.yaml
@@ -1,4 +1,4 @@
-zql: match(a) is(s2,'string')
+zed: match(a) is(s2,'string')
 
 input: |
   {s1:"a",s2:"b"}
diff --git a/compiler/parser/ztests/match.yaml b/compiler/parser/ztests/match.yaml
index 0b30860df..bfaf4b70b 100644
--- a/compiler/parser/ztests/match.yaml
+++ b/compiler/parser/ztests/match.yaml
@@ -1,4 +1,4 @@
-zql: match(a)
+zed: match(a)
 
 input: |
   {s1:"a",s2:"b"}
diff --git a/compiler/parser/ztests/proc-search.yaml b/compiler/parser/ztests/proc-search.yaml
index cfe416423..e2a4d433d 100644
--- a/compiler/parser/ztests/proc-search.yaml
+++ b/compiler/parser/ztests/proc-search.yaml
@@ -1,4 +1,4 @@
-zql: '* | bar'
+zed: '* | bar'
 
 input: |
   {s1:"foo",s2:"bar"}
diff --git a/compiler/parser/ztests/select-map.yaml b/compiler/parser/ztests/select-map.yaml
index ee46b74c5..719d867b8 100644
--- a/compiler/parser/ztests/select-map.yaml
+++ b/compiler/parser/ztests/select-map.yaml
@@ -1,4 +1,4 @@
-zql: cut out=collect(select(.).map($*a))
+zed: cut out=collect(select(.).map($*a))
 
 input: |
   {a:1 (int32),b:2 (int32),c:3 (int32)} (=0)
diff --git a/compiler/parser/ztests/select-multi.yaml b/compiler/parser/ztests/select-multi.yaml
index 478e5b20a..445fea9bb 100644
--- a/compiler/parser/ztests/select-multi.yaml
+++ b/compiler/parser/ztests/select-multi.yaml
@@ -1,4 +1,4 @@
-zql: cut u1=union(select(r1)),u2=union(select(r1,r2))
+zed: cut u1=union(select(r1)),u2=union(select(r1,r2))
 
 input: |
   {r1:{a:1 (int32),b:2 (int32)} (=0),r2:{a:3,b:4} (0)} (=1)
diff --git a/compiler/parser/ztests/select-sum.yaml b/compiler/parser/ztests/select-sum.yaml
index 7101a07c1..8a0ea6658 100644
--- a/compiler/parser/ztests/select-sum.yaml
+++ b/compiler/parser/ztests/select-sum.yaml
@@ -1,4 +1,4 @@
-zql: put s1=sum(select(.)), s2=sum(select(.).filter($>=3))
+zed: put s1=sum(select(.)), s2=sum(select(.).filter($>=3))
 
 input: |
   {a:1 (int32),b:2 (int32),c:3 (int32)} (=0)
diff --git a/compiler/parser/ztests/summarize.yaml b/compiler/parser/ztests/summarize.yaml
index 3047d58a7..de0c0db14 100644
--- a/compiler/parser/ztests/summarize.yaml
+++ b/compiler/parser/ztests/summarize.yaml
@@ -1,4 +1,4 @@
-zql: summarize count() where _path=conn
+zed: summarize count() where _path=conn
 
 input: |
   {_path:"conn"}
diff --git a/compiler/parser/ztests/taste-expr.yaml b/compiler/parser/ztests/taste-expr.yaml
index 0b4e5e038..89050f1fc 100644
--- a/compiler/parser/ztests/taste-expr.yaml
+++ b/compiler/parser/ztests/taste-expr.yaml
@@ -1,4 +1,4 @@
-zql: taste s2 | sort
+zed: taste s2 | sort
 
 input: |
   {s1:"a",s2:"b"}
diff --git a/compiler/parser/ztests/taste.yaml b/compiler/parser/ztests/taste.yaml
index 2168776fa..bd8508ae7 100644
--- a/compiler/parser/ztests/taste.yaml
+++ b/compiler/parser/ztests/taste.yaml
@@ -1,4 +1,4 @@
-zql: taste | sort
+zed: taste | sort
 
 input: |
   {s1:"a",s2:"b"}
diff --git a/compiler/parser/ztests/time-dur.yaml b/compiler/parser/ztests/time-dur.yaml
index 50b878bae..efe14d552 100644
--- a/compiler/parser/ztests/time-dur.yaml
+++ b/compiler/parser/ztests/time-dur.yaml
@@ -1,4 +1,4 @@
-zql: 'cut b1=t=2018-03-24T17:15:56.5Z,b2=d=1y,b3=d>=1y,b4=match(2018-03-24T17:15:56.6Z)'
+zed: 'cut b1=t=2018-03-24T17:15:56.5Z,b2=d=1y,b3=d>=1y,b4=match(2018-03-24T17:15:56.6Z)'
 
 input: |
   {t:2018-03-24T17:15:56.4Z,d:1m}
diff --git a/compiler/parser/ztests/zson-parse.yaml b/compiler/parser/ztests/zson-parse.yaml
index 66a9372e4..5a04f03c6 100644
--- a/compiler/parser/ztests/zson-parse.yaml
+++ b/compiler/parser/ztests/zson-parse.yaml
@@ -1,4 +1,4 @@
-zql: |
+zed: |
   const r=zson_parse('{a:"1",b:2}')
   put ra=r.a,rb=r.b
 
diff --git a/compiler/ztests/const-err.yaml b/compiler/ztests/const-err.yaml
index 21ffcab8b..f971059e8 100644
--- a/compiler/ztests/const-err.yaml
+++ b/compiler/ztests/const-err.yaml
@@ -1,4 +1,4 @@
-zql: const t = a ; put x=t
+zed: const t = a ; put x=t
 
 input: |
   {a:1}
diff --git a/compiler/ztests/const-type-is.yaml b/compiler/ztests/const-type-is.yaml
index 6ea98e2f7..53689f844 100644
--- a/compiler/ztests/const-type-is.yaml
+++ b/compiler/ztests/const-type-is.yaml
@@ -1,4 +1,4 @@
-zql: const t = {a:string} ; is(t)
+zed: const t = {a:string} ; is(t)
 
 input: |
   {a:"hello"}
diff --git a/compiler/ztests/const.yaml b/compiler/ztests/const.yaml
index 39d852603..87cbbc399 100644
--- a/compiler/ztests/const.yaml
+++ b/compiler/ztests/const.yaml
@@ -1,4 +1,4 @@
-zql: const t = {a:string} ; put x=t
+zed: const t = {a:string} ; put x=t
 
 input: |
   {a:1}
diff --git a/compiler/ztests/is-proc-field.yaml b/compiler/ztests/is-proc-field.yaml
index e5d4add28..f8738ad53 100644
--- a/compiler/ztests/is-proc-field.yaml
+++ b/compiler/ztests/is-proc-field.yaml
@@ -1,4 +1,4 @@
-zql: is(a,'string')
+zed: is(a,'string')
 
 input: |
   {a:1 (int32),b:"foo"} (=0)
diff --git a/compiler/ztests/is-proc.yaml b/compiler/ztests/is-proc.yaml
index 8db55f321..d21666796 100644
--- a/compiler/ztests/is-proc.yaml
+++ b/compiler/ztests/is-proc.yaml
@@ -1,4 +1,4 @@
-zql: is('{a:int32,b:string}')
+zed: is('{a:int32,b:string}')
 
 input: |
   {a:1 (int32),b:"foo"} (=0)
diff --git a/compiler/ztests/path-index.yaml b/compiler/ztests/path-index.yaml
index f48af9ef9..dbbb3c7f1 100644
--- a/compiler/ztests/path-index.yaml
+++ b/compiler/ztests/path-index.yaml
@@ -1,4 +1,4 @@
-zql: 'put .["x.y"]=to_lower(.["x.y"])'
+zed: 'put .["x.y"]=to_lower(.["x.y"])'
 
 input: |
   {"x.y":"Hello, World"}
diff --git a/compiler/ztests/sql-from-alias-where.yaml b/compiler/ztests/sql-from-alias-where.yaml
index 22ce96dc4..05e80b68c 100644
--- a/compiler/ztests/sql-from-alias-where.yaml
+++ b/compiler/ztests/sql-from-alias-where.yaml
@@ -1,4 +1,4 @@
-zql: |
+zed: |
   SELECT *
   FROM fruit f
   ORDER BY f.name
diff --git a/compiler/ztests/sql-join-groupby.yaml b/compiler/ztests/sql-join-groupby.yaml
index 04bf8c4bd..69fc01363 100644
--- a/compiler/ztests/sql-join-groupby.yaml
+++ b/compiler/ztests/sql-join-groupby.yaml
@@ -1,4 +1,4 @@
-zql: |
+zed: |
   SELECT p.name, union(f.name)
   FROM fruit f
   LEFT JOIN person p ON f.flavor = p.likes
diff --git a/compiler/ztests/sql-join.yaml b/compiler/ztests/sql-join.yaml
index e20fb2558..7afb841fa 100644
--- a/compiler/ztests/sql-join.yaml
+++ b/compiler/ztests/sql-join.yaml
@@ -1,4 +1,4 @@
-zql: |
+zed: |
   SELECT p.name, f.name
   FROM fruit f
   LEFT JOIN person p ON f.flavor = p.likes
diff --git a/compiler/ztests/sql-order-limit.yaml b/compiler/ztests/sql-order-limit.yaml
index 9c0d3f166..4fb0ae6c4 100644
--- a/compiler/ztests/sql-order-limit.yaml
+++ b/compiler/ztests/sql-order-limit.yaml
@@ -1,4 +1,4 @@
-zql: |
+zed: |
   SELECT *
   FROM fruit
   ORDER BY name
diff --git a/compiler/ztests/sql-search-mixed.yaml b/compiler/ztests/sql-search-mixed.yaml
index ecf0a5c78..4a5880be4 100644
--- a/compiler/ztests/sql-search-mixed.yaml
+++ b/compiler/ztests/sql-search-mixed.yaml
@@ -1,4 +1,4 @@
-zql: |
+zed: |
   SELECT *
   WHERE 'red' in color OR age < 20
   | union(name) by flavor
diff --git a/compiler/ztests/sql-search.yaml b/compiler/ztests/sql-search.yaml
index 38a9e532d..a36eb5571 100644
--- a/compiler/ztests/sql-search.yaml
+++ b/compiler/ztests/sql-search.yaml
@@ -1,4 +1,4 @@
-zql: |
+zed: |
   SELECT *
   WHERE 'red' in color OR age < 20
 
diff --git a/compiler/ztests/sql-select-star.yaml b/compiler/ztests/sql-select-star.yaml
index 4a3bb8894..328c133f4 100644
--- a/compiler/ztests/sql-select-star.yaml
+++ b/compiler/ztests/sql-select-star.yaml
@@ -1,4 +1,4 @@
-zql: SELECT *
+zed: SELECT *
 
 input: &input |
   {name:"apple",color:"red",flavor:"tart"} (=fruit)
diff --git a/expr/agg/ztests/fuse-container.yaml b/expr/agg/ztests/fuse-container.yaml
index b8b04f1f4..85150e003 100644
--- a/expr/agg/ztests/fuse-container.yaml
+++ b/expr/agg/ztests/fuse-container.yaml
@@ -1,7 +1,7 @@
 # Enable after fixing https://github.com/brimsec/zq/issues/2145.
 skip: true
 
-zql: all=fuse(.),r=fuse(r)
+zed: all=fuse(.),r=fuse(r)
 
 input: |
   #0:record[a:string,r:record[x:int32,y:int32]]
diff --git a/expr/agg/ztests/fuse-dup.yaml b/expr/agg/ztests/fuse-dup.yaml
index 05bf75979..8f9847e57 100644
--- a/expr/agg/ztests/fuse-dup.yaml
+++ b/expr/agg/ztests/fuse-dup.yaml
@@ -1,7 +1,7 @@
 # Enable after fixing https://github.com/brimsec/zq/issues/2145.
 skip: true
 
-zql: fuse(.)
+zed: fuse(.)
 
 input: |
   #0:record[a:string,b:string]
diff --git a/expr/agg/ztests/fuse-partials.yaml b/expr/agg/ztests/fuse-partials.yaml
index 9d053d99a..184397c9d 100644
--- a/expr/agg/ztests/fuse-partials.yaml
+++ b/expr/agg/ztests/fuse-partials.yaml
@@ -1,4 +1,4 @@
-zql: fuse(.) by key with -limit 1
+zed: fuse(.) by key with -limit 1
 
 input: |
   #0:record[a:string,r:record[x:int32,y:int32],key:string]
diff --git a/expr/agg/ztests/groupby-missing.yaml b/expr/agg/ztests/groupby-missing.yaml
index badcf98c3..8b3e6f815 100644
--- a/expr/agg/ztests/groupby-missing.yaml
+++ b/expr/agg/ztests/groupby-missing.yaml
@@ -1,4 +1,4 @@
-zql: |
+zed: |
   by a=a[0], b=b.c
 
 input: |
diff --git a/expr/agg/ztests/logical-partials.yaml b/expr/agg/ztests/logical-partials.yaml
index 9190aa4e0..7df39708a 100644
--- a/expr/agg/ztests/logical-partials.yaml
+++ b/expr/agg/ztests/logical-partials.yaml
@@ -1,4 +1,4 @@
-zql: 't1=or(x>2),t2=or(x>4),t3=and(x>0),t4=and(x>2),t5=and(x>2) where x>2 by key with -limit 1 | sort .'
+zed: 't1=or(x>2),t2=or(x>4),t3=and(x>0),t4=and(x>2),t5=and(x>2) where x>2 by key with -limit 1 | sort .'
 input: |
   #0:record[key:string,x:int32]
   0:[a;1;]
diff --git a/expr/agg/ztests/logical.yaml b/expr/agg/ztests/logical.yaml
index 9a60d90a2..1d53b3eb7 100644
--- a/expr/agg/ztests/logical.yaml
+++ b/expr/agg/ztests/logical.yaml
@@ -1,4 +1,4 @@
-zql: 't1=or(x>2),t2=or(x>4),t3=and(x>0),t4=and(x>2),t5=and(x>2) where x>2'
+zed: 't1=or(x>2),t2=or(x>4),t3=and(x>0),t4=and(x>2),t5=and(x>2) where x>2'
 
 input: |
   #0:record[x:int32]
diff --git a/expr/expr_test.go b/expr/expr_test.go
index 315bf2564..db6ef4940 100644
--- a/expr/expr_test.go
+++ b/expr/expr_test.go
@@ -27,7 +27,7 @@ func testSuccessful(t *testing.T, e string, record string, expect zng.Value) {
 	val, err := formatter.Format(zng.Value{rec.Type, rec.Raw})
 	require.NoError(t, err)
 	zt := &ztest.ZTest{
-		ZQL:    fmt.Sprintf("cut result = %s", e),
+		Zed:    fmt.Sprintf("cut result = %s", e),
 		Input:  record,
 		Output: val + "\n",
 	}
@@ -44,7 +44,7 @@ func testError(t *testing.T, e string, record string, expectErr error, descripti
 		record = "{}"
 	}
 	zt := &ztest.ZTest{
-		ZQL:     fmt.Sprintf("cut result = %s", e),
+		Zed:     fmt.Sprintf("cut result = %s", e),
 		Input:   record,
 		Output:  "",
 		ErrorRE: expectErr.Error(),
diff --git a/expr/function/ztests/iso.yaml b/expr/function/ztests/iso.yaml
index 64278901c..1b64e1198 100644
--- a/expr/function/ztests/iso.yaml
+++ b/expr/function/ztests/iso.yaml
@@ -1,4 +1,4 @@
-zql: |
+zed: |
    put z=iso(z), offsetWithoutColon=iso(offsetWithoutColon), offsetWithColon=iso(offsetWithColon)
 
 input: |
diff --git a/expr/ztests/array-bounds-2.yaml b/expr/ztests/array-bounds-2.yaml
index ef482520f..d04be1f47 100644
--- a/expr/ztests/array-bounds-2.yaml
+++ b/expr/ztests/array-bounds-2.yaml
@@ -1,4 +1,4 @@
-zql: cut m1=missing(a[-1]),m2=missing(a[3])
+zed: cut m1=missing(a[-1]),m2=missing(a[3])
 
 input: |
   {x:[1,2,3],i:1 (uint16)} (=0)
diff --git a/expr/ztests/array-bounds.yaml b/expr/ztests/array-bounds.yaml
index 443bbb316..53c8ab48e 100644
--- a/expr/ztests/array-bounds.yaml
+++ b/expr/ztests/array-bounds.yaml
@@ -1,4 +1,4 @@
-zql: put b=missing(a[2])
+zed: put b=missing(a[2])
 
 input: |
   {a:[1,2,3]}
diff --git a/expr/ztests/cast-bstring-string.yaml b/expr/ztests/cast-bstring-string.yaml
index ebba4f789..698219648 100644
--- a/expr/ztests/cast-bstring-string.yaml
+++ b/expr/ztests/cast-bstring-string.yaml
@@ -1,4 +1,4 @@
-zql: 'cut s=string(b)'
+zed: 'cut s=string(b)'
 
 input: |
   {b:"\x30\x31\x32"(bstring)}
diff --git a/expr/ztests/cast-bytes-string-err.yaml b/expr/ztests/cast-bytes-string-err.yaml
index 822709142..c88c8df4f 100644
--- a/expr/ztests/cast-bytes-string-err.yaml
+++ b/expr/ztests/cast-bytes-string-err.yaml
@@ -1,4 +1,4 @@
-zql: 'put s=string(b)'
+zed: 'put s=string(b)'
 
 input: |
   {b:0xc328}
diff --git a/expr/ztests/cast-bytes-string.yaml b/expr/ztests/cast-bytes-string.yaml
index 54e05e6a5..65b166abe 100644
--- a/expr/ztests/cast-bytes-string.yaml
+++ b/expr/ztests/cast-bytes-string.yaml
@@ -1,4 +1,4 @@
-zql: 'put s=string(b)'
+zed: 'put s=string(b)'
 
 input: |
   {b:0x303132}
diff --git a/expr/ztests/cast-name-only.yaml b/expr/ztests/cast-name-only.yaml
index 166570c51..c23c847da 100644
--- a/expr/ztests/cast-name-only.yaml
+++ b/expr/ztests/cast-name-only.yaml
@@ -1,4 +1,4 @@
-zql: type foo = {x:int64} ; put .=cast(., type(foo))
+zed: type foo = {x:int64} ; put .=cast(., type(foo))
 
 input: |
   {x:123}
diff --git a/expr/ztests/cast-time.yaml b/expr/ztests/cast-time.yaml
index db75c02c8..6b5f2dcd3 100644
--- a/expr/ztests/cast-time.yaml
+++ b/expr/ztests/cast-time.yaml
@@ -1,4 +1,4 @@
-zql: put t=time(t)
+zed: put t=time(t)
 
 input: |
   {t:1521911720.600843}
diff --git a/expr/ztests/complex-empty.yaml b/expr/ztests/complex-empty.yaml
index 26fbf0865..82235023e 100644
--- a/expr/ztests/complex-empty.yaml
+++ b/expr/ztests/complex-empty.yaml
@@ -1,4 +1,4 @@
-zql: put a=[],s=|[]|,m=|{}|
+zed: put a=[],s=|[]|,m=|{}|
 
 input: |
   {}
diff --git a/expr/ztests/complex-in-set.yaml b/expr/ztests/complex-in-set.yaml
index 3b5c32b00..df307bdf6 100644
--- a/expr/ztests/complex-in-set.yaml
+++ b/expr/ztests/complex-in-set.yaml
@@ -1,4 +1,4 @@
-zql: a in |[1,2,3]|
+zed: a in |[1,2,3]|
 
 input: |
   {a:2}
diff --git a/expr/ztests/complex-in.yaml b/expr/ztests/complex-in.yaml
index 1e3fcec64..048e9eead 100644
--- a/expr/ztests/complex-in.yaml
+++ b/expr/ztests/complex-in.yaml
@@ -1,4 +1,4 @@
-zql: a in [1,2,3]
+zed: a in [1,2,3]
 
 input: |
   {a:2}
diff --git a/expr/ztests/complex-map.yaml b/expr/ztests/complex-map.yaml
index 2e721dc7b..db42a7293 100644
--- a/expr/ztests/complex-map.yaml
+++ b/expr/ztests/complex-map.yaml
@@ -1,4 +1,4 @@
-zql: 'const m = |{ "a": 192.168.1.1, "b": 192.168.1.2 }| ; put x=m'
+zed: 'const m = |{ "a": 192.168.1.1, "b": 192.168.1.2 }| ; put x=m'
 
 input: |
   {}
diff --git a/expr/ztests/complex-record-math.yaml b/expr/ztests/complex-record-math.yaml
index 3d421d51b..65e22ee32 100644
--- a/expr/ztests/complex-record-math.yaml
+++ b/expr/ztests/complex-record-math.yaml
@@ -1,4 +1,4 @@
-zql: cut r={x:a+b,y:a-b},a1=[a],a2=[a+b,a-b]
+zed: cut r={x:a+b,y:a-b},a1=[a],a2=[a+b,a-b]
 
 input: |
   {a:2,b:1}
diff --git a/expr/ztests/complex-set.yaml b/expr/ztests/complex-set.yaml
index 9211fd8a9..5ed3db1c1 100644
--- a/expr/ztests/complex-set.yaml
+++ b/expr/ztests/complex-set.yaml
@@ -1,4 +1,4 @@
-zql: 'const s = |[ 192.168.2.0/24, 192.168.1.0/24 ]| ; put x=s'
+zed: 'const s = |[ 192.168.2.0/24, 192.168.1.0/24 ]| ; put x=s'
 
 input: |
   {}
diff --git a/expr/ztests/cut-expr.yaml b/expr/ztests/cut-expr.yaml
index 9da570b2f..e558796ea 100644
--- a/expr/ztests/cut-expr.yaml
+++ b/expr/ztests/cut-expr.yaml
@@ -1,4 +1,4 @@
-zql: 'cut y=x+1,a=to_lower(s),typeof(s)'
+zed: 'cut y=x+1,a=to_lower(s),typeof(s)'
 
 input: |
   #0:record[a:array[int32],x:int32,s:string,b:bytes]
diff --git a/expr/ztests/cut-mixed-types.yaml b/expr/ztests/cut-mixed-types.yaml
index d8e7f454c..92656a487 100644
--- a/expr/ztests/cut-mixed-types.yaml
+++ b/expr/ztests/cut-mixed-types.yaml
@@ -1,4 +1,4 @@
-zql: 'cut x=network_of(addr)'
+zed: 'cut x=network_of(addr)'
 
 input: |
   #0:record[addr:ip]
diff --git a/expr/ztests/cut-root-error.yaml b/expr/ztests/cut-root-error.yaml
index 9eb1e73b9..cef5a6ec8 100644
--- a/expr/ztests/cut-root-error.yaml
+++ b/expr/ztests/cut-root-error.yaml
@@ -1,4 +1,4 @@
-zql: 'put x=cut(.,b)'
+zed: 'put x=cut(.,b)'
 
 input: |
   #0:record[a:int32,b:int32]
diff --git a/expr/ztests/cut-root.yaml b/expr/ztests/cut-root.yaml
index 547c4d025..96ae66fec 100644
--- a/expr/ztests/cut-root.yaml
+++ b/expr/ztests/cut-root.yaml
@@ -1,4 +1,4 @@
-zql: 'put x=cut(.)'
+zed: 'put x=cut(.)'
 
 input: |
   #0:record[a:record[b:int32]]
diff --git a/expr/ztests/cut-to-root-error-multiple-values.yaml b/expr/ztests/cut-to-root-error-multiple-values.yaml
index f56a5e1cd..f8f07dec0 100644
--- a/expr/ztests/cut-to-root-error-multiple-values.yaml
+++ b/expr/ztests/cut-to-root-error-multiple-values.yaml
@@ -1,4 +1,4 @@
-zql: 'cut .=a,x=b'
+zed: 'cut .=a,x=b'
 
 input: |
   #0:record[a:int32,b:int32]
diff --git a/expr/ztests/cut-to-root-error-non-record.yaml b/expr/ztests/cut-to-root-error-non-record.yaml
index 94834a341..fb3f1e9fd 100644
--- a/expr/ztests/cut-to-root-error-non-record.yaml
+++ b/expr/ztests/cut-to-root-error-non-record.yaml
@@ -1,4 +1,4 @@
-zql: 'cut .=a'
+zed: 'cut .=a'
 
 input: |
   #0:record[a:int32]
diff --git a/expr/ztests/cut-to-root-warning.yaml b/expr/ztests/cut-to-root-warning.yaml
index c621d3b28..36a0b66ed 100644
--- a/expr/ztests/cut-to-root-warning.yaml
+++ b/expr/ztests/cut-to-root-warning.yaml
@@ -1,4 +1,4 @@
-zql: 'cut .=c'
+zed: 'cut .=c'
 
 input: |
   #0:record[a:record[b:int32]]
diff --git a/expr/ztests/cut-to-root.yaml b/expr/ztests/cut-to-root.yaml
index bf769b78b..65dc0fdd3 100644
--- a/expr/ztests/cut-to-root.yaml
+++ b/expr/ztests/cut-to-root.yaml
@@ -1,4 +1,4 @@
-zql: 'cut .=a'
+zed: 'cut .=a'
 
 input: |
   #0:record[a:record[b:int32]]
diff --git a/expr/ztests/cut-union.yaml b/expr/ztests/cut-union.yaml
index ce35c4cad..2a74f49ad 100644
--- a/expr/ztests/cut-union.yaml
+++ b/expr/ztests/cut-union.yaml
@@ -1,4 +1,4 @@
-zql: a=union(cut(x)),b=union(cut(x,s))
+zed: a=union(cut(x)),b=union(cut(x,s))
 
 input: |
   #0:record[x:int32,s:string]
diff --git a/expr/ztests/cut.yaml b/expr/ztests/cut.yaml
index 321d0129d..0f4b086f2 100644
--- a/expr/ztests/cut.yaml
+++ b/expr/ztests/cut.yaml
@@ -1,4 +1,4 @@
-zql: put v=cut(s,x)
+zed: put v=cut(s,x)
 
 warnings: |
   put: a referenced field is missing
diff --git a/expr/ztests/dot-alias-rec.yaml b/expr/ztests/dot-alias-rec.yaml
index 5212b41ac..b2011b366 100644
--- a/expr/ztests/dot-alias-rec.yaml
+++ b/expr/ztests/dot-alias-rec.yaml
@@ -1,4 +1,4 @@
-zql: cut v=a.f
+zed: cut v=a.f
 
 input: |
   #foo=record[f:int8]
diff --git a/expr/ztests/dot-index.yaml b/expr/ztests/dot-index.yaml
index f27792c13..fd02a0941 100644
--- a/expr/ztests/dot-index.yaml
+++ b/expr/ztests/dot-index.yaml
@@ -1,4 +1,4 @@
-zql: put s1=.["yodawg"],s2=.[yodawg],k=.["..."]+1
+zed: put s1=.["yodawg"],s2=.[yodawg],k=.["..."]+1
 
 input: |
   #0:record[foo:string,[bar]:string,[...]:int32,yodawg:string]
diff --git a/expr/ztests/exists.yaml b/expr/ztests/exists.yaml
index 4d400409f..61516a5e2 100644
--- a/expr/ztests/exists.yaml
+++ b/expr/ztests/exists.yaml
@@ -1,4 +1,4 @@
-zql: cut r=exists(r),rb=exists(r.b),div0=exists(s/0),s=exists(s),both=exists(r,r.b)
+zed: cut r=exists(r),rb=exists(r.b),div0=exists(s/0),s=exists(s),both=exists(r,r.b)
 
 input: |
   #0:record[r:record[a:int32],s:int32]
diff --git a/expr/ztests/fields.yaml b/expr/ztests/fields.yaml
index 39fe8b756..850bd6139 100644
--- a/expr/ztests/fields.yaml
+++ b/expr/ztests/fields.yaml
@@ -1,4 +1,4 @@
-zql: cut fields(.), fields2=fields(r)
+zed: cut fields(.), fields2=fields(r)
 
 input: |
   #0:record[r:record[a:int32],s:int32]
diff --git a/expr/ztests/has.yaml b/expr/ztests/has.yaml
index 7ff8d1fe2..7a755c1d3 100644
--- a/expr/ztests/has.yaml
+++ b/expr/ztests/has.yaml
@@ -1,4 +1,4 @@
-zql: has(x)
+zed: has(x)
 
 input: |
   {x:1}
diff --git a/expr/ztests/in-field.yaml b/expr/ztests/in-field.yaml
index 8292ae04f..83c6855ac 100644
--- a/expr/ztests/in-field.yaml
+++ b/expr/ztests/in-field.yaml
@@ -1,4 +1,4 @@
-zql: 2 in a
+zed: 2 in a
 
 input: |
   #0:record[a:array[uint32]]
diff --git a/expr/ztests/in-map.yaml b/expr/ztests/in-map.yaml
index 6f53a93d3..fe53560c1 100644
--- a/expr/ztests/in-map.yaml
+++ b/expr/ztests/in-map.yaml
@@ -1,4 +1,4 @@
-zql: |
+zed: |
   const m = |{"a": 1, "b": 2}|
   cut b1=match(x in m),b2=match("a" in a)
 
diff --git a/expr/ztests/in-star.yaml b/expr/ztests/in-star.yaml
index 55a4b2b0c..f7f461fba 100644
--- a/expr/ztests/in-star.yaml
+++ b/expr/ztests/in-star.yaml
@@ -1,4 +1,4 @@
-zql: 2 in *
+zed: 2 in *
 
 input: |
   #0:record[a:array[uint32]]
diff --git a/expr/ztests/ip-len.yaml b/expr/ztests/ip-len.yaml
index b24f16070..ec0261241 100644
--- a/expr/ztests/ip-len.yaml
+++ b/expr/ztests/ip-len.yaml
@@ -1,4 +1,4 @@
-zql: cut n1=len(addr),n2=len(n)
+zed: cut n1=len(addr),n2=len(n)
 
 input: |
   #0:record[addr:ip,n:net]
diff --git a/expr/ztests/is-late-binding.yaml b/expr/ztests/is-late-binding.yaml
new file mode 100644
index 000000000..5827c1fb3
--- /dev/null
+++ b/expr/ztests/is-late-binding.yaml
@@ -0,0 +1,11 @@
+zed: is(type(foo))
+
+input: |
+  {x:1}
+  {x:2} (=foo)
+  {x:3}
+  {x:4} (foo)
+
+output: |
+  {x:2} (=foo)
+  {x:4} (foo)
diff --git a/expr/ztests/is-typedef.yaml b/expr/ztests/is-typedef.yaml
index 99ce961ee..9dd4b420e 100644
--- a/expr/ztests/is-typedef.yaml
+++ b/expr/ztests/is-typedef.yaml
@@ -1,4 +1,4 @@
-zql: |
+zed: |
   type socket={addr:ip, port:uint16}
   const PI=3.14
   is(src,type(socket)) | put pi=PI
diff --git a/expr/ztests/is.yaml b/expr/ztests/is.yaml
index f75e1dec6..a8a8065ba 100644
--- a/expr/ztests/is.yaml
+++ b/expr/ztests/is.yaml
@@ -1,4 +1,4 @@
-zql: cut isRecType=is(r, {a:int32}), isString=is(s, type(string))
+zed: cut isRecType=is(r, {a:int32}), isString=is(s, type(string))
 
 input: |
   #0:record[r:record[a:int32],s:int32]
diff --git a/expr/ztests/join.yaml b/expr/ztests/join.yaml
index f57b2e5dc..a809a7186 100644
--- a/expr/ztests/join.yaml
+++ b/expr/ztests/join.yaml
@@ -1,4 +1,4 @@
-zql: |
+zed: |
    cut s1=join(a1,"."),s2=join(a1,"."),s3=join(a3,"."),s4=join(a4,"."),s5=join(oo)
 
 input: |
diff --git a/expr/ztests/map-normalize.yaml b/expr/ztests/map-normalize.yaml
index 3a42dfa86..40f224560 100644
--- a/expr/ztests/map-normalize.yaml
+++ b/expr/ztests/map-normalize.yaml
@@ -1,4 +1,4 @@
-zql: |
+zed: |
   put m=|{"b":2,"a":1,"b":2}|
 
 input: |
diff --git a/expr/ztests/missing.yaml b/expr/ztests/missing.yaml
index c78b940f3..dd1ad1a29 100644
--- a/expr/ztests/missing.yaml
+++ b/expr/ztests/missing.yaml
@@ -1,4 +1,4 @@
-zql: put missingX=missing(x),missingType=missing(nameof(.))
+zed: put missingX=missing(x),missingType=missing(nameof(.))
 
 input: |
   {x:1}
diff --git a/expr/ztests/net-match.yaml b/expr/ztests/net-match.yaml
index b59170f72..746a1ccf4 100644
--- a/expr/ztests/net-match.yaml
+++ b/expr/ztests/net-match.yaml
@@ -1,4 +1,4 @@
-zql: a=192.168.2.0/24 or n=192.168.2.0/24
+zed: a=192.168.2.0/24 or n=192.168.2.0/24
 
 input: |
   {a:192.168.1.1}
diff --git a/expr/ztests/net-search.yaml b/expr/ztests/net-search.yaml
index 8d1157267..36b6f9912 100644
--- a/expr/ztests/net-search.yaml
+++ b/expr/ztests/net-search.yaml
@@ -1,4 +1,4 @@
-zql: 192.168.2.0/24
+zed: 192.168.2.0/24
 
 input: |
   {a:192.168.1.1}
diff --git a/expr/ztests/network-of.yaml b/expr/ztests/network-of.yaml
index 289b3b075..86bd76975 100644
--- a/expr/ztests/network-of.yaml
+++ b/expr/ztests/network-of.yaml
@@ -1,4 +1,4 @@
-zql: put n1=network_of(a,mask),n2=network_of(a,24)
+zed: put n1=network_of(a,mask),n2=network_of(a,24)
 
 input: |
   #0:record[a:ip,mask:net]
diff --git a/expr/ztests/null-cast.yaml b/expr/ztests/null-cast.yaml
index acc4f783d..0211c20cb 100644
--- a/expr/ztests/null-cast.yaml
+++ b/expr/ztests/null-cast.yaml
@@ -1,4 +1,4 @@
-zql: cut s=string(null),a=ip(null)
+zed: cut s=string(null),a=ip(null)
 
 input: |
   #0:record[x:string]
diff --git a/expr/ztests/pick.yaml b/expr/ztests/pick.yaml
index 630197655..5a5f386df 100644
--- a/expr/ztests/pick.yaml
+++ b/expr/ztests/pick.yaml
@@ -1,4 +1,4 @@
-zql: pick s,x
+zed: pick s,x
 
 input: |
   #0:record[x:int32,s:string]
diff --git a/expr/ztests/shape-alias.yaml b/expr/ztests/shape-alias.yaml
index 6f13723b0..c120031a3 100644
--- a/expr/ztests/shape-alias.yaml
+++ b/expr/ztests/shape-alias.yaml
@@ -1,4 +1,4 @@
-zql: |
+zed: |
   type port=int64; type prec={p: port, q: port}; type parr=[prec]; put .=shape({c: port, b:parr, a:prec})
 
 input: |
diff --git a/expr/ztests/shape-cast-alias.yaml b/expr/ztests/shape-cast-alias.yaml
index 421bd9648..fc07450bd 100644
--- a/expr/ztests/shape-cast-alias.yaml
+++ b/expr/ztests/shape-cast-alias.yaml
@@ -1,4 +1,4 @@
-zql: |
+zed: |
   type port=int64; type prec={p: port}; type parr=[port]; put .=cast({a:port, b:prec, c: parr})
 
 input: |
diff --git a/expr/ztests/shape-cast-array-to-set.yaml b/expr/ztests/shape-cast-array-to-set.yaml
index e4d67f732..13eb45df0 100644
--- a/expr/ztests/shape-cast-array-to-set.yaml
+++ b/expr/ztests/shape-cast-array-to-set.yaml
@@ -1,4 +1,4 @@
-zql: |
+zed: |
   put . = cast({a:|[ip]|,b:|[{b:ip}]|})
 
 input: |
diff --git a/expr/ztests/shape-cast-arrays.yaml b/expr/ztests/shape-cast-arrays.yaml
index 8fcb19236..37061b03b 100644
--- a/expr/ztests/shape-cast-arrays.yaml
+++ b/expr/ztests/shape-cast-arrays.yaml
@@ -1,4 +1,4 @@
-zql: |
+zed: |
   put . = cast({a:[ip],b:[{b:ip}]})
 
 input: |
diff --git a/expr/ztests/shape-cast-set-to-array.yaml b/expr/ztests/shape-cast-set-to-array.yaml
index d00793ba4..b056db7cd 100644
--- a/expr/ztests/shape-cast-set-to-array.yaml
+++ b/expr/ztests/shape-cast-set-to-array.yaml
@@ -1,4 +1,4 @@
-zql: |
+zed: |
   put . = cast({a:[ip],b:[{b:ip}]})
 
 input: |
diff --git a/expr/ztests/shape-cast-sets.yaml b/expr/ztests/shape-cast-sets.yaml
index 9d177dbcc..c43b96c22 100644
--- a/expr/ztests/shape-cast-sets.yaml
+++ b/expr/ztests/shape-cast-sets.yaml
@@ -1,4 +1,4 @@
-zql: |
+zed: |
   put . = cast({a:|[ip]|,b:|[{b:ip}]|})
 
 input: |
diff --git a/expr/ztests/shape-cast.yaml b/expr/ztests/shape-cast.yaml
index 4178e23f5..a28e33473 100644
--- a/expr/ztests/shape-cast.yaml
+++ b/expr/ztests/shape-cast.yaml
@@ -1,4 +1,4 @@
-zql: |
+zed: |
    put
    // cast to type with same field order
    id=cast(id, {orig_h:ip,orig_p:port=(uint16),resp_h:ip,resp_p:port}),
diff --git a/expr/ztests/shape-crop-alias.yaml b/expr/ztests/shape-crop-alias.yaml
index a29fa904d..9bfb58bf7 100644
--- a/expr/ztests/shape-crop-alias.yaml
+++ b/expr/ztests/shape-crop-alias.yaml
@@ -1,4 +1,4 @@
-zql: |
+zed: |
   type port=int64; type prec={p: port}; type parr=[prec]; put .=crop({a:prec, b:parr})
 
 input: |
diff --git a/expr/ztests/shape-crop-arrays-sets.yaml b/expr/ztests/shape-crop-arrays-sets.yaml
index db7f633f0..62171fae3 100644
--- a/expr/ztests/shape-crop-arrays-sets.yaml
+++ b/expr/ztests/shape-crop-arrays-sets.yaml
@@ -1,4 +1,4 @@
-zql: |
+zed: |
   put . = crop({set:|[{b:string}]|,arr:[{a:string}]})
 
 input: |
diff --git a/expr/ztests/shape-crop.yaml b/expr/ztests/shape-crop.yaml
index 25faec3c2..3754c1847 100644
--- a/expr/ztests/shape-crop.yaml
+++ b/expr/ztests/shape-crop.yaml
@@ -1,4 +1,4 @@
-zql: |
+zed: |
    put
    // crop to type with same field order
    id=crop(id, {orig_h:ip,orig_p:port=(uint16)}),
diff --git a/expr/ztests/shape-fill-alias.yaml b/expr/ztests/shape-fill-alias.yaml
index 3ccc2b5b0..26713e54a 100644
--- a/expr/ztests/shape-fill-alias.yaml
+++ b/expr/ztests/shape-fill-alias.yaml
@@ -1,4 +1,4 @@
-zql: |
+zed: |
   type port=int64; type prec={p: port, q: port}; type parr=[prec]; put .=fill({a:prec, b:parr, c:port})
 
 input: |
diff --git a/expr/ztests/shape-fill-arrays-sets.yaml b/expr/ztests/shape-fill-arrays-sets.yaml
index dbe2f73e4..bc9e841a1 100644
--- a/expr/ztests/shape-fill-arrays-sets.yaml
+++ b/expr/ztests/shape-fill-arrays-sets.yaml
@@ -1,4 +1,4 @@
-zql: |
+zed: |
   put . = fill({arr:[{b:string,a:string}],set:|[{b:string,a:string}]|})
 
 input: |
diff --git a/expr/ztests/shape-fill-fit.yaml b/expr/ztests/shape-fill-fit.yaml
index c3b42fe78..981ea2b87 100644
--- a/expr/ztests/shape-fill-fit.yaml
+++ b/expr/ztests/shape-fill-fit.yaml
@@ -1,4 +1,4 @@
-zql: |
+zed: |
    cut id_filled=fill(id, {orig_h:ip,orig_p:port=(uint16)}),  id_fitted=fit(id, {orig_h:ip,orig_p:port=(uint16)})
 
 input: |
diff --git a/expr/ztests/shape-fill.yaml b/expr/ztests/shape-fill.yaml
index 57b91345f..01bd08f50 100644
--- a/expr/ztests/shape-fill.yaml
+++ b/expr/ztests/shape-fill.yaml
@@ -1,4 +1,4 @@
-zql: put . = fill({a:{b:{c:string}}})
+zed: put . = fill({a:{b:{c:string}}})
 
 input: |
   #0:record[s:string]
diff --git a/expr/ztests/shape-map.yaml b/expr/ztests/shape-map.yaml
index c2f5f72b7..43f815e1b 100644
--- a/expr/ztests/shape-map.yaml
+++ b/expr/ztests/shape-map.yaml
@@ -1,4 +1,4 @@
-zql: |
+zed: |
   type conn = {_path:string, id:{src:ip,dst:ip}, etc:string}
   type dns = {_path:string, id:{src:ip,dst:ip}, query:string, query_size:uint64}
   const schemas = |{
diff --git a/expr/ztests/shape-nested.yaml b/expr/ztests/shape-nested.yaml
index a4bfe6931..d047d9245 100644
--- a/expr/ztests/shape-nested.yaml
+++ b/expr/ztests/shape-nested.yaml
@@ -1,4 +1,4 @@
-zql: |
+zed: |
    cut x = shape({a:{a:float64,b:float64}})
 
 input: |
diff --git a/expr/ztests/shape-null-cast.yaml b/expr/ztests/shape-null-cast.yaml
index c4a5658fb..2e9393610 100644
--- a/expr/ztests/shape-null-cast.yaml
+++ b/expr/ztests/shape-null-cast.yaml
@@ -1,4 +1,4 @@
-zql: |
+zed: |
    put . = shape({a:string,b:string})
 
 input: |
diff --git a/expr/ztests/shape-order-alias.yaml b/expr/ztests/shape-order-alias.yaml
index 2d009461b..679110f3d 100644
--- a/expr/ztests/shape-order-alias.yaml
+++ b/expr/ztests/shape-order-alias.yaml
@@ -1,4 +1,4 @@
-zql: |
+zed: |
   type port=int64; type prec={p: port, q: port}; type parr=[prec]; put .=order({c: port, b:parr, a:prec})
 
 input: |
diff --git a/expr/ztests/shape-order-arrays-sets.yaml b/expr/ztests/shape-order-arrays-sets.yaml
index 1634c541a..2f70db39c 100644
--- a/expr/ztests/shape-order-arrays-sets.yaml
+++ b/expr/ztests/shape-order-arrays-sets.yaml
@@ -1,4 +1,4 @@
-zql: |
+zed: |
   put . = order({set:|[{b:string,a:string}]|,arr:[{b:string,a:string}]})
 
 input: |
diff --git a/expr/ztests/shape-order.yaml b/expr/ztests/shape-order.yaml
index d8942529a..6c15ca3f3 100644
--- a/expr/ztests/shape-order.yaml
+++ b/expr/ztests/shape-order.yaml
@@ -1,4 +1,4 @@
-zql: |
+zed: |
    put .=order({id: {orig_h: string, orig_p: port=(uint16), resp_h:ip,resp_p:port=(uint16)}})
 
 input: |
diff --git a/expr/ztests/shape-rec-alias.yaml b/expr/ztests/shape-rec-alias.yaml
index fcbc2c7d5..988167e94 100644
--- a/expr/ztests/shape-rec-alias.yaml
+++ b/expr/ztests/shape-rec-alias.yaml
@@ -1,4 +1,4 @@
-zql: |
+zed: |
   type person = {name:string,likes:string,age:int64}
   put .=cast(.,type(person))
 
diff --git a/expr/ztests/shape-zson-typedef.yaml b/expr/ztests/shape-zson-typedef.yaml
index b1c0d0fc5..d89ee948a 100644
--- a/expr/ztests/shape-zson-typedef.yaml
+++ b/expr/ztests/shape-zson-typedef.yaml
@@ -1,4 +1,4 @@
-zql: name=steve | put .=shape(.,type(person))
+zed: name=steve | put .=shape(.,type(person))
 
 input: |
   {name:"jim", likes: "plain", age:30} (=person)
diff --git a/expr/ztests/shape.yaml b/expr/ztests/shape.yaml
index 5ce4f8f15..324e99322 100644
--- a/expr/ztests/shape.yaml
+++ b/expr/ztests/shape.yaml
@@ -1,4 +1,4 @@
-zql: |
+zed: |
   type id={orig_h: ip, orig_p: port=(uint16), vlan: uint16, resp_h:ip,resp_p:port}
   type rec={id: id}
   put .=shape(rec)
diff --git a/expr/ztests/slice.yaml b/expr/ztests/slice.yaml
index 3f047490d..a7d53e958 100644
--- a/expr/ztests/slice.yaml
+++ b/expr/ztests/slice.yaml
@@ -1,4 +1,4 @@
-zql: "cut a1=a[1:-1],a2=a[1:],a3=a[:1],a4=a[:-1],a5=a[:-100],a6=a[-1:],a7=a[-2:-1],a8=(a!=null and len(a)>0) ? a[:a[0]-8] : null"
+zed: "cut a1=a[1:-1],a2=a[1:],a3=a[:1],a4=a[:-1],a5=a[:-100],a6=a[-1:],a7=a[-2:-1],a8=(a!=null and len(a)>0) ? a[:a[0]-8] : null"
 
 input: |
   #0:record[a:array[int32]]
diff --git a/expr/ztests/split-multi.yaml b/expr/ztests/split-multi.yaml
index 8b739130b..c1aabc2fb 100644
--- a/expr/ztests/split-multi.yaml
+++ b/expr/ztests/split-multi.yaml
@@ -1,4 +1,4 @@
-zql: cut split(s,".")
+zed: cut split(s,".")
 
 input: |
   #0:record[s:string]
diff --git a/expr/ztests/split.yaml b/expr/ztests/split.yaml
index b7cee25cc..02d9da997 100644
--- a/expr/ztests/split.yaml
+++ b/expr/ztests/split.yaml
@@ -1,4 +1,4 @@
-zql: |
+zed: |
    cut a1=split(s1,"."),a2=split(s2,"."),a3=split(s3,"."),a4=split(s4,"."),oo=split(s1,"oo")
 
 input: |
diff --git a/expr/ztests/time-duration-cast.yaml b/expr/ztests/time-duration-cast.yaml
index 2b529bb14..a27f31b72 100644
--- a/expr/ztests/time-duration-cast.yaml
+++ b/expr/ztests/time-duration-cast.yaml
@@ -1,4 +1,4 @@
-zql: cut t=time(t),d=duration(d)
+zed: cut t=time(t),d=duration(d)
 
 input: |
   {t:"1",d:"1"}
diff --git a/expr/ztests/type-map.yaml b/expr/ztests/type-map.yaml
index c64674c4b..cc3fe3cee 100644
--- a/expr/ztests/type-map.yaml
+++ b/expr/ztests/type-map.yaml
@@ -1,4 +1,4 @@
-zql: |
+zed: |
   type conn = {_path:string, id:{src:ip,dst:ip}, etc:string}
   type dns = {_path:string, id:{src:ip,dst:ip}, query:string, query_size:uint64}
   const schemas = |{
diff --git a/expr/ztests/unflatten.yaml b/expr/ztests/unflatten.yaml
index 4cc5ee030..ca86a0e6f 100644
--- a/expr/ztests/unflatten.yaml
+++ b/expr/ztests/unflatten.yaml
@@ -1,4 +1,4 @@
-zql: 'put .=unflatten()'
+zed: 'put .=unflatten()'
 
 input: |
   #0:record[a:int64,[b.a]:int64,[b.b]:int64,[b.c.a]:int64,c:int64]
diff --git a/proc/fuse/ztests/basic.yaml b/proc/fuse/ztests/basic.yaml
index d8ba6cebc..0035476ca 100644
--- a/proc/fuse/ztests/basic.yaml
+++ b/proc/fuse/ztests/basic.yaml
@@ -1,4 +1,4 @@
-zql: fuse
+zed: fuse
 
 input: |
   {a:"hello",b:"world"}
diff --git a/proc/fuse/ztests/container.yaml b/proc/fuse/ztests/container.yaml
index c015334b4..debfe80df 100644
--- a/proc/fuse/ztests/container.yaml
+++ b/proc/fuse/ztests/container.yaml
@@ -1,4 +1,4 @@
-zql: fuse
+zed: fuse
 
 input: |
   {a:"hello",r:{x:1 (int32),y:2 (int32)} (=0)} (=1)
diff --git a/proc/fuse/ztests/dup.yaml b/proc/fuse/ztests/dup.yaml
index 29ad5d13a..3da3a6d60 100644
--- a/proc/fuse/ztests/dup.yaml
+++ b/proc/fuse/ztests/dup.yaml
@@ -1,4 +1,4 @@
-zql: fuse
+zed: fuse
 
 input: |
   {a:"hello",b:"world"}
diff --git a/proc/groupby/ztests/by-only.yaml b/proc/groupby/ztests/by-only.yaml
index 03825e940..e4692c869 100644
--- a/proc/groupby/ztests/by-only.yaml
+++ b/proc/groupby/ztests/by-only.yaml
@@ -1,4 +1,4 @@
-zql: 'by s | sort s'
+zed: 'by s | sort s'
 
 input: |
   {x:1 (int32),s:"b"} (=0)
diff --git a/proc/groupby/ztests/count-by-dot.yaml b/proc/groupby/ztests/count-by-dot.yaml
index ce422249b..76da47fef 100644
--- a/proc/groupby/ztests/count-by-dot.yaml
+++ b/proc/groupby/ztests/count-by-dot.yaml
@@ -1,4 +1,4 @@
-zql: 'count() by . | sort .'
+zed: 'count() by . | sort .'
 
 input: |
   {x:1 (int32),s:"foo"} (=0)
diff --git a/proc/groupby/ztests/dot.yaml b/proc/groupby/ztests/dot.yaml
index 63f910869..b8dbb565b 100644
--- a/proc/groupby/ztests/dot.yaml
+++ b/proc/groupby/ztests/dot.yaml
@@ -1,4 +1,4 @@
-zql: 'count() by typeof(.) | sort count'
+zed: 'count() by typeof(.) | sort count'
 
 output-flags: -f zson -pretty=4
 
diff --git a/proc/groupby/ztests/mixed-output-types.yaml b/proc/groupby/ztests/mixed-output-types.yaml
index abd2aebd0..a478b9c45 100644
--- a/proc/groupby/ztests/mixed-output-types.yaml
+++ b/proc/groupby/ztests/mixed-output-types.yaml
@@ -1,4 +1,4 @@
-zql: 'by x=network_of(addr) | sort .'
+zed: 'by x=network_of(addr) | sort .'
 
 input: |
   {addr:10.0.0.1}
diff --git a/proc/groupby/ztests/mixed-type-key.yaml b/proc/groupby/ztests/mixed-type-key.yaml
index f8fad736b..42bc1acdf 100644
--- a/proc/groupby/ztests/mixed-type-key.yaml
+++ b/proc/groupby/ztests/mixed-type-key.yaml
@@ -1,4 +1,4 @@
-zql: 'count() by id.orig_h | sort id'
+zed: 'count() by id.orig_h | sort id'
 
 input: |
   {_path:"weird",id:{orig_h:10.47.1.152,orig_p:49562 (port=(uint16)),resp_h:23.217.103.245,resp_p:80 (port)} (=0)} (=1)
diff --git a/proc/groupby/ztests/nested-agg-name.yaml b/proc/groupby/ztests/nested-agg-name.yaml
index e531aaf9b..8769932f4 100644
--- a/proc/groupby/ztests/nested-agg-name.yaml
+++ b/proc/groupby/ztests/nested-agg-name.yaml
@@ -1,4 +1,4 @@
-zql: "result.count=count() by result.animal=animal | sort ."
+zed: "result.count=count() by result.animal=animal | sort ."
 
 input: |
   {animal:"cat",s:"a",x:1 (int32)} (=0)
diff --git a/proc/groupby/ztests/where-sum.yaml b/proc/groupby/ztests/where-sum.yaml
index 871d8d3b5..7d124a47b 100644
--- a/proc/groupby/ztests/where-sum.yaml
+++ b/proc/groupby/ztests/where-sum.yaml
@@ -1,4 +1,4 @@
-zql: "lg=sum(x) where x>=5, sm=sum(x) where x<8"
+zed: "lg=sum(x) where x>=5, sm=sum(x) where x<8"
 
 input: |
   {x:1 (int32)} (=0)
diff --git a/proc/groupby/ztests/where.yaml b/proc/groupby/ztests/where.yaml
index adf77369b..5817f62ca 100644
--- a/proc/groupby/ztests/where.yaml
+++ b/proc/groupby/ztests/where.yaml
@@ -1,4 +1,4 @@
-zql: "sum(x) where s='a', s2=sum(x) by key=animal | sort ."
+zed: "sum(x) where s='a', s2=sum(x) by key=animal | sort ."
 
 input: |
   {animal:"cat",s:"a",x:1 (int32)} (=0)
diff --git a/proc/put/ztests/change-type.yaml b/proc/put/ztests/change-type.yaml
index dd5232f72..ae83e7ef3 100644
--- a/proc/put/ztests/change-type.yaml
+++ b/proc/put/ztests/change-type.yaml
@@ -1,4 +1,4 @@
-zql: put x=network_of(addr)
+zed: put x=network_of(addr)
 
 input: |
   {addr:10.0.0.1}
diff --git a/proc/put/ztests/implied.yaml b/proc/put/ztests/implied.yaml
index f95b30fe4..136090603 100644
--- a/proc/put/ztests/implied.yaml
+++ b/proc/put/ztests/implied.yaml
@@ -1,4 +1,4 @@
-zql: 'put y=x+1,to_lower(s),typeof(s)'
+zed: 'put y=x+1,to_lower(s),typeof(s)'
 
 input: |
   {a:[] (0=([int32])),x:1 (int32),s:"foo",b:0x68656c6c6f0a} (=1)
diff --git a/proc/put/ztests/null.yaml b/proc/put/ztests/null.yaml
index 6287f7827..f13a9874a 100644
--- a/proc/put/ztests/null.yaml
+++ b/proc/put/ztests/null.yaml
@@ -1,4 +1,4 @@
-zql: put b=null
+zed: put b=null
 
 input: |
   {a:1 (int32)} (=0)
diff --git a/proc/put/ztests/put-to-root-error-non-record.yaml b/proc/put/ztests/put-to-root-error-non-record.yaml
index d19c7a8bc..3d0acc064 100644
--- a/proc/put/ztests/put-to-root-error-non-record.yaml
+++ b/proc/put/ztests/put-to-root-error-non-record.yaml
@@ -1,4 +1,4 @@
-zql: 'put .=a'
+zed: 'put .=a'
 
 input: |
   {a:1 (int32)} (=0)
diff --git a/proc/put/ztests/root.yaml b/proc/put/ztests/root.yaml
index 62d01241f..54c042a4b 100644
--- a/proc/put/ztests/root.yaml
+++ b/proc/put/ztests/root.yaml
@@ -1,4 +1,4 @@
-zql: put .=a
+zed: put .=a
 
 input: |
   {"a": {"a": "a", "b": "b"}, "b": "b"}
diff --git a/proc/rename/ztests/count-by.yaml b/proc/rename/ztests/count-by.yaml
index 294c4d065..d987ef102 100644
--- a/proc/rename/ztests/count-by.yaml
+++ b/proc/rename/ztests/count-by.yaml
@@ -1,4 +1,4 @@
-zql: 'rename s2=s | count() by s2 | sort s2'
+zed: 'rename s2=s | count() by s2 | sort s2'
 
 # This test previously failed only for binary zng.
 # {s:"a"}
diff --git a/proc/shape/ztests/shape-bstring.yaml b/proc/shape/ztests/shape-bstring.yaml
index 1f19f6a7c..e8debafb6 100644
--- a/proc/shape/ztests/shape-bstring.yaml
+++ b/proc/shape/ztests/shape-bstring.yaml
@@ -1,4 +1,4 @@
-zql: |
+zed: |
   type custom = {bstring: bstring}
   put . = shape(custom)
 
diff --git a/proc/shape/ztests/shape-coerce.yaml b/proc/shape/ztests/shape-coerce.yaml
index a60a644b9..477e5e230 100644
--- a/proc/shape/ztests/shape-coerce.yaml
+++ b/proc/shape/ztests/shape-coerce.yaml
@@ -1,4 +1,4 @@
-zql: shape
+zed: shape
 
 input: |
   {a:10.,b:null (null),c:null (float64)} (=0)
diff --git a/proc/shape/ztests/shape-simple.yaml b/proc/shape/ztests/shape-simple.yaml
index 5b8c1a7b0..cf806b6bb 100644
--- a/proc/shape/ztests/shape-simple.yaml
+++ b/proc/shape/ztests/shape-simple.yaml
@@ -1,4 +1,4 @@
-zql: shape
+zed: shape
 
 input: |
   {a:10,b:null}
diff --git a/proc/sort/sort_test.go b/proc/sort/sort_test.go
index 9e470dc96..1136722af 100644
--- a/proc/sort/sort_test.go
+++ b/proc/sort/sort_test.go
@@ -198,7 +198,7 @@ func TestSortExternal(t *testing.T) {
 	sort.Strings(ss)
 	output := makeTzng(ss)
 	(&ztest.ZTest{
-		ZQL:         "sort s",
+		Zed:         "sort s",
 		Input:       input,
 		Output:      output,
 		OutputFlags: "-f tzng",
diff --git a/proc/sort/ztests/expr.yaml b/proc/sort/ztests/expr.yaml
index b635960a6..3b474172d 100644
--- a/proc/sort/ztests/expr.yaml
+++ b/proc/sort/ztests/expr.yaml
@@ -1,4 +1,4 @@
-zql: 'sort to_lower(s)'
+zed: 'sort to_lower(s)'
 
 input: |
   {s:"foo"}
diff --git a/proc/switcher/ztests/switch-default.yaml b/proc/switcher/ztests/switch-default.yaml
index bda763af9..2949890b0 100644
--- a/proc/switcher/ztests/switch-default.yaml
+++ b/proc/switcher/ztests/switch-default.yaml
@@ -1,4 +1,4 @@
-zql: |
+zed: |
   switch (
      case a=2 => put v='two'
      case a=1 => put v='one'
diff --git a/proc/switcher/ztests/switch.yaml b/proc/switcher/ztests/switch.yaml
index 37b24e1d5..18d1fda03 100644
--- a/proc/switcher/ztests/switch.yaml
+++ b/proc/switcher/ztests/switch.yaml
@@ -1,4 +1,4 @@
-zql: |
+zed: |
   switch (
      case a=2 => put v='two'
      case a=1 => put v='one'
diff --git a/zio/csvio/ztests/bool.yaml b/zio/csvio/ztests/bool.yaml
index 3d7724c87..e1dd2f99b 100644
--- a/zio/csvio/ztests/bool.yaml
+++ b/zio/csvio/ztests/bool.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   {bool:null (bool)}
diff --git a/zio/csvio/ztests/bstring.yaml b/zio/csvio/ztests/bstring.yaml
index 4789197d4..7edf7e65a 100644
--- a/zio/csvio/ztests/bstring.yaml
+++ b/zio/csvio/ztests/bstring.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   {bstring:null (bstring)} (=0)
diff --git a/zio/csvio/ztests/bytes.yaml b/zio/csvio/ztests/bytes.yaml
index 61a476c61..04793dc5d 100644
--- a/zio/csvio/ztests/bytes.yaml
+++ b/zio/csvio/ztests/bytes.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   {bytes:null (bytes)}
diff --git a/zio/csvio/ztests/csvfuse-default.yaml b/zio/csvio/ztests/csvfuse-default.yaml
index 531a9d37d..b2390a9b4 100644
--- a/zio/csvio/ztests/csvfuse-default.yaml
+++ b/zio/csvio/ztests/csvfuse-default.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   {a:"hello"}
diff --git a/zio/csvio/ztests/csvfuse-false.yaml b/zio/csvio/ztests/csvfuse-false.yaml
index db091c018..f98bb2c88 100644
--- a/zio/csvio/ztests/csvfuse-false.yaml
+++ b/zio/csvio/ztests/csvfuse-false.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   {a:"hello"}
diff --git a/zio/csvio/ztests/csvfuse-true.yaml b/zio/csvio/ztests/csvfuse-true.yaml
index 0fc2a9e0b..5d24a6e4e 100644
--- a/zio/csvio/ztests/csvfuse-true.yaml
+++ b/zio/csvio/ztests/csvfuse-true.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   {a:"hello"}
diff --git a/zio/csvio/ztests/duration.yaml b/zio/csvio/ztests/duration.yaml
index 6932bca6e..f04f6cb14 100644
--- a/zio/csvio/ztests/duration.yaml
+++ b/zio/csvio/ztests/duration.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   {duration:null (duration)}
diff --git a/zio/csvio/ztests/error.yaml b/zio/csvio/ztests/error.yaml
index 4ebfb3d83..ce40304b9 100644
--- a/zio/csvio/ztests/error.yaml
+++ b/zio/csvio/ztests/error.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   {error:null (error)} (=0)
diff --git a/zio/csvio/ztests/float.yaml b/zio/csvio/ztests/float.yaml
index 035416705..e916dc64d 100644
--- a/zio/csvio/ztests/float.yaml
+++ b/zio/csvio/ztests/float.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 # 1.797693134862315708145274237317043567981e+308 is Go's math.MaxFloat64.
 # 4.940656458412465441765687928682213723651e-324 is Go's math.SmallestNonzeroFloat64.
diff --git a/zio/csvio/ztests/int.yaml b/zio/csvio/ztests/int.yaml
index 0c70af70d..1c1cdc834 100644
--- a/zio/csvio/ztests/int.yaml
+++ b/zio/csvio/ztests/int.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   {int8:null (int8),int16:null (int16),int32:null (int32),int64:null (int64)} (=0)
diff --git a/zio/csvio/ztests/ip.yaml b/zio/csvio/ztests/ip.yaml
index c060aacde..bed61e656 100644
--- a/zio/csvio/ztests/ip.yaml
+++ b/zio/csvio/ztests/ip.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   {ip:null (ip)}
diff --git a/zio/csvio/ztests/net.yaml b/zio/csvio/ztests/net.yaml
index 429320cfa..f957ea2a2 100644
--- a/zio/csvio/ztests/net.yaml
+++ b/zio/csvio/ztests/net.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   {net:null (net)}
diff --git a/zio/csvio/ztests/null-nested.yaml b/zio/csvio/ztests/null-nested.yaml
index a3d91fc22..6f12971da 100644
--- a/zio/csvio/ztests/null-nested.yaml
+++ b/zio/csvio/ztests/null-nested.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   {a:null (0=({b:1=({a1:2=([string]),a2:2})}))}
diff --git a/zio/csvio/ztests/null.yaml b/zio/csvio/ztests/null.yaml
index 7cfbd3dc8..54e94d469 100644
--- a/zio/csvio/ztests/null.yaml
+++ b/zio/csvio/ztests/null.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   {null:null (null)} (=0)
diff --git a/zio/csvio/ztests/record-flat.yaml b/zio/csvio/ztests/record-flat.yaml
index 2d85accbe..1cea0022e 100644
--- a/zio/csvio/ztests/record-flat.yaml
+++ b/zio/csvio/ztests/record-flat.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   {a:"hello",b:"world"}
diff --git a/zio/csvio/ztests/record-nested.yaml b/zio/csvio/ztests/record-nested.yaml
index cfc232078..7ee309478 100644
--- a/zio/csvio/ztests/record-nested.yaml
+++ b/zio/csvio/ztests/record-nested.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   {a:"hello",b:{c:"world",d:"goodbye"}}
diff --git a/zio/csvio/ztests/string.yaml b/zio/csvio/ztests/string.yaml
index e71b9001a..d70e08418 100644
--- a/zio/csvio/ztests/string.yaml
+++ b/zio/csvio/ztests/string.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   {string:null (string)}
diff --git a/zio/csvio/ztests/time-epoch.yaml b/zio/csvio/ztests/time-epoch.yaml
index 4a0cd3dd7..15acb1d24 100644
--- a/zio/csvio/ztests/time-epoch.yaml
+++ b/zio/csvio/ztests/time-epoch.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   {time:null (time)}
diff --git a/zio/csvio/ztests/time.yaml b/zio/csvio/ztests/time.yaml
index 90db33a19..14440aa92 100644
--- a/zio/csvio/ztests/time.yaml
+++ b/zio/csvio/ztests/time.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   {time:null (time)}
diff --git a/zio/csvio/ztests/type.yaml b/zio/csvio/ztests/type.yaml
index 850c52c33..4fd88e320 100644
--- a/zio/csvio/ztests/type.yaml
+++ b/zio/csvio/ztests/type.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   {type:null (type)}
diff --git a/zio/csvio/ztests/uint.yaml b/zio/csvio/ztests/uint.yaml
index 905cf671a..09968a888 100644
--- a/zio/csvio/ztests/uint.yaml
+++ b/zio/csvio/ztests/uint.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   {uint8:null (uint8),uint16:null (uint16),uint32:null (uint32),uint64:null (uint64)} (=0)
diff --git a/zio/detector/ztests/bzng-gz.yaml b/zio/detector/ztests/bzng-gz.yaml
index abc39dbc0..3fd90a5cf 100644
--- a/zio/detector/ztests/bzng-gz.yaml
+++ b/zio/detector/ztests/bzng-gz.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: !!binary |
   H4sIAOyMfl8AA11OTU7CQBSmCK2WQBxcgO7ckLjBlATiFrGhGtxYItHETIbpYIeUzmTetP
diff --git a/zio/detector/ztests/ndjson-gz.yaml b/zio/detector/ztests/ndjson-gz.yaml
index f92f3dabf..33ef84c17 100644
--- a/zio/detector/ztests/ndjson-gz.yaml
+++ b/zio/detector/ztests/ndjson-gz.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: !!binary |
   H4sICDmVe18AA291dC5uZGpzb24AbZFbSwMxEIXf/RnzXOJmL73sW61LV9EXtyAiEtJs6q
diff --git a/zio/detector/ztests/ndjson-nonewline.yaml b/zio/detector/ztests/ndjson-nonewline.yaml
index 9f1b6a43d..7fe7cd72c 100644
--- a/zio/detector/ztests/ndjson-nonewline.yaml
+++ b/zio/detector/ztests/ndjson-nonewline.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: '{"_path":"ssl","cert_chain_fuids":[],"cipher":"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256","client_cert_chain_fuids":[],"client_issuer":null,"client_subject":null,"curve":null,"established":true,"id":{"orig_h":"10.10.7.90","orig_p":51913,"resp_h":"54.230.87.24","resp_p":443},"issuer":null,"last_alert":null,"next_protocol":"http/1.1","resumed":true,"server_name":"choices.truste.com","subject":null,"ts":{"sec":1490385563,"ns":53424000},"uid":"CfEBop2hbfJYpjG5Hd","validation_status":null,"version":"TLSv12"}'
 
diff --git a/zio/detector/ztests/ndjson.yaml b/zio/detector/ztests/ndjson.yaml
index 7d750fcf6..e9007e3f0 100644
--- a/zio/detector/ztests/ndjson.yaml
+++ b/zio/detector/ztests/ndjson.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   {"_path":"ssl","cert_chain_fuids":[],"cipher":"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256","client_cert_chain_fuids":[],"client_issuer":null,"client_subject":null,"curve":null,"established":true,"id":{"orig_h":"10.10.7.90","orig_p":51913,"resp_h":"54.230.87.24","resp_p":443},"issuer":null,"last_alert":null,"next_protocol":"http/1.1","resumed":true,"server_name":"choices.truste.com","subject":null,"ts":{"sec":1490385563,"ns":53424000},"uid":"CfEBop2hbfJYpjG5Hd","validation_status":null,"version":"TLSv12"}
diff --git a/zio/detector/ztests/tzng-nonewline.yaml b/zio/detector/ztests/tzng-nonewline.yaml
index d48c5aa5d..115d812c9 100644
--- a/zio/detector/ztests/tzng-nonewline.yaml
+++ b/zio/detector/ztests/tzng-nonewline.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |-
   #port=uint16
diff --git a/zio/detector/ztests/tzng.yaml b/zio/detector/ztests/tzng.yaml
index 229a1324e..f4bcc447b 100644
--- a/zio/detector/ztests/tzng.yaml
+++ b/zio/detector/ztests/tzng.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   #port=uint16
diff --git a/zio/detector/ztests/zeek-gz.yaml b/zio/detector/ztests/zeek-gz.yaml
index d5e702cc9..bbb6d9646 100644
--- a/zio/detector/ztests/zeek-gz.yaml
+++ b/zio/detector/ztests/zeek-gz.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: !!binary |
   H4sICCPt+V0AA3plZWsuaW4ubG9nAH2PXUsrMRCGr2d/xYG9UTjG/dT2stZiFb2xBRGVkG
diff --git a/zio/detector/ztests/zeek-nonewline.yaml b/zio/detector/ztests/zeek-nonewline.yaml
index bc9fb30fd..4e33bdef2 100644
--- a/zio/detector/ztests/zeek-nonewline.yaml
+++ b/zio/detector/ztests/zeek-nonewline.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |-
   #separator \x09
diff --git a/zio/detector/ztests/zeek.yaml b/zio/detector/ztests/zeek.yaml
index 4ddd56eeb..1be5e58d7 100644
--- a/zio/detector/ztests/zeek.yaml
+++ b/zio/detector/ztests/zeek.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   #separator \x09
diff --git a/zio/detector/ztests/zjson-gz.yaml b/zio/detector/ztests/zjson-gz.yaml
index aa20c0db7..e8086f95b 100644
--- a/zio/detector/ztests/zjson-gz.yaml
+++ b/zio/detector/ztests/zjson-gz.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: !!binary |
   H4sIAJQPfV8AA52T3W4bIRCF7/sYc72iy/44tu9c14pbNTdxpKqKIoQxzhKtF8SAlcjKuw
diff --git a/zio/detector/ztests/zjson-nonewline.yaml b/zio/detector/ztests/zjson-nonewline.yaml
index ed645345b..63c685f0d 100644
--- a/zio/detector/ztests/zjson-nonewline.yaml
+++ b/zio/detector/ztests/zjson-nonewline.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   {"id":26,"schema":{"of":[{"name":"_path","type":"string"},{"name":"ts","type":"time"},{"name":"uid","type":"string"},{"name":"id","of":[{"name":"orig_h","type":"ip"},{"name":"orig_p","type":"port"},{"name":"resp_h","type":"ip"},{"name":"resp_p","type":"port"}],"type":"record"},{"name":"version","type":"string"},{"name":"cipher","type":"string"},{"name":"curve","type":"string"},{"name":"server_name","type":"string"},{"name":"resumed","type":"bool"},{"name":"last_alert","type":"string"},{"name":"next_protocol","type":"string"},{"name":"established","type":"bool"},{"name":"cert_chain_fuids","of":"string","type":"array"},{"name":"client_cert_chain_fuids","of":"string","type":"array"},{"name":"subject","type":"string"},{"name":"issuer","type":"string"},{"name":"client_subject","type":"string"},{"name":"client_issuer","type":"string"},{"name":"validation_status","type":"string"}],"type":"record"},"aliases":[{"name":"port","type":"uint16"}],"values":["ssl","1490385563.053424","CfEBop2hbfJYpjG5Hd",["10.10.7.90","51913","54.230.87.24","443"],"TLSv12","TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256",null,"choices.truste.com","T",null,"http/1.1","T",null,null,null,null,null,null,null]}
diff --git a/zio/detector/ztests/zjson.yaml b/zio/detector/ztests/zjson.yaml
index ed645345b..63c685f0d 100644
--- a/zio/detector/ztests/zjson.yaml
+++ b/zio/detector/ztests/zjson.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   {"id":26,"schema":{"of":[{"name":"_path","type":"string"},{"name":"ts","type":"time"},{"name":"uid","type":"string"},{"name":"id","of":[{"name":"orig_h","type":"ip"},{"name":"orig_p","type":"port"},{"name":"resp_h","type":"ip"},{"name":"resp_p","type":"port"}],"type":"record"},{"name":"version","type":"string"},{"name":"cipher","type":"string"},{"name":"curve","type":"string"},{"name":"server_name","type":"string"},{"name":"resumed","type":"bool"},{"name":"last_alert","type":"string"},{"name":"next_protocol","type":"string"},{"name":"established","type":"bool"},{"name":"cert_chain_fuids","of":"string","type":"array"},{"name":"client_cert_chain_fuids","of":"string","type":"array"},{"name":"subject","type":"string"},{"name":"issuer","type":"string"},{"name":"client_subject","type":"string"},{"name":"client_issuer","type":"string"},{"name":"validation_status","type":"string"}],"type":"record"},"aliases":[{"name":"port","type":"uint16"}],"values":["ssl","1490385563.053424","CfEBop2hbfJYpjG5Hd",["10.10.7.90","51913","54.230.87.24","443"],"TLSv12","TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256",null,"choices.truste.com","T",null,"http/1.1","T",null,null,null,null,null,null,null]}
diff --git a/zio/detector/ztests/zng-gz.yaml b/zio/detector/ztests/zng-gz.yaml
index efbfe2d35..a3736eef4 100644
--- a/zio/detector/ztests/zng-gz.yaml
+++ b/zio/detector/ztests/zng-gz.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: !!binary |
   H4sIABGNfl8AA11OTU7CQBSmCK2WQEZcgO7ckLjB0ATiFrGhGtxYItHETIbpYIeUzmTetP
diff --git a/zio/detector/ztests/zson.yaml b/zio/detector/ztests/zson.yaml
index 2ddc050a2..8cad332d3 100644
--- a/zio/detector/ztests/zson.yaml
+++ b/zio/detector/ztests/zson.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   {_path:"conn"} (=0)
diff --git a/zio/zeekio/ztests/close-date.yaml b/zio/zeekio/ztests/close-date.yaml
index 4faa72260..71edb4192 100644
--- a/zio/zeekio/ztests/close-date.yaml
+++ b/zio/zeekio/ztests/close-date.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   #separator \x09
diff --git a/zio/zeekio/ztests/close-nodate.yaml b/zio/zeekio/ztests/close-nodate.yaml
index fba7fd927..e67af104e 100644
--- a/zio/zeekio/ztests/close-nodate.yaml
+++ b/zio/zeekio/ztests/close-nodate.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   #separator \x09
diff --git a/zio/zeekio/ztests/duration.yaml b/zio/zeekio/ztests/duration.yaml
index c1359851a..c291abe7d 100644
--- a/zio/zeekio/ztests/duration.yaml
+++ b/zio/zeekio/ztests/duration.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   {_path:"conn",ts:2001-09-09T01:46:40Z,d:277777h46m40s}
diff --git a/zio/zeekio/ztests/empty-close.yaml b/zio/zeekio/ztests/empty-close.yaml
index cb3b050d0..30db67a07 100644
--- a/zio/zeekio/ztests/empty-close.yaml
+++ b/zio/zeekio/ztests/empty-close.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   #separator \x09
diff --git a/zio/zeekio/ztests/empty.yaml b/zio/zeekio/ztests/empty.yaml
index 58f0fb620..66249d917 100644
--- a/zio/zeekio/ztests/empty.yaml
+++ b/zio/zeekio/ztests/empty.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |-
   #separator \x09
diff --git a/zio/zeekio/ztests/flatten.yaml b/zio/zeekio/ztests/flatten.yaml
index e8eb70289..2e80a8cee 100644
--- a/zio/zeekio/ztests/flatten.yaml
+++ b/zio/zeekio/ztests/flatten.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   #separator \x09
diff --git a/zio/zeekio/ztests/multizeek.yaml b/zio/zeekio/ztests/multizeek.yaml
index d72dcd0e7..2fa77ddd4 100644
--- a/zio/zeekio/ztests/multizeek.yaml
+++ b/zio/zeekio/ztests/multizeek.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   #separator \x09
diff --git a/zio/zeekio/ztests/multizng.yaml b/zio/zeekio/ztests/multizng.yaml
index 07c1fa045..6adf32c0c 100644
--- a/zio/zeekio/ztests/multizng.yaml
+++ b/zio/zeekio/ztests/multizng.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   {_path:"a",ts:1970-01-01T00:00:10Z,d:1.}
diff --git a/zio/zeekio/ztests/nested-2.yaml b/zio/zeekio/ztests/nested-2.yaml
index 3f372f393..eb5fe0629 100644
--- a/zio/zeekio/ztests/nested-2.yaml
+++ b/zio/zeekio/ztests/nested-2.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   {_path:"smb_cmd",ts:2009-11-19T01:41:47.85978Z,uid:"Chjxid42dvvzIzdeG8" (bstring),id:{orig_h:192.168.1.102,orig_p:1076 (port=(uint16)),resp_h:192.168.1.1,resp_p:139 (port)} (=0),referenced_file:{ts:2009-11-19T01:41:47.85978Z,uid:"Chjxid42dvvzIzdeG8" (bstring),id:{orig_h:192.168.1.102,orig_p:1076,resp_h:192.168.1.1,resp_p:139} (0),fuid:"ZYjxid42dvvzIzdeG8" (bstring)} (=1)} (=2)
diff --git a/zio/zeekio/ztests/nested-record-name-is-prefix-of-another-field.yaml b/zio/zeekio/ztests/nested-record-name-is-prefix-of-another-field.yaml
index c4276b0e9..b600b63de 100644
--- a/zio/zeekio/ztests/nested-record-name-is-prefix-of-another-field.yaml
+++ b/zio/zeekio/ztests/nested-record-name-is-prefix-of-another-field.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   #separator \x09
diff --git a/zio/zeekio/ztests/nested-record-with-nonadjacent-fields.yaml b/zio/zeekio/ztests/nested-record-with-nonadjacent-fields.yaml
index effd6b2e1..02bc27154 100644
--- a/zio/zeekio/ztests/nested-record-with-nonadjacent-fields.yaml
+++ b/zio/zeekio/ztests/nested-record-with-nonadjacent-fields.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   #separator \x09
diff --git a/zio/zeekio/ztests/nested.yaml b/zio/zeekio/ztests/nested.yaml
index ef85d4af2..7054c48cc 100644
--- a/zio/zeekio/ztests/nested.yaml
+++ b/zio/zeekio/ztests/nested.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   #separator \x09
diff --git a/zio/zeekio/ztests/no-path.yaml b/zio/zeekio/ztests/no-path.yaml
index 54f55b959..d195eb3ce 100644
--- a/zio/zeekio/ztests/no-path.yaml
+++ b/zio/zeekio/ztests/no-path.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   #fields foo
diff --git a/zio/zeekio/ztests/path.yaml b/zio/zeekio/ztests/path.yaml
index 77e91d460..6d4a9178f 100644
--- a/zio/zeekio/ztests/path.yaml
+++ b/zio/zeekio/ztests/path.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   #separator \x09
diff --git a/zio/zeekio/ztests/path2.yaml b/zio/zeekio/ztests/path2.yaml
index 9ec7f7d78..0858e8650 100644
--- a/zio/zeekio/ztests/path2.yaml
+++ b/zio/zeekio/ztests/path2.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   #separator \x09
diff --git a/zio/zeekio/ztests/shared-context-bug-2.yaml b/zio/zeekio/ztests/shared-context-bug-2.yaml
index 57a137b8d..8f756a83f 100644
--- a/zio/zeekio/ztests/shared-context-bug-2.yaml
+++ b/zio/zeekio/ztests/shared-context-bug-2.yaml
@@ -1,4 +1,4 @@
-zql: cut id | put id2=id | cut id.orig_h
+zed: cut id | put id2=id | cut id.orig_h
 
 input: |
   #separator \x09
diff --git a/zio/zeekio/ztests/shared-context-bug.yaml b/zio/zeekio/ztests/shared-context-bug.yaml
index 5935809ef..952f00a89 100644
--- a/zio/zeekio/ztests/shared-context-bug.yaml
+++ b/zio/zeekio/ztests/shared-context-bug.yaml
@@ -1,4 +1,4 @@
-zql: cut id | put id2=id.orig_h | drop id.orig_h
+zed: cut id | put id2=id.orig_h | drop id.orig_h
 
 input: |
   #separator \x09
diff --git a/zio/zeekio/ztests/time.yaml b/zio/zeekio/ztests/time.yaml
index 7c41946f6..511a273b4 100644
--- a/zio/zeekio/ztests/time.yaml
+++ b/zio/zeekio/ztests/time.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   {_path:"conn",ts:2015-03-05T14:25:14.419939Z,ts2:1970-01-01T00:00:01Z}
diff --git a/zio/zeekio/ztests/trailing-whitespace.yaml b/zio/zeekio/ztests/trailing-whitespace.yaml
index 72311e1d1..065d57017 100644
--- a/zio/zeekio/ztests/trailing-whitespace.yaml
+++ b/zio/zeekio/ztests/trailing-whitespace.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 # The last input line should end with a tab character.
 input: |
diff --git a/zio/zeekio/ztests/types.yaml b/zio/zeekio/ztests/types.yaml
index 383f1131d..f1daf9bc8 100644
--- a/zio/zeekio/ztests/types.yaml
+++ b/zio/zeekio/ztests/types.yaml
@@ -2,7 +2,7 @@
 # the ZNG type system are handled correctly (i.e., that the Zeek types
 # are preserved on a pass through zq).
 
-zql: '*'
+zed: '*'
 
 input: &input |
   #separator \x09
diff --git a/zio/zeekio/ztests/zng-types.yaml b/zio/zeekio/ztests/zng-types.yaml
index 4ff26e719..c608ca192 100644
--- a/zio/zeekio/ztests/zng-types.yaml
+++ b/zio/zeekio/ztests/zng-types.yaml
@@ -1,6 +1,6 @@
 # Test that ZNG types are mapped into proper equivalent Zeek types.
 
-zql: '*'
+zed: '*'
 
 input: |
   {b:0 (uint8),i16:0 (int16),u16:0 (uint16),i32:0 (int32),u32:0 (uint32),i64:0,u64:0 (uint64),a:10.1.2.3,n:10.0.0.0/8,d:16m40s} (=0)
diff --git a/zio/zsonio/ztests/enum.yaml b/zio/zsonio/ztests/enum.yaml
index 838b96230..5eaae94ae 100644
--- a/zio/zsonio/ztests/enum.yaml
+++ b/zio/zsonio/ztests/enum.yaml
@@ -1,4 +1,4 @@
-zql: "*"
+zed: "*"
 
 output-flags: -f zson -pretty=4
 
diff --git a/zio/zsonio/ztests/first-test.yaml b/zio/zsonio/ztests/first-test.yaml
index 1539a23e4..eb4aa4363 100644
--- a/zio/zsonio/ztests/first-test.yaml
+++ b/zio/zsonio/ztests/first-test.yaml
@@ -1,4 +1,4 @@
-zql: "*"
+zed: "*"
 
 output-flags: -f zson -pretty=4
 
diff --git a/zio/zsonio/ztests/tv.yaml b/zio/zsonio/ztests/tv.yaml
index d04898fd8..a1aea1a0a 100644
--- a/zio/zsonio/ztests/tv.yaml
+++ b/zio/zsonio/ztests/tv.yaml
@@ -1,4 +1,4 @@
-zql: "put t=typeof(s) | put tt=typeof(t)"
+zed: "put t=typeof(s) | put tt=typeof(t)"
 
 output-flags: -f zson -pretty=4
 
diff --git a/zng/ztests/bytes.yaml b/zng/ztests/bytes.yaml
index d78fec736..c03906f4c 100644
--- a/zng/ztests/bytes.yaml
+++ b/zng/ztests/bytes.yaml
@@ -1,4 +1,4 @@
-zql: put c=string(b) | put d=to_base64(c),f=bytes(to_base64(c)) | put e=string(from_base64(d))
+zed: put c=string(b) | put d=to_base64(c),f=bytes(to_base64(c)) | put e=string(from_base64(d))
 
 input: |
   #0:record[b:bytes]
diff --git a/zng/ztests/enum.yaml b/zng/ztests/enum.yaml
index 1fd7c0aa9..34b40c8f8 100644
--- a/zng/ztests/enum.yaml
+++ b/zng/ztests/enum.yaml
@@ -1,4 +1,4 @@
-zql: "put s=string(e), v=e+1"
+zed: "put s=string(e), v=e+1"
 
 input: |
   #0:record[e:enum[int32,foo:[1],bar:[2],baz:[4]]]
diff --git a/zng/ztests/field.yaml b/zng/ztests/field.yaml
index b7d2715bb..2b70c43df 100644
--- a/zng/ztests/field.yaml
+++ b/zng/ztests/field.yaml
@@ -1,4 +1,4 @@
-zql: "*"
+zed: "*"
 
 input: |
   #0:record[[foo]:bytes,[.bar@]:int32,x:string]
diff --git a/zng/ztests/map-complex.yaml b/zng/ztests/map-complex.yaml
index d2795f9d1..6390ae8a1 100644
--- a/zng/ztests/map-complex.yaml
+++ b/zng/ztests/map-complex.yaml
@@ -1,4 +1,4 @@
-zql: 'put x=m["b"].a'
+zed: 'put x=m["b"].a'
 
 input: |
   #0:record[m:map[string,record[a:int32,b:int32]]]
diff --git a/zng/ztests/map.yaml b/zng/ztests/map.yaml
index 7aeddd3b8..392a0a243 100644
--- a/zng/ztests/map.yaml
+++ b/zng/ztests/map.yaml
@@ -1,4 +1,4 @@
-zql: 'put x=m["b"]'
+zed: 'put x=m["b"]'
 
 input: |
   #0:record[m:map[string,int32]]
diff --git a/zng/ztests/rec-index.yaml b/zng/ztests/rec-index.yaml
index 6596c751a..ddd1aadde 100644
--- a/zng/ztests/rec-index.yaml
+++ b/zng/ztests/rec-index.yaml
@@ -1,4 +1,4 @@
-zql: 'put x=r[".bar@"]+3'
+zed: 'put x=r[".bar@"]+3'
 
 input: |
   #0:record[r:record[[.bar@]:int32,x:string]]
diff --git a/zson/ztests/container-types.yaml b/zson/ztests/container-types.yaml
index 845bcf76c..bdea3afd0 100644
--- a/zson/ztests/container-types.yaml
+++ b/zson/ztests/container-types.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   { n: null (|{string,int32}|) }
diff --git a/zson/ztests/dynamic-typedef.yaml b/zson/ztests/dynamic-typedef.yaml
index 9a57b5e8f..b6aa94d6c 100644
--- a/zson/ztests/dynamic-typedef.yaml
+++ b/zson/ztests/dynamic-typedef.yaml
@@ -1,4 +1,4 @@
-zql: "*"
+zed: "*"
 
 input: &input |
   {x:1} (=foo)
diff --git a/zson/ztests/negative-duration.yaml b/zson/ztests/negative-duration.yaml
index 1e8bdb38c..25e844799 100644
--- a/zson/ztests/negative-duration.yaml
+++ b/zson/ztests/negative-duration.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: &input |
   {duration:-292y171d23h47m16.854775807s}
diff --git a/zson/ztests/typedef-binding.yaml b/zson/ztests/typedef-binding.yaml
index a7928fbfa..82277d9e1 100644
--- a/zson/ztests/typedef-binding.yaml
+++ b/zson/ztests/typedef-binding.yaml
@@ -1,4 +1,4 @@
-zql: |
+zed: |
   type port=uint16
   type rec={p:port}
   is(r,type(rec))
diff --git a/ztest/ztest.go b/ztest/ztest.go
index 7ead335c7..731ffea2d 100644
--- a/ztest/ztest.go
+++ b/ztest/ztest.go
@@ -2,17 +2,17 @@
 // with the compiled-ini zq code base, (2) run as a sub-process using the zq
 // executable build artifact, or (3) run as a bash script running a sequence
 // of arbitrary shell commands invoking any of the build artifacts.  The
-// first two cases comprise the "ZQL test style" and the last case
+// first two cases comprise the "Zed test style" and the last case
 // comprises the "script test style".  Case (1) is easier to debug by
 // simply running "go test" compared replicating the test using "go run".
 // Script-style tests don't have this convenience.
 //
-// In the ZQL style, ztest runs a ZQL query on an input and checks
+// In the Zed style, ztest runs a Zed program on an input and checks
 // for an expected output.
 //
-// A ZQL-style test is defined in a YAML file.
+// A Zed-style test is defined in a YAML file.
 //
-//    zql: count()
+//    zed: count()
 //
 //    input: |
 //      #0:record[i:int64]
@@ -27,7 +27,7 @@
 // "zq -i auto" (including optional gzip compression).  Output format defaults
 // to tzng but can be set to anything accepted by "zq -f".
 //
-//    zql: count()
+//    zed: count()
 //
 //    input: |
 //      #0:record[i:int64]
@@ -45,7 +45,7 @@
 // any of zq/cmd tools in addition to zq.  Here, the yaml sets up a collection
 // of input files and stdin, the script runs, and the test driver compares expected
 // output files, stdout, and stderr with data in the yaml spec.  In this case,
-// instead of specifying, "zql", "input", "output", you specify the yaml arrays
+// instead of specifying, "zed", "input", "output", you specify the yaml arrays
 // "inputs" and "outputs" --- where each array element defines a file, stdin,
 // stdout, or stderr --- and a "script" that specifies a multi-line yaml string
 // defining the script, e.g.,
@@ -285,7 +285,7 @@ func (f *File) load(dir string) ([]byte, *regexp.Regexp, error) {
 
 // ZTest defines a ztest.
 type ZTest struct {
-	ZQL         string `yaml:"zql,omitempty"`
+	Zed         string `yaml:"zed,omitempty"`
 	Skip        bool   `yaml:"skip,omitempty"`
 	Input       string `yaml:"input,omitempty"`
 	Output      string `yaml:"output,omitempty"`
@@ -317,8 +317,8 @@ func (z *ZTest) check() error {
 				return err
 			}
 		}
-	} else if z.ZQL == "" {
-		return errors.New("either a zql field or script field must be present")
+	} else if z.Zed == "" {
+		return errors.New("either a zed field or script field must be present")
 	}
 	if z.ErrorRE != "" {
 		var err error
@@ -411,7 +411,7 @@ func (z *ZTest) RunInternal(path string) error {
 		return fmt.Errorf("bad yaml format: %w", err)
 	}
 	outputFlags := append([]string{"-f", "zson", "-pretty=0"}, strings.Fields(z.OutputFlags)...)
-	out, errout, err := runzq(path, z.ZQL, outputFlags, z.Input)
+	out, errout, err := runzq(path, z.Zed, outputFlags, z.Input)
 	if err != nil {
 		if z.errRegex != nil {
 			if !z.errRegex.MatchString(errout) {
@@ -581,13 +581,13 @@ func runsh(testname, path, dirname string, zt *ZTest) error {
 	return checkData(expectedData, dir, stdout, stderr)
 }
 
-// runzq runs the query in ZQL over inputs and returns the output.  inputs may
-// be in any format recognized by "zq -i auto" and may be gzip-compressed.
+// runzq runs the Zed program in zed over inputs and returns the output.  inputs
+// may be in any format recognized by "zq -i auto" and may be gzip-compressed.
 // outputFlags may contain any flags accepted by cli/outputflags.Flags.  If path
-// is empty, the query runs in the current process.  If path is not empty, it
+// is empty, the program runs in the current process.  If path is not empty, it
 // specifies a command search path used to find a zq executable to run the
-// query.
-func runzq(path, ZQL string, outputFlags []string, inputs ...string) (string, string, error) {
+// program.
+func runzq(path, zed string, outputFlags []string, inputs ...string) (string, string, error) {
 	var errbuf, outbuf bytes.Buffer
 	if path != "" {
 		zq, err := lookupzq(path)
@@ -599,7 +599,7 @@ func runzq(path, ZQL string, outputFlags []string, inputs ...string) (string, st
 			return "", "", err
 		}
 		defer os.RemoveAll(tmpdir)
-		cmd := exec.Command(zq, append(append(outputFlags, ZQL), files...)...)
+		cmd := exec.Command(zq, append(append(outputFlags, zed), files...)...)
 		cmd.Stdout = &outbuf
 		cmd.Stderr = &errbuf
 		err = cmd.Run()
@@ -608,7 +608,7 @@ func runzq(path, ZQL string, outputFlags []string, inputs ...string) (string, st
 		// tests.
 		return outbuf.String(), errbuf.String(), err
 	}
-	proc, err := compiler.ParseProc(ZQL)
+	proc, err := compiler.ParseProc(zed)
 	if err != nil {
 		return "", "", err
 	}
@@ -646,7 +646,7 @@ func lookupzq(path string) (string, error) {
 		if err == nil {
 			return zq, nil
 		}
-		if !errors.Is(err, exec.ErrNotFound) {
+		if !errors.Is(err, os.ErrNotExist) {
 			return "", err
 		}
 	}
diff --git a/ztests/formats/flatten/2.yaml b/ztests/formats/flatten/2.yaml
index 0d4bccebf..63e857a12 100644
--- a/ztests/formats/flatten/2.yaml
+++ b/ztests/formats/flatten/2.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   #port=uint16
diff --git a/ztests/formats/flatten/3.yaml b/ztests/formats/flatten/3.yaml
index cc600e2ef..4d21ecb2b 100644
--- a/ztests/formats/flatten/3.yaml
+++ b/ztests/formats/flatten/3.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   #port=uint16
diff --git a/ztests/formats/flatten/table-with-epoch-dates.yaml b/ztests/formats/flatten/table-with-epoch-dates.yaml
index 6938aaa5a..37646ed5e 100644
--- a/ztests/formats/flatten/table-with-epoch-dates.yaml
+++ b/ztests/formats/flatten/table-with-epoch-dates.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   #port=uint16
diff --git a/ztests/formats/string-set/bzng.yaml b/ztests/formats/string-set/bzng.yaml
index a4735e25d..68a698d99 100644
--- a/ztests/formats/string-set/bzng.yaml
+++ b/ztests/formats/string-set/bzng.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: !!binary +BH2AQFmFxgBABgBARgCAwAYBQkIZHVwGAUJBGEEehgFCQRhBHoYChMABGEEeghkdXD/
 
diff --git a/ztests/formats/string-set/zeek.yaml b/ztests/formats/string-set/zeek.yaml
index e0dff125c..58fa5af0b 100644
--- a/ztests/formats/string-set/zeek.yaml
+++ b/ztests/formats/string-set/zeek.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   #separator \x09
diff --git a/ztests/formats/string-set/zng.yaml b/ztests/formats/string-set/zng.yaml
index 0b147d217..5f3063962 100644
--- a/ztests/formats/string-set/zng.yaml
+++ b/ztests/formats/string-set/zng.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   #0:record[f:set[bstring]]
diff --git a/ztests/formats/time/2.yaml b/ztests/formats/time/2.yaml
index fe9f5ca2f..1a5d027c3 100644
--- a/ztests/formats/time/2.yaml
+++ b/ztests/formats/time/2.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   #0:record[_path:string,ts:time,ts2:time]
diff --git a/ztests/formats/time/3.yaml b/ztests/formats/time/3.yaml
index b0d950e04..984d8e0a6 100644
--- a/ztests/formats/time/3.yaml
+++ b/ztests/formats/time/3.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   #0:record[_path:string,ts:time,d:duration]
diff --git a/ztests/formats/time/5.yaml b/ztests/formats/time/5.yaml
index 081faef90..dd7f50a14 100644
--- a/ztests/formats/time/5.yaml
+++ b/ztests/formats/time/5.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   #0:record[_path:string,ts:time,d:duration]
diff --git a/ztests/formats/time/6.yaml b/ztests/formats/time/6.yaml
index 57a25cac8..390469041 100644
--- a/ztests/formats/time/6.yaml
+++ b/ztests/formats/time/6.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   #0:record[_path:string,ts:time,d:duration]
diff --git a/ztests/formats/union/array-bzng.yaml b/ztests/formats/union/array-bzng.yaml
index ee0c56598..2d92067dd 100644
--- a/ztests/formats/union/array-bzng.yaml
+++ b/ztests/formats/union/array-bzng.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: !!binary |
         IzA6cmVjb3JkW2E6YXJyYXlbdW5pb25baW50NjQsc3RyaW5nXV1dCjA6W1sxOm
diff --git a/ztests/formats/union/array-ndjson.yaml b/ztests/formats/union/array-ndjson.yaml
index cbc25356e..c154525c5 100644
--- a/ztests/formats/union/array-ndjson.yaml
+++ b/ztests/formats/union/array-ndjson.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   {"a":["foo",1]}
diff --git a/ztests/formats/union/array-zjson.yaml b/ztests/formats/union/array-zjson.yaml
index 09df5d57e..1299a81b3 100644
--- a/ztests/formats/union/array-zjson.yaml
+++ b/ztests/formats/union/array-zjson.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   {"id":25,"schema":{"of":[{"name":"a","of":{"of":["int32","string"],"type":"union"},"type":"array"}],"type":"record"},"values":[[["1","asdfasdf"],null,["0","100"]]]}
diff --git a/ztests/formats/union/array-zng.yaml b/ztests/formats/union/array-zng.yaml
index 81254df5e..84a9bdbe1 100644
--- a/ztests/formats/union/array-zng.yaml
+++ b/ztests/formats/union/array-zng.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   #0:record[a:array[union[int32,string]]]
diff --git a/ztests/formats/union/nested-bzng.yaml b/ztests/formats/union/nested-bzng.yaml
index 2473bbddf..92c0d65ed 100644
--- a/ztests/formats/union/nested-bzng.yaml
+++ b/ztests/formats/union/nested-bzng.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: !!binary |
   IzA6cmVjb3JkW2E6dW5pb25bc3RyaW5nLGFycmF5W2ludDY0XSxhcnJheVtzdHJpbmddLH
diff --git a/ztests/formats/union/nested-zjson.yaml b/ztests/formats/union/nested-zjson.yaml
index b986c59c0..2a5f46b3e 100644
--- a/ztests/formats/union/nested-zjson.yaml
+++ b/ztests/formats/union/nested-zjson.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   {"id":27,"schema":{"of":[{"name":"a","of":["string",{"of":"int32","type":"array"},{"of":"string","type":"array"},{"of":["string","int32"],"type":"union"}],"type":"union"}],"type":"record"},"values":[["0","\"hello\""]]}
diff --git a/ztests/formats/union/nested-zng.yaml b/ztests/formats/union/nested-zng.yaml
index 84130a86e..623071fd4 100644
--- a/ztests/formats/union/nested-zng.yaml
+++ b/ztests/formats/union/nested-zng.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   #0:record[a:union[string,array[int32],array[string],union[string,int32]]]
diff --git a/ztests/formats/union/simple-bzng.yaml b/ztests/formats/union/simple-bzng.yaml
index e72305071..6d109df3a 100644
--- a/ztests/formats/union/simple-bzng.yaml
+++ b/ztests/formats/union/simple-bzng.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: !!binary +QIHEPYBAWEXGAwXBAISYXNkZmFzZGYYBAcCBAIYAQD/
 
diff --git a/ztests/formats/union/simple-zjson.yaml b/ztests/formats/union/simple-zjson.yaml
index 35c9dc7e2..d44f8b444 100644
--- a/ztests/formats/union/simple-zjson.yaml
+++ b/ztests/formats/union/simple-zjson.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   {"id":24,"schema":{"of":[{"name":"a","of":["int32","string"],"type":"union"}],"type":"record"},"values":[["1","asdfasdf"]]}
diff --git a/ztests/formats/union/simple-zng.yaml b/ztests/formats/union/simple-zng.yaml
index cb61a49d2..922bdff6d 100644
--- a/ztests/formats/union/simple-zng.yaml
+++ b/ztests/formats/union/simple-zng.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   #0:record[a:union[int32,string]]
diff --git a/ztests/formats/unset/unset.yaml b/ztests/formats/unset/unset.yaml
index f2e86628f..d2f74fd93 100644
--- a/ztests/formats/unset/unset.yaml
+++ b/ztests/formats/unset/unset.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   {"vec": ["foo", null, "-"]}
diff --git a/ztests/formats/unset/unsetinrecord.yaml b/ztests/formats/unset/unsetinrecord.yaml
index e6bd23e2f..8746d2f33 100644
--- a/ztests/formats/unset/unsetinrecord.yaml
+++ b/ztests/formats/unset/unsetinrecord.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   #separator \x09
diff --git a/ztests/formats/unset/unsetinvector.yaml b/ztests/formats/unset/unsetinvector.yaml
index e89441a4d..dd507d2be 100644
--- a/ztests/formats/unset/unsetinvector.yaml
+++ b/ztests/formats/unset/unsetinvector.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   #separator \x09
diff --git a/ztests/formats/unset/unsettime.yaml b/ztests/formats/unset/unsettime.yaml
index d4ce251be..75e6519e1 100644
--- a/ztests/formats/unset/unsettime.yaml
+++ b/ztests/formats/unset/unsettime.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   #separator \x09
diff --git a/ztests/formats/zng/streams-1.yaml b/ztests/formats/zng/streams-1.yaml
index 1158e0be7..5e316fa45 100644
--- a/ztests/formats/zng/streams-1.yaml
+++ b/ztests/formats/zng/streams-1.yaml
@@ -1,7 +1,7 @@
 # Test frame markers inserted into a zng frame (including testing
 # that type definitions are repeated as needed).
 
-zql: '*'
+zed: '*'
 
 input: |
   #0:record[_path:string,ts:time,d:float64]
diff --git a/ztests/formats/zng/streams-2.yaml b/ztests/formats/zng/streams-2.yaml
index f722fa277..17c876880 100644
--- a/ztests/formats/zng/streams-2.yaml
+++ b/ztests/formats/zng/streams-2.yaml
@@ -1,6 +1,6 @@
 # Test that type ids are not re-used across zng streams.
 
-zql: '*'
+zed: '*'
 
 input: |
   #0:record[s:string]
diff --git a/ztests/formats/zng/type-reset.yaml b/ztests/formats/zng/type-reset.yaml
index b890c682e..865834bf5 100644
--- a/ztests/formats/zng/type-reset.yaml
+++ b/ztests/formats/zng/type-reset.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   #0:record[_path:string,ts:time,d:float64]
diff --git a/ztests/formats/zng/write.yaml b/ztests/formats/zng/write.yaml
index 1ac76b66b..0016bbc61 100644
--- a/ztests/formats/zng/write.yaml
+++ b/ztests/formats/zng/write.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   #0:record[_path:string,ts:time,d:float64]
diff --git a/ztests/suite/cut/cut-empty-record.yaml b/ztests/suite/cut/cut-empty-record.yaml
index 310e9bd37..24522ce61 100644
--- a/ztests/suite/cut/cut-empty-record.yaml
+++ b/ztests/suite/cut/cut-empty-record.yaml
@@ -1,4 +1,4 @@
-zql: cut a, b
+zed: cut a, b
 
 input: |
   #0:record[]
diff --git a/ztests/suite/cut/cut-foo-bar.yaml b/ztests/suite/cut/cut-foo-bar.yaml
index af581fa09..a8b4e903b 100644
--- a/ztests/suite/cut/cut-foo-bar.yaml
+++ b/ztests/suite/cut/cut-foo-bar.yaml
@@ -1,4 +1,4 @@
-zql: cut foo, bar
+zed: cut foo, bar
 
 input: |
   #0:record[foo:string]
diff --git a/ztests/suite/cut/cut-rename-foo-bar.yaml b/ztests/suite/cut/cut-rename-foo-bar.yaml
index fbe8d5aa8..571c8b229 100644
--- a/ztests/suite/cut/cut-rename-foo-bar.yaml
+++ b/ztests/suite/cut/cut-rename-foo-bar.yaml
@@ -1,4 +1,4 @@
-zql: cut f=foo, b=bar
+zed: cut f=foo, b=bar
 
 input: |
   #0:record[foo:string]
diff --git a/ztests/suite/cut/cut-rename-nested.yaml b/ztests/suite/cut/cut-rename-nested.yaml
index ba003ea9c..92ace33de 100644
--- a/ztests/suite/cut/cut-rename-nested.yaml
+++ b/ztests/suite/cut/cut-rename-nested.yaml
@@ -1,4 +1,4 @@
-zql: cut ports=id, resp_p=id.resp_p
+zed: cut ports=id, resp_p=id.resp_p
 
 input: |
   #port=uint16
diff --git a/ztests/suite/cut/cut.yaml b/ztests/suite/cut/cut.yaml
index 270b7ea40..620bea598 100644
--- a/ztests/suite/cut/cut.yaml
+++ b/ztests/suite/cut/cut.yaml
@@ -1,4 +1,4 @@
-zql: cut foo
+zed: cut foo
 
 input: |
   #separator \x09
diff --git a/ztests/suite/cut/drop-unset-record.yaml b/ztests/suite/cut/drop-unset-record.yaml
index b620a31f6..3b8d2c021 100644
--- a/ztests/suite/cut/drop-unset-record.yaml
+++ b/ztests/suite/cut/drop-unset-record.yaml
@@ -1,4 +1,4 @@
-zql: drop id
+zed: drop id
 
 input: |
   #0:record[id:record[ip:ip],id2:record[ip:ip]]
diff --git a/ztests/suite/errors/empty-input.yaml b/ztests/suite/errors/empty-input.yaml
index 4985cde79..2dd56e124 100644
--- a/ztests/suite/errors/empty-input.yaml
+++ b/ztests/suite/errors/empty-input.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: ''
 
diff --git a/ztests/suite/errors/nosemi.yaml b/ztests/suite/errors/nosemi.yaml
index 2efc98360..26f172a14 100644
--- a/ztests/suite/errors/nosemi.yaml
+++ b/ztests/suite/errors/nosemi.yaml
@@ -1,4 +1,4 @@
-zql: filter *
+zed: filter *
 
 input: |
   #0:record[x:int32]
diff --git a/ztests/suite/filter/escaped-asterisk.yaml b/ztests/suite/filter/escaped-asterisk.yaml
index 422a84961..ea5cb6d7b 100644
--- a/ztests/suite/filter/escaped-asterisk.yaml
+++ b/ztests/suite/filter/escaped-asterisk.yaml
@@ -1,4 +1,4 @@
-zql: A\=\*
+zed: A\=\*
 
 input: |
   #0:record[s:string]
diff --git a/ztests/suite/filter/escaped-equal-sign.yaml b/ztests/suite/filter/escaped-equal-sign.yaml
index c8ff81e1c..b4dc8a386 100644
--- a/ztests/suite/filter/escaped-equal-sign.yaml
+++ b/ztests/suite/filter/escaped-equal-sign.yaml
@@ -1,4 +1,4 @@
-zql: A\=B
+zed: A\=B
 
 input: |
   #0:record[s:string]
diff --git a/ztests/suite/filter/null-with-nonexistent-field.yaml b/ztests/suite/filter/null-with-nonexistent-field.yaml
index ba23cc61e..d4995a62a 100644
--- a/ztests/suite/filter/null-with-nonexistent-field.yaml
+++ b/ztests/suite/filter/null-with-nonexistent-field.yaml
@@ -1,4 +1,4 @@
-zql: not (t=null or t!=null)
+zed: not (t=null or t!=null)
 
 input: &input |
   #0:record[s:string]
diff --git a/ztests/suite/filter/null-with-unset-field.yaml b/ztests/suite/filter/null-with-unset-field.yaml
index c0f4903f7..ac7776596 100644
--- a/ztests/suite/filter/null-with-unset-field.yaml
+++ b/ztests/suite/filter/null-with-unset-field.yaml
@@ -1,4 +1,4 @@
-zql: s=null
+zed: s=null
 
 input: |
   #0:record[s:string]
diff --git a/ztests/suite/filter/unescaped-asterisk.yaml b/ztests/suite/filter/unescaped-asterisk.yaml
index be713df4d..70d93c7d7 100644
--- a/ztests/suite/filter/unescaped-asterisk.yaml
+++ b/ztests/suite/filter/unescaped-asterisk.yaml
@@ -1,4 +1,4 @@
-zql: A\=*
+zed: A\=*
 
 input: |
   #0:record[s:string]
diff --git a/ztests/suite/format/format.yaml b/ztests/suite/format/format.yaml
index e8e686c10..03d099844 100644
--- a/ztests/suite/format/format.yaml
+++ b/ztests/suite/format/format.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   #separator \x09
diff --git a/ztests/suite/format/json_types.yaml b/ztests/suite/format/json_types.yaml
index 996668d19..e60ea48c9 100644
--- a/ztests/suite/format/json_types.yaml
+++ b/ztests/suite/format/json_types.yaml
@@ -1,6 +1,6 @@
 # This test covers serializing all the different zng types to json.
 
-zql: '*'
+zed: '*'
 
 input: |
   #0:record[a:ip,a2:ip,b:bool,c:uint64,f:float64,i:int32,interval:duration,p:uint16,s:string,t:time]
diff --git a/ztests/suite/input/json.yaml b/ztests/suite/input/json.yaml
index e388ccf2e..d93d03128 100644
--- a/ztests/suite/input/json.yaml
+++ b/ztests/suite/input/json.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   { "string1": "value1", "string2": "value1", "int1": 4, "bool1": true }
diff --git a/ztests/suite/input/multiple.yaml b/ztests/suite/input/multiple.yaml
index 74c1724ce..f7e0a7c14 100644
--- a/ztests/suite/input/multiple.yaml
+++ b/ztests/suite/input/multiple.yaml
@@ -1,4 +1,4 @@
-zql: 'count()'
+zed: 'count()'
 
 # This is the concatenation of two identical ZNG streams generated with
 # `bash -c '(zq - <<<{a:1}; zq - <<<{a:1}) | base64'`.
diff --git a/ztests/suite/input/zeek-escaped-backslash.yaml b/ztests/suite/input/zeek-escaped-backslash.yaml
index 18fbd26d4..868586fd4 100644
--- a/ztests/suite/input/zeek-escaped-backslash.yaml
+++ b/ztests/suite/input/zeek-escaped-backslash.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   #separator \x09
diff --git a/ztests/suite/ndjson/empty-objects.yaml b/ztests/suite/ndjson/empty-objects.yaml
index 497ff9fc6..90836dcb4 100644
--- a/ztests/suite/ndjson/empty-objects.yaml
+++ b/ztests/suite/ndjson/empty-objects.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   {}
diff --git a/ztests/suite/ndjson/hyphen.yaml b/ztests/suite/ndjson/hyphen.yaml
index e92ac10ef..7d4a257b9 100644
--- a/ztests/suite/ndjson/hyphen.yaml
+++ b/ztests/suite/ndjson/hyphen.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: &input |
   {"Hyphen":"-"}
diff --git a/ztests/suite/put/overwrite-132.yaml b/ztests/suite/put/overwrite-132.yaml
index e744da317..0eab9280e 100644
--- a/ztests/suite/put/overwrite-132.yaml
+++ b/ztests/suite/put/overwrite-132.yaml
@@ -2,7 +2,7 @@
 # Note that the expression logic coerces int32 to int64.
 # When we revist the expression design this will probably change
 # and this test will need to be updated.
-zql: put c=1,a=3,b=2
+zed: put c=1,a=3,b=2
 
 input: |
   #0:record[a:int32,b:int32,c:int32]
diff --git a/ztests/suite/put/overwrite-321.yaml b/ztests/suite/put/overwrite-321.yaml
index a2a62ae32..7d7844adc 100644
--- a/ztests/suite/put/overwrite-321.yaml
+++ b/ztests/suite/put/overwrite-321.yaml
@@ -1,4 +1,4 @@
-zql: put a=3,b=2,c=1
+zed: put a=3,b=2,c=1
 
 input: |
   #0:record[a:int32,b:int32]
diff --git a/ztests/suite/put/put-1.yaml b/ztests/suite/put/put-1.yaml
index 6e6c44cd0..506b41789 100644
--- a/ztests/suite/put/put-1.yaml
+++ b/ztests/suite/put/put-1.yaml
@@ -1,5 +1,5 @@
 # Tests a simple expression written into a new field
-zql: put y = x + 1
+zed: put y = x + 1
 
 input: |
   #0:record[x:int32]
diff --git a/ztests/suite/put/put-2.yaml b/ztests/suite/put/put-2.yaml
index 3817e77ca..3997a5fae 100644
--- a/ztests/suite/put/put-2.yaml
+++ b/ztests/suite/put/put-2.yaml
@@ -1,5 +1,5 @@
 # Tests a simple expression written into an existing field
-zql: put x = x + 1
+zed: put x = x + 1
 
 input: |
   #0:record[x:int32]
diff --git a/ztests/suite/put/put-3.yaml b/ztests/suite/put/put-3.yaml
index e351fd0e6..f42f99536 100644
--- a/ztests/suite/put/put-3.yaml
+++ b/ztests/suite/put/put-3.yaml
@@ -1,5 +1,5 @@
 # Tests writing a new record
-zql: put r2 = r
+zed: put r2 = r
 
 input: |
   #0:record[r:record[s:string]]
diff --git a/ztests/suite/put/put-4.yaml b/ztests/suite/put/put-4.yaml
index 8a42bd05b..44a6a6fdf 100644
--- a/ztests/suite/put/put-4.yaml
+++ b/ztests/suite/put/put-4.yaml
@@ -1,5 +1,5 @@
 # Tests overwriting a primitive value with a record
-zql: put x = r
+zed: put x = r
 
 input: |
   #0:record[x:int32,r:record[s:string]]
diff --git a/ztests/suite/put/put-5.yaml b/ztests/suite/put/put-5.yaml
index 78a30ffc2..c2b4daacc 100644
--- a/ztests/suite/put/put-5.yaml
+++ b/ztests/suite/put/put-5.yaml
@@ -1,5 +1,5 @@
 # Tests overwriting a record with a primitive value
-zql: put r = x
+zed: put r = x
 
 input: |
   #0:record[x:int32,r:record[s:string]]
diff --git a/ztests/suite/put/put-6.yaml b/ztests/suite/put/put-6.yaml
index a56065e54..cadbcfe97 100644
--- a/ztests/suite/put/put-6.yaml
+++ b/ztests/suite/put/put-6.yaml
@@ -1,5 +1,5 @@
 # Tests integer division by zero error
-zql: put y = x / 0
+zed: put y = x / 0
 
 input: |
   #0:record[x:int32]
diff --git a/ztests/suite/put/put-changing-types.yaml b/ztests/suite/put/put-changing-types.yaml
index ce235202a..8d9cc8c22 100644
--- a/ztests/suite/put/put-changing-types.yaml
+++ b/ztests/suite/put/put-changing-types.yaml
@@ -1,6 +1,6 @@
 # Tests that put handles different output types for the same input
 # type correctly
-zql: 'put y = x > 0 ? "string" : x'
+zed: 'put y = x > 0 ? "string" : x'
 
 input: |
   #0:record[x:int32]
diff --git a/ztests/suite/put/put-error.yaml b/ztests/suite/put/put-error.yaml
index 7d0d030e1..620c391c9 100644
--- a/ztests/suite/put/put-error.yaml
+++ b/ztests/suite/put/put-error.yaml
@@ -1,6 +1,6 @@
 # Tests that warnings are propagated and that we only warn once
 # for a given error.
-zql: put y = sqrt(x)
+zed: put y = sqrt(x)
 
 input: |
   #0:record[x:int32]
diff --git a/ztests/suite/put/put-multi-1.yaml b/ztests/suite/put/put-multi-1.yaml
index 17e3a0cd0..2558dd168 100644
--- a/ztests/suite/put/put-multi-1.yaml
+++ b/ztests/suite/put/put-multi-1.yaml
@@ -1,5 +1,5 @@
 # Tests multiple output expressions
-zql: put a=1, b=2
+zed: put a=1, b=2
 
 input: |
   #0:record[x:int32]
diff --git a/ztests/suite/put/put-multi-2.yaml b/ztests/suite/put/put-multi-2.yaml
index c90e9ade8..00672fe6a 100644
--- a/ztests/suite/put/put-multi-2.yaml
+++ b/ztests/suite/put/put-multi-2.yaml
@@ -1,5 +1,5 @@
 # Test overwriting multiple fields in-order
-zql: put a=b, b=a
+zed: put a=b, b=a
 
 input: |
   #0:record[a:int32,b:int32]
diff --git a/ztests/suite/put/put-multi-3.yaml b/ztests/suite/put/put-multi-3.yaml
index 47c37d7e0..f99df0295 100644
--- a/ztests/suite/put/put-multi-3.yaml
+++ b/ztests/suite/put/put-multi-3.yaml
@@ -1,5 +1,5 @@
 # Test overwriting multiple fields out of order
-zql: put b=a, a=b
+zed: put b=a, a=b
 
 input: |
   #0:record[a:int32,b:int32]
diff --git a/ztests/suite/put/put-multi-4.yaml b/ztests/suite/put/put-multi-4.yaml
index cd5de3784..0a0bbcd20 100644
--- a/ztests/suite/put/put-multi-4.yaml
+++ b/ztests/suite/put/put-multi-4.yaml
@@ -1,6 +1,6 @@
 # Tests one expression that overwrites an existing field, another that
 # creates a new field
-zql: put new=1, x=x+1
+zed: put new=1, x=x+1
 
 input: |
   #0:record[x:int32]
diff --git a/ztests/suite/reducer/count-assign.yaml b/ztests/suite/reducer/count-assign.yaml
index 23e250bfe..09e9f9017 100644
--- a/ztests/suite/reducer/count-assign.yaml
+++ b/ztests/suite/reducer/count-assign.yaml
@@ -1,4 +1,4 @@
-zql: c=count()
+zed: c=count()
 
 input: |
   #0:record[_path:string,foo:string]
diff --git a/ztests/suite/reducer/count.yaml b/ztests/suite/reducer/count.yaml
index ad2b0663a..50dafbf17 100644
--- a/ztests/suite/reducer/count.yaml
+++ b/ztests/suite/reducer/count.yaml
@@ -1,4 +1,4 @@
-zql: count()
+zed: count()
 
 input: |
   #0:record[_path:string,foo:string]
diff --git a/ztests/suite/reducer/duplicate.yaml b/ztests/suite/reducer/duplicate.yaml
index af999e341..f9c95acc8 100644
--- a/ztests/suite/reducer/duplicate.yaml
+++ b/ztests/suite/reducer/duplicate.yaml
@@ -1,4 +1,4 @@
-zql: count(), count()
+zed: count(), count()
 
 input: |
   #0:record[x:int32]
diff --git a/ztests/suite/reducer/unset.yaml b/ztests/suite/reducer/unset.yaml
index 3ccbf2c12..c8e202896 100644
--- a/ztests/suite/reducer/unset.yaml
+++ b/ztests/suite/reducer/unset.yaml
@@ -1,4 +1,4 @@
-zql: avg(x), count(x), countdistinct(x), any(x), max(x), min(x), sum(x)
+zed: avg(x), count(x), countdistinct(x), any(x), max(x), min(x), sum(x)
 
 input: |
   #0:record[x:uint64]
diff --git a/ztests/suite/regexp/regexp.yaml b/ztests/suite/regexp/regexp.yaml
index 1d40017bf..eb7cf8a7a 100644
--- a/ztests/suite/regexp/regexp.yaml
+++ b/ztests/suite/regexp/regexp.yaml
@@ -1,4 +1,4 @@
-zql: foo*
+zed: foo*
 
 input: |
   #0:record[a:string,b:string]
diff --git a/ztests/suite/rename/rename-error-dupe.yaml b/ztests/suite/rename/rename-error-dupe.yaml
index ea0143038..bfa6cc38e 100644
--- a/ztests/suite/rename/rename-error-dupe.yaml
+++ b/ztests/suite/rename/rename-error-dupe.yaml
@@ -1,4 +1,4 @@
-zql: rename foo=goo
+zed: rename foo=goo
 
 input: |
   #0:record[foo:string,goo:string]
diff --git a/ztests/suite/rename/rename-error-move.yaml b/ztests/suite/rename/rename-error-move.yaml
index af705eb31..220e50ddf 100644
--- a/ztests/suite/rename/rename-error-move.yaml
+++ b/ztests/suite/rename/rename-error-move.yaml
@@ -1,4 +1,4 @@
-zql: rename dst=id.resp_h
+zed: rename dst=id.resp_h
 
 input: |
   #port=uint16
diff --git a/ztests/suite/rename/rename-foo-bar.yaml b/ztests/suite/rename/rename-foo-bar.yaml
index 9cebbebcb..34f6ee0eb 100644
--- a/ztests/suite/rename/rename-foo-bar.yaml
+++ b/ztests/suite/rename/rename-foo-bar.yaml
@@ -1,4 +1,4 @@
-zql: rename f=foo, b=bar
+zed: rename f=foo, b=bar
 
 input: |
   #0:record[foo:string]
diff --git a/ztests/suite/rename/rename-nested.yaml b/ztests/suite/rename/rename-nested.yaml
index ea3f5d7a6..e4ec8c912 100644
--- a/ztests/suite/rename/rename-nested.yaml
+++ b/ztests/suite/rename/rename-nested.yaml
@@ -1,4 +1,4 @@
-zql: rename id.dst=id.resp_h, id.src=id.orig_h, net=id
+zed: rename id.dst=id.resp_h, id.src=id.orig_h, net=id
 
 input: |
   #port=uint16
diff --git a/ztests/suite/rename/rename-share.yaml b/ztests/suite/rename/rename-share.yaml
index dcab3177f..d39c2b13d 100644
--- a/ztests/suite/rename/rename-share.yaml
+++ b/ztests/suite/rename/rename-share.yaml
@@ -1,5 +1,5 @@
 # tests that a rename isn't visible to other procs operating on same records.
-zql: split (=>rename id2=id =>cut id.orig_h) | sort id
+zed: split (=>rename id2=id =>cut id.orig_h) | sort id
 
 input: |
   #port=uint16
diff --git a/ztests/suite/sort/sort-1.yaml b/ztests/suite/sort/sort-1.yaml
index 4ffe8b2e8..24d392bd8 100644
--- a/ztests/suite/sort/sort-1.yaml
+++ b/ztests/suite/sort/sort-1.yaml
@@ -1,4 +1,4 @@
-zql: sort x
+zed: sort x
 
 input: |
   #0:record[x:set[ip]]
diff --git a/ztests/suite/sort/sort-2.yaml b/ztests/suite/sort/sort-2.yaml
index dd7daa7d5..831127115 100644
--- a/ztests/suite/sort/sort-2.yaml
+++ b/ztests/suite/sort/sort-2.yaml
@@ -1,4 +1,4 @@
-zql: sort x
+zed: sort x
 
 input: |
   #0:record[x:set[ip]]
diff --git a/ztests/suite/sort/sort-3.yaml b/ztests/suite/sort/sort-3.yaml
index 2d290c784..cf1f02679 100644
--- a/ztests/suite/sort/sort-3.yaml
+++ b/ztests/suite/sort/sort-3.yaml
@@ -1,4 +1,4 @@
-zql: sort TTLs
+zed: sort TTLs
 
 input: |
   #0:record[TTLs:array[duration],count:uint64]
diff --git a/ztests/suite/sort/sort-4-1.yaml b/ztests/suite/sort/sort-4-1.yaml
index 2434b1db0..9071b9566 100644
--- a/ztests/suite/sort/sort-4-1.yaml
+++ b/ztests/suite/sort/sort-4-1.yaml
@@ -1,4 +1,4 @@
-zql: sort -nulls last s
+zed: sort -nulls last s
 
 input: |
   #0:record[s:string]
diff --git a/ztests/suite/sort/sort-4-2.yaml b/ztests/suite/sort/sort-4-2.yaml
index 2c94e224a..83e859f8c 100644
--- a/ztests/suite/sort/sort-4-2.yaml
+++ b/ztests/suite/sort/sort-4-2.yaml
@@ -1,4 +1,4 @@
-zql: sort -nulls first s
+zed: sort -nulls first s
 
 input: |
   #0:record[s:string]
diff --git a/ztests/suite/sort/sort-4-3.yaml b/ztests/suite/sort/sort-4-3.yaml
index 922a057c0..3f544e8bf 100644
--- a/ztests/suite/sort/sort-4-3.yaml
+++ b/ztests/suite/sort/sort-4-3.yaml
@@ -1,4 +1,4 @@
-zql: sort -r -nulls last s
+zed: sort -r -nulls last s
 
 input: |
   #0:record[s:string]
diff --git a/ztests/suite/sort/sort-4-4.yaml b/ztests/suite/sort/sort-4-4.yaml
index 3badc6792..f03fcff5b 100644
--- a/ztests/suite/sort/sort-4-4.yaml
+++ b/ztests/suite/sort/sort-4-4.yaml
@@ -1,4 +1,4 @@
-zql: sort -r -nulls first s
+zed: sort -r -nulls first s
 
 input: |
   #0:record[s:string]
diff --git a/ztests/suite/sort/sort-alias.yaml b/ztests/suite/sort/sort-alias.yaml
index da04506ae..31909266f 100644
--- a/ztests/suite/sort/sort-alias.yaml
+++ b/ztests/suite/sort/sort-alias.yaml
@@ -1,4 +1,4 @@
-zql: sort host
+zed: sort host
 
 input: |
   #0:record[host:ip]
diff --git a/ztests/suite/sort/sort-first-field-always-null.yaml b/ztests/suite/sort/sort-first-field-always-null.yaml
index adb86fc51..78f991689 100644
--- a/ztests/suite/sort/sort-first-field-always-null.yaml
+++ b/ztests/suite/sort/sort-first-field-always-null.yaml
@@ -1,4 +1,4 @@
-zql: sort x, y
+zed: sort x, y
 
 input: |
   #0:record[x:int64,y:int64]
diff --git a/ztests/suite/tail/toomuch.yaml b/ztests/suite/tail/toomuch.yaml
index a44cde352..27306ada2 100644
--- a/ztests/suite/tail/toomuch.yaml
+++ b/ztests/suite/tail/toomuch.yaml
@@ -1,4 +1,4 @@
-zql: tail 2
+zed: tail 2
 
 input: |
   #0:record[x:string]
diff --git a/ztests/suite/time/ts-in-first-column.yaml b/ztests/suite/time/ts-in-first-column.yaml
index 7f318d7b3..1e7e3f858 100644
--- a/ztests/suite/time/ts-in-first-column.yaml
+++ b/ztests/suite/time/ts-in-first-column.yaml
@@ -1,4 +1,4 @@
-zql: every 24h count()
+zed: every 24h count()
 
 # This log is path-less in order to make "ts" the first column and
 # that verify we handle this case correctly.
diff --git a/ztests/suite/zjson/empty-records.yaml b/ztests/suite/zjson/empty-records.yaml
index 00dc67855..e90ee30fc 100644
--- a/ztests/suite/zjson/empty-records.yaml
+++ b/ztests/suite/zjson/empty-records.yaml
@@ -1,4 +1,4 @@
-zql: '*'
+zed: '*'
 
 input: |
   {"id":23,"schema":{"type":"record","of":[{"name":"ja3s","type":"int32"}]},"values":[null]}