Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"redundant inputs" failure when calling -I included User Op #4701

Closed
philrz opened this issue Jul 5, 2023 · 3 comments · Fixed by #4808 or #4831
Closed

"redundant inputs" failure when calling -I included User Op #4701

philrz opened this issue Jul 5, 2023 · 3 comments · Fixed by #4808 or #4831
Assignees

Comments

@philrz
Copy link
Contributor

philrz commented Jul 5, 2023

Repro is with Zed commit 7ba4ecc.

The following all work ok.

$ zq -version
Version: v1.8.1-59-g7ba4ecc6

$ zq 'file sample.zng | count()'
31(uint64)

$ cat file_main.zed 
file sample.zng | count()

$ zq -I file_main.zed 
31(uint64)

$ cat file_in_op.zed
op CallMe(): (
  file sample.zng | count()
)
CallMe()

$ zq -I file_in_op.zed
31(uint64)

However, if I have just the User Op in my included Zed and attempt to make the call to it at the shell level, now I get an error.

$ cat file_in_op_no_call.zed
op CallMe(): (
  file sample.zng | count()
)

$ zq -I file_in_op_no_call.zed 'CallMe()'
redundant inputs specified: use either command-line files or a Zed source operator

I'd not be surprised if there's ways to trigger this that don't involve User Ops, but since I bumped into it accidentally while attempting some basic User Ops use cases, I'm opening it in that context.

@philrz
Copy link
Contributor Author

philrz commented Jul 18, 2023

Note to self: I called out this limitation in the User Ops docs, so make sure to remove that when this gets addressed.

@philrz
Copy link
Contributor Author

philrz commented Oct 12, 2023

It also should be noted that this problem doesn't show up with the lake, which I guess is unsurprising since zed query doesn't have the possible data input from a file to deal with.

$ zed -version
Version: v1.10.0-8-gda250959

$ zed -lake lake init
lake created: file:///Users/phil/work/zed-4701/lake

$ zed -lake lake create -use sample
pool created: sample 2WfdwOnwYrSk6ZoK3l9DyY9TRlU
Switched to branch "main" on pool "sample"

$ zed -lake lake load sample.zng 
(2/1) 4910B/4910B 4910B/s 100.00%
2WfdxViHlMToPMlRmxYbeQnkNkt committed

$ cat from_in_op_no_call.zed
op CallMe(): (
  from sample | count()
)

$ zed -lake lake query -I from_in_op_no_call.zed 'CallMe()'
31(uint64)

@philrz
Copy link
Contributor Author

philrz commented Oct 26, 2023

Verified in Zed commit e03665e.

I can now reference just the User Op that's in my included Zed and can make the call to it at the shell level without error.

$ zq -version
Version: v1.10.0-20-ge03665e6

$ cat file_in_op_no_call.zed
op CallMe(): (
  file sample.zng | count()
)

$ zq -I file_in_op_no_call.zed 'CallMe()'
31(uint64)

I've opened #4831 to update the docs.

Thanks @mattnibs!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants