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

Table view shows empty/missing complex value when it actually contains data #2453

Closed
philrz opened this issue Jul 20, 2022 · 4 comments · Fixed by #2626
Closed

Table view shows empty/missing complex value when it actually contains data #2453

philrz opened this issue Jul 20, 2022 · 4 comments · Fixed by #2626
Labels
bug Something isn't working

Comments

@philrz
Copy link
Contributor

philrz commented Jul 20, 2022

Repro is with Brim commit 55d1fdc and attached test data, http.zng.gz which are records based on importing the Emotet pcap referenced in #1245.

To repro, import the test data and execute the query:

_path=="http"
| count() by status_code,host
| counts:=collect({status_code,count}) by host

In the default Table view, the counts values are rendered as if each is an empty array. However, clicking to the Inspector tab and expanding them reveals that each array actually contains a single-element record.

Repro.mp4

As a user, the Table view had me fooled at first such that I thought incorrectly there might have been a bug in collect()

When certain top-level complex structures are imported (such as the array in prs.json) the app doesn't try to render anything in the Table view and instead says "The table view can only render records at the moment." For the case shown in the video here, I'm not sure if it's feasible/desirable for the Table view to render what it can and show some kind of visual cue in the arrays that indicates they're non-empty but would need to be viewed in the Inspector, or if it should check all data to be rendered and fall back to the "The table view can only render..." message if anything is deemed un-renderable at any level.

@philrz philrz added the bug Something isn't working label Jul 20, 2022
@philrz philrz changed the title Table view shows am array as empty when it actually contains record values Table view shows empty/missing complex value when it actually contains data Jul 20, 2022
@philrz
Copy link
Contributor Author

philrz commented Jul 25, 2022

It looks like I can also repro the problem with a set data type as well. I assume it shares a root cause so I'm mentioning it here, but can open a separate issue if it turns out it needs to be handled separately. I'm using Brim commit ba79d86 at the moment.

Test data data.zson:

{my_array:[1,2,3,4,5]}
{my_set:|["foo",1.5]|}
{my_map:|{"a":1(int32),"b":2(int32),"c":3(int32)}|}
{my_record:{orig_h:10.164.94.120,orig_p:39681(port=uint16),resp_h:10.47.3.155,resp_p:3389(port)}}

Notice the top row in the Table view shows empty values.

image

Of course they're visible in the Inspector.

image

@philrz
Copy link
Contributor Author

philrz commented Sep 8, 2022

Here's another example I bumped into in Brim commit 8ac2379: The output of count() by typeof(this) using the sample.zng from this repo.

The records show up blank in the Table view.

image

But they're present in Inspector.

image

@philrz
Copy link
Contributor Author

philrz commented Dec 29, 2022

This one is on track to be addressed by the changes in #2626.

As shown in the attached video on commit 4014451 of the branch from #2626, now the complex value is shown in abbreviated form without having to jump to the Inspector view. It's also possible to click to expand and see its full contents.

BranchCheck.mp4

I'll do a final verification when the changes merge, but looks 👍 right now.

@philrz philrz mentioned this issue Dec 29, 2022
45 tasks
@philrz
Copy link
Contributor Author

philrz commented Jan 26, 2023

Verified in Brim commit 499a2c9.

In the attached video, all three pieces of test data described in previous comments are imported and shown to render correctly now in the Table view.

Verify.mp4

Thanks @jameskerr!

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

Successfully merging a pull request may close this issue.

1 participant