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

Preserve nesting for exporting events in JSON format #1257

Merged
merged 28 commits into from
Jan 13, 2021

Conversation

tobim
Copy link
Member

@tobim tobim commented Jan 4, 2021

📔 Description

What the title says. Layout types now keep nested records as-is. The JSON writer reconstructs the layers while printing.

📝 Checklist

  • All user-facing changes have changelog entries.
  • The changes are reflected on docs.tenzir.com/vast, if necessary.
  • The PR description contains instructions for the reviewer, if necessary.
  • Fix taxonomy integration test.

🎯 Review Instructions

By commit, but do a quick first pass over the list before reviewing properly, several issues are fixed in later commits.

@tobim tobim added the feature New functionality label Jan 4, 2021
@tobim tobim force-pushed the story/ch20399/nested-layouts branch 3 times, most recently from b91df3f to 769626a Compare January 6, 2021 15:56
@tobim tobim marked this pull request as ready for review January 6, 2021 16:10
@tobim tobim requested a review from a team January 6, 2021 16:10
Copy link
Member

@mavam mavam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you forgot to add table_slice.hpp changes? I'm curious what drives the need for the at overload.

libvast/src/format/csv.cpp Show resolved Hide resolved
auto& payload = caf::get<view<std::string>>(payload_field);
// Make PCAP header.
::pcap_pkthdr header;
auto ns_field = slice.at(row, 0);
auto ns_field = slice.at(row, 0, *pcap_packet_type.at("time"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit unrelated: I never liked the manual integer offsets to get to a field. Maybe we can factor this logic to happen dynamically when the writer gets instantiated?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that belongs to another PR.

@tobim
Copy link
Member Author

tobim commented Jan 8, 2021

@mavam:

Looks like you forgot to add table_slice.hpp changes? I'm curious what drives the need for the at overload.

It's in Cache the type for column based data access

@mavam
Copy link
Member

mavam commented Jan 8, 2021

It's in Cache the type for column based data access

Ah, got it. The link yields a 404 for me, though,

@dominiklohmann
Copy link
Member

Nit: Can you add an assertion to the overload that checks whether the given type is correct?

@mavam
Copy link
Member

mavam commented Jan 8, 2021

Weird CI failure...

@dominiklohmann
Copy link
Member

dominiklohmann commented Jan 8, 2021

Weird CI failure...

Why? This is exactly #1261, this PR just needs to be rebased.

@tobim tobim force-pushed the story/ch20399/nested-layouts branch 2 times, most recently from a9a36df to fa78535 Compare January 8, 2021 16:32
Copy link
Member

@dominiklohmann dominiklohmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is great. I've done some performance measurements, and the differences are barely noticeable for Arrow, but show a slight negative impact for MessagePack. We should probably cache the flat layout in there as well as suggested by my previous review.

Additionally, please expand the documentation of the new table_slice::at function.

libvast/vast/table_slice.hpp Show resolved Hide resolved
libvast/vast/type.hpp Outdated Show resolved Hide resolved
@tobim tobim force-pushed the story/ch20399/nested-layouts branch from f87a753 to a20534b Compare January 13, 2021 10:56
@tobim
Copy link
Member Author

tobim commented Jan 13, 2021

Feedback is integrated and PR is rebased to fix the merge conflict.

Copy link
Member

@dominiklohmann dominiklohmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this again locally. Performance is alright, the loss is irrelevant in the grand scheme of things.

Thanks for working on this, it's a big UX improvement.

@tobim tobim force-pushed the story/ch20399/nested-layouts branch from a20534b to 161e15c Compare January 13, 2021 15:47
@dominiklohmann
Copy link
Member

@tobim you may have to do some adjustments on this because of #1230. If you wanna pair on the adjustments, feel free to ping me in Slack or here.

@tobim tobim force-pushed the story/ch20399/nested-layouts branch from 774cbe5 to 01eb415 Compare January 13, 2021 20:05
@tobim tobim merged commit 1008990 into master Jan 13, 2021
@tobim tobim deleted the story/ch20399/nested-layouts branch January 13, 2021 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants