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

When "load" operator is used in Zui, data is imported twice #2776

Open
philrz opened this issue Jun 4, 2023 · 1 comment
Open

When "load" operator is used in Zui, data is imported twice #2776

philrz opened this issue Jun 4, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@philrz
Copy link
Contributor

philrz commented Jun 4, 2023

Repro is with GA Zui tagged v1.1.0.

In the attached video, a pool containing 10 records is transformed and then the load operator is tacked on to import the data into a new/empty pool. As we can see, the new pool ends up having 20 records.

Repro.mp4

A peek at the traffic on Wireshark makes it clear what's going on here: The base query ends up being executed twice. The first is for populating the search results.

{"query":"from 'data.zson' | MyTime:=ts\n| cut MyTime,num\n| load alt\n  | { i: count(), v: this}\n  | i > 0\n  | head 500\n  | yield v"}

The second is for populating the stacked bar chart.

{"query":"from 'data.zson' | MyTime:=ts\n| cut MyTime,num\n| load alt | count() by every(100ms), _path"}

A purpose-built workflow like what's proposed in #2769 could certainly be implemented in a way that avoids such undesirable side effects, but that would not preclude users from still invoking load in their Zed programs directly. Perhaps the Zed language parser could be made smart enough to recognize when operators with side effects (e.g., not just load, but also delete) are invoked so a client like Zui could ensure it only gets executed once. Just one thought, though.

@philrz philrz added the bug Something isn't working label Jun 4, 2023
@jameskerr
Copy link
Member

I like that idea Phil!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants