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

Parse many strings as InlineStrings #231

Open
oxinabox opened this issue Oct 5, 2021 · 3 comments
Open

Parse many strings as InlineStrings #231

oxinabox opened this issue Oct 5, 2021 · 3 comments

Comments

@oxinabox
Copy link

oxinabox commented Oct 5, 2021

We should match the logic that CSV.jl and Arrow.jl use to decide if they are making Strings or InlineStrings.
Once we have JuliaStrings/InlineStrings.jl#8
it should be as fast, or faster (since no allocations) to do this.

Looking at parse.jl I don't think the change would be too hard.

It would want benchmarking; but I have high hopes.

(Related #207)

@iamed2
Copy link
Owner

iamed2 commented Oct 5, 2021

Should this just replace #207? Were you thinking of also applying this to variable-length string columns?

@oxinabox
Copy link
Author

oxinabox commented Oct 5, 2021

Yes this one is about variables length string columns if it is good for Arrow/CSV it is good enough for us IMO.
It's a much more practical concern since those varchar is actually commonly used

OTOH #207 is only about fixed size strings, which has a even stronger argument for it, since we know the size in advance.

The same PR might close both at once though

@iamed2
Copy link
Owner

iamed2 commented Oct 6, 2021

LibPQ currently does not consider columns as a whole for parsing. CSV does. Without a large refactor, LibPQ will then not have a consistent type for the column, preventing the strings from being inlined (the whole point of InlineStrings). It's easy to add the option to parse the strings like this, or with a specific InlineString type with a specific size, though.

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

No branches or pull requests

2 participants