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

zq: Call user-defined op with source #4808

Merged
merged 1 commit into from
Oct 25, 2023
Merged

zq: Call user-defined op with source #4808

merged 1 commit into from
Oct 25, 2023

Conversation

mattnibs
Copy link
Collaborator

@mattnibs mattnibs commented Oct 17, 2023

The change allows zq users to start a query with a call to a user-defined op that contains a source (file) with no additional input sources. Previously attempting to do this would result in error "redundant inputs".

Fixes #4701

@mattnibs mattnibs requested review from philrz and a team October 17, 2023 00:15
@philrz
Copy link
Contributor

philrz commented Oct 17, 2023

Testing this branch at commit 777dc58, it seems to address #4701. The final command shown below now returns the expected output rather than the redundant inputs error shown in #4701.

$ zq -version
Version: v1.10.0-11-g777dc583

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

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

That makes it a functional 👍 for me. I'll mark it in the opening text as "Fixes #4701" so the issue will close when this merges.

cmd/zq/ztests/call-user-op-with-src.yaml Outdated Show resolved Hide resolved
cli/queryflags/flags.go Outdated Show resolved Hide resolved
@mattnibs mattnibs force-pushed the zq-user-op-source branch 2 times, most recently from a679dc0 to b5e556a Compare October 23, 2023 22:06
compiler/lake.go Outdated Show resolved Hide resolved
compiler/job.go Outdated Show resolved Hide resolved
compiler/semantic/analyzer.go Outdated Show resolved Hide resolved
compiler/semantic/analyzer.go Outdated Show resolved Hide resolved
compiler/semantic/analyzer.go Outdated Show resolved Hide resolved
The change allows zq users to start a query with a call to a user-defined
op that contains a source (file) with no additional input sources.
Previously attempting to do this would result in error "redundant
inputs".
@mattnibs mattnibs merged commit 40639dc into main Oct 25, 2023
3 checks passed
@mattnibs mattnibs deleted the zq-user-op-source branch October 25, 2023 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"redundant inputs" failure when calling -I included User Op
3 participants