diff --git a/compiler/semantic/op.go b/compiler/semantic/op.go index 002d7f8108..c9d6d43ce7 100644 --- a/compiler/semantic/op.go +++ b/compiler/semantic/op.go @@ -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 { diff --git a/compiler/semantic/ztests/csv-delim.yaml b/compiler/semantic/ztests/csv-delim.yaml new file mode 100644 index 0000000000..b68e9364b5 --- /dev/null +++ b/compiler/semantic/ztests/csv-delim.yaml @@ -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"}