Skip to content

Commit

Permalink
Fix panic when using load with zq (#5162)
Browse files Browse the repository at this point in the history
Closes #5157
  • Loading branch information
mattnibs authored Jul 1, 2024
1 parent ab603fa commit 3822b66
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions compiler/semantic/op.go
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,10 @@ func (a *analyzer) semOp(o ast.Op, seq dag.Seq) dag.Seq {
Exprs: exprs,
})
case *ast.Load:
if !a.source.IsLake() {
a.error(o, errors.New("load operator cannot be used without a lake"))
return []dag.Op{badOp()}
}
poolID, err := lakeparse.ParseID(o.Pool)
if err != nil {
poolID, err = a.source.PoolID(a.ctx, o.Pool)
Expand Down
3 changes: 3 additions & 0 deletions compiler/ztests/load-no-lake.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
zed: "load test"

errorRE: "load operator cannot be used without a lake"

0 comments on commit 3822b66

Please sign in to comment.