From 81686f3f86940a0044428f0aabdf0219c0ed6076 Mon Sep 17 00:00:00 2001 From: Steven McCanne Date: Thu, 24 Oct 2024 17:43:08 -0700 Subject: [PATCH] address PR feedback --- cmd/super/compile/command.go | 2 +- cmd/super/compile/shared.go | 13 ++----------- compiler/ztests/from-error.yaml | 4 ++++ 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/cmd/super/compile/command.go b/cmd/super/compile/command.go index 460cccda5c..c399d91824 100644 --- a/cmd/super/compile/command.go +++ b/cmd/super/compile/command.go @@ -13,7 +13,7 @@ var spec = &charm.Spec{ Short: "compile a local query for inspection and debugging", Long: ` This command parses a query and emits the resulting abstract syntax -tree (AST) or runtime directed-acycle graph (DAG) in the output format desired. +tree (AST) or runtime directed acyclic graph (DAG) in the output format desired. Use "-dag" to specify the DAG form; otherwise, the AST form is assumed. The query text may be either SQL or SPQ. To force parsing as SQL, diff --git a/cmd/super/compile/shared.go b/cmd/super/compile/shared.go index 6a6cf3bae8..dab65aba51 100644 --- a/cmd/super/compile/shared.go +++ b/cmd/super/compile/shared.go @@ -17,6 +17,7 @@ import ( "github.com/brimdata/super/lake" "github.com/brimdata/super/pkg/storage" "github.com/brimdata/super/runtime" + "github.com/brimdata/super/zbuf" "github.com/brimdata/super/zfmt" "github.com/brimdata/super/zio" "github.com/brimdata/super/zson" @@ -117,19 +118,9 @@ func (s *Shared) writeValue(ctx context.Context, v any) error { if err != nil { return err } - err = zio.CopyWithContext(ctx, writer, &valReader{&val}) + err = zio.CopyWithContext(ctx, writer, zbuf.NewArray([]super.Value{val})) if closeErr := writer.Close(); err == nil { err = closeErr } return err } - -type valReader struct { - *super.Value -} - -func (r *valReader) Read() (*super.Value, error) { - val := r.Value - r.Value = nil - return val, nil -} diff --git a/compiler/ztests/from-error.yaml b/compiler/ztests/from-error.yaml index 1a0c890070..8ed1f56978 100644 --- a/compiler/ztests/from-error.yaml +++ b/compiler/ztests/from-error.yaml @@ -1,4 +1,5 @@ script: | + ! super compile -C -dag 'from p' export SUPER_DB_LAKE=test super db init -q ! super db compile -C -dag 'from test' @@ -13,6 +14,9 @@ script: | outputs: - name: stderr data: | + "from pool" cannot be used without a lake at line 1, column 1: + from p + ~~~~~~ test: pool not found at line 1, column 6: from test ~~~~