Skip to content

Commit

Permalink
address PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
mccanne committed Oct 25, 2024
1 parent 7ab04e8 commit 81686f3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion cmd/super/compile/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
13 changes: 2 additions & 11 deletions cmd/super/compile/shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
}
4 changes: 4 additions & 0 deletions compiler/ztests/from-error.yaml
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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
~~~~
Expand Down

0 comments on commit 81686f3

Please sign in to comment.