Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion compiler/semantic/op.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,9 @@ func (t *translator) fileType(path, format string) (super.Type, error) {
if engine == nil {
return t.checker.unknown, nil
}
return anyio.FileType(t.ctx, t.sctx, engine, path, anyio.ReaderOpts{Format: format}, t.env.SampleSize)
opts := t.env.ReaderOpts
opts.Format = format
return anyio.FileType(t.ctx, t.sctx, engine, path, opts, t.env.SampleSize)
}

func (t *translator) fromFileGlob(globLoc ast.Node, pattern string, args []ast.OpArg) sem.Op {
Expand Down
14 changes: 14 additions & 0 deletions compiler/semantic/ztests/csv-delim.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Read from a file so the semantic pass runs.
script: |
super -s -i csv -csv.delim ';' a.csv

inputs:
- name: a.csv
data: |
a;b;c
x;y,y;z

outputs:
- name: stdout
data: |
{a:"x",b:"y,y",c:"z"}
Loading