Skip to content

Commit

Permalink
zq: fix panic when trying to read from a pool
Browse files Browse the repository at this point in the history
Closes #4935
  • Loading branch information
mattnibs committed Dec 13, 2023
1 parent afba255 commit a3c7605
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cli/queryflags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import (
"github.com/brimdata/zed/cli"
"github.com/brimdata/zed/compiler"
"github.com/brimdata/zed/compiler/ast"
"github.com/brimdata/zed/compiler/data"
"github.com/brimdata/zed/compiler/semantic"
"github.com/brimdata/zed/pkg/storage"
"github.com/brimdata/zed/zbuf"
"github.com/brimdata/zed/zson"
)
Expand All @@ -37,7 +39,7 @@ func (f *Flags) ParseSourcesAndInputs(paths []string) ([]string, ast.Seq, bool,
// and appears to start with a from or yield operator.
// Otherwise, consider it a file.
if query, err := compiler.Parse(src, f.Includes...); err == nil {
if s, err := semantic.Analyze(context.Background(), query, nil, nil); err == nil {
if s, err := semantic.Analyze(context.Background(), query, data.NewSource(storage.NewLocalEngine(), nil), nil); err == nil {
if semantic.HasSource(s) {
return nil, query, false, nil
}
Expand Down

0 comments on commit a3c7605

Please sign in to comment.