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

Lazy load base64Binary and hexBinary #930

Open
jsommr opened this issue Mar 1, 2021 · 2 comments
Open

Lazy load base64Binary and hexBinary #930

jsommr opened this issue Mar 1, 2021 · 2 comments
Labels

Comments

@jsommr
Copy link

jsommr commented Mar 1, 2021

A string is required to create one of the binary types. Would it be possible to have a constructor accepting bytes that doesn't set the stringValue before serializing it? This would allow RumbleDB to efficiently deal with intermediate binaries where serializing them isn't necessary (imagine a query that downloads an image and returns what objects are in it as text)

@ghislainfourny
Copy link
Member

Thank you for your comment.

Indeed, some other JSONiq engines do support this kind of lazy loading.

If more functions get added that provide alternative ways to construct hexBinary or base64Binary values (for example, a function that GETs a binary file from HTTP or any other system), there is indeed no reason to materialize the string and of course, Rumble will simply keep the bytes.

Do you have a specific use case in mind, in particular, would you like Rumble to be able to download binary files from the Web or open binary files from any file system?

@jsommr
Copy link
Author

jsommr commented Apr 12, 2021

I was just curious because it seemed easy to implement, and would make sure before I began that I hadn't missed something. We've put Spark on hold for now, so this issue can be closed unless it makes sense to keep it open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants