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

New Result Serialization #26

Merged
merged 11 commits into from
Dec 23, 2024

Conversation

gropaul
Copy link
Collaborator

@gropaul gropaul commented Dec 18, 2024

Hi Dear Quackscience Team,

I was using the extension (I really love it!) and discovered that all the values are serialized as strings in the JsonCompact mode. This was sometimes a bit itchy for me, especially when I had list values or structs, etc., as I had to recursively parse the JSON to a class.

This is why I propose changing to this new parser, which handles all the (nested) types in more detail. I tested it with SELECT * FROM test_all_types(); and it did not crash (🎉). The new parser has large chunks of code from a parser that @NiclasHaderer once wrote, and I think he got inspired by the duckdb JSON extension.

Also, I switched to an internal function to get the type name, as the current version often returned string.

Let me know what you think and if you have some change requests.

Best regards,
Paul

@lmangani
Copy link
Collaborator

@gropaul first and foremost: thank you for this useful contribution and welcome to quackscience!

I think you might need to include #include <cmath> in result_serializer.cpp for the build to succeed?

@lmangani
Copy link
Collaborator

@gropaul I see you're in Amsterdam - I got some stickers for you 👇

@NiclasHaderer
Copy link
Collaborator

NiclasHaderer commented Dec 19, 2024

Please don't merge this yet. I think there might be a bug in how the serializer is used. I'll take a look at it the next days


struct ReqStats {
float elapsed_sec;
uint64_t read_bytes;
Copy link
Collaborator

@NiclasHaderer NiclasHaderer Dec 23, 2024

Choose a reason for hiding this comment

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

Do we perhaps want to remove read_bytes and read_rows until they are used @lmangani ? Otherwise people will just be confused

Copy link
Collaborator

@lmangani lmangani Dec 23, 2024

Choose a reason for hiding this comment

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

FYI read_bytes and read_rows are only used by the UI to display the results and emulate Clickhouse query stats

Copy link
Collaborator

Choose a reason for hiding this comment

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

But aren't hey always 0?

Copy link
Collaborator

Choose a reason for hiding this comment

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

They shouldn't be when using the JSONCompact format but I'll re-check

@NiclasHaderer
Copy link
Collaborator

I moved the formatting configuration up to the root level mirroring duckdb/extension-template#101, so make format works now and the IDE correctly picks up on the correct (or at least in sync with DuckDB) style guidelines.

Should I submit a separate PR applying the DuckDB formatting guidelines to the repo? That way people can use the formatter without having to worry about a big unrelated git diff

@gropaul
Copy link
Collaborator Author

gropaul commented Dec 23, 2024

A this is awesome @NiclasHaderer thank you!

@lmangani
Copy link
Collaborator

@gropaul @NiclasHaderer thank you both for this marvelous opensource christmas present!
Let me know when its ready to merge and I'll queue a new release version

@NiclasHaderer
Copy link
Collaborator

I think it's ready. However I'm still convinced that the read bytes are set.
This is however not a regression introduced by this PR

@lmangani lmangani merged commit 8015a57 into quackscience:main Dec 23, 2024
36 checks passed
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.

3 participants