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

[C++] Implement cast to Binary and FixedSizeBinary #24240

Closed
asfimport opened this issue Mar 6, 2020 · 5 comments
Closed

[C++] Implement cast to Binary and FixedSizeBinary #24240

asfimport opened this issue Mar 6, 2020 · 5 comments

Comments

@asfimport
Copy link

asfimport commented Mar 6, 2020

It appears you can cast from Binary to String but not the other way.

Reporter: Neal Richardson / @nealrichardson
Assignee: Krisztian Szucs / @kszucs

Related issues:

PRs and other links:

Note: This issue was originally created as ARROW-8025. Please see the migration documentation for further details.

@asfimport
Copy link
Author

@asfimport
Copy link
Author

Krisztian Szucs / @kszucs:
@wesm Cast to and from FixedSizedBinary will involve some more work and I have a couple of questions:

String/Binary to FixedSizedBinary:

  • shall we append values one by one and truncate if necessary

  • or add as zero copy cast and check that the value offsets indicate same width values

  • or both?

    FixedSizedBinary to String/Binary is more straightforward to zero copy cast and generate the offset values, although I'm not how much sense this direction makes.

@asfimport
Copy link
Author

Wes McKinney / @wesm:
I think you can split the FSB work into a separate PR/JIRA.

I would say that when casting from String/Binary to FSB that if a value does not match the byte width then an error should be raised. One issue is that if there are nulls and the nulls are length-0 then zero copy is not possible

If something more nuanced is required later we can pursue it then, this seems like enough for now

Going the other direction as you say is easier

@asfimport
Copy link
Author

Wes McKinney / @wesm:
Issue resolved by pull request 7470
#7470

@asfimport
Copy link
Author

Daniel Nugent / @nugend:
Was there ever a similar issue for the FixedSizeBinary to String cast? It’s nice to have when you want to ensure that single byte records are interpreted as characters.

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

No branches or pull requests

2 participants