Skip to content

ARROW-491: [Format / C++] Add FixedWidthBinary type to format, C++ implementation - #379

Closed
wesm wants to merge 11 commits into
apache:masterfrom
wesm:ARROW-491
Closed

wesm wants to merge 11 commits into
apache:masterfrom
wesm:ARROW-491

Conversation

@wesm

@wesm wesm commented Mar 14, 2017 •

Copy link
Copy Markdown
Member

I have a bunch more work to do on the C++ implementation:

  • Test builder class
  • Test array API (slice, etc.)
  • Implement/test ArrayEquals/ArrayRangeEquals
  • Implement PrettyPrint (may want to encode to hexadecimal, I don't think that BinaryArray prints properly right now for non-ASCII/UTF8 data)
  • Add IPC roundtrip tests

In the meantime, @julienledem @nongli or others could you look at the changes to the format Flatbuffers and let me know if that looks right to you? Thanks

wesm added 5 commits March 13, 2017 20:13
Change-Id: I177d2b5ff3d764cc7672b89c1c8cf4716a575d77
Change-Id: I43d99c0b81e814dd0cfb6ec0afbdc2295c55caeb
Change-Id: I9f72a688bbdfa23de44c0deaac42b41dc4214e87
Change-Id: Iab093505b7027208da79e4319bb44004c8502188
Change-Id: I39461a833115a42e5157835e72bba0c28328bb57
@nongli

nongli commented Mar 14, 2017

Copy link
Copy Markdown
Contributor

flatbuf changes look simple enough and good with me.

wesm added 5 commits March 14, 2017 23:37
Change-Id: I9eedf33823d3d13dfa099e1b64737b6ba9dee0a5
Change-Id: I93f246642778d946c00e9771033f29ee909a1052
Change-Id: I7cb6a7f5d4ec369b96cd75f57f972f8567be4b1a
…xedWidthBinary

Change-Id: I1a89e518d6d990b305943a18ee78d08ef813e71d
…r FW binary

Change-Id: I70aa0a2cd36f9a7cea107d848340b335a5258676
@wesm

wesm commented Mar 15, 2017

Copy link
Copy Markdown
Member Author

OK, this is ready for review

@wesm wesm changed the title WIP ARROW-491: [Format / C++] Add FixedWidthBinary type to format, C++ implementation ARROW-491: [Format / C++] Add FixedWidthBinary type to format, C++ implementation Mar 15, 2017

@xhochy xhochy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM except that I don't understand how the bitsetting changed. I fail to see a different bahaviour.

Comment thread cpp/src/arrow/builder.cc
uint8_t bitset = null_bitmap_data_[byte_offset];

for (int64_t i = 0; i < length; ++i) {
if (bit_offset == 8) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you give me a hint what the difference in behaviour is?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

When the length is a power of 2, on the last iteration of the loop, a value past the end of the null bitmap is accessed, causing valgrind to complain. I only stumbled on this by accident by using 4096 as the length in my test case

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This moves the bit_offset++ after this if block

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, now I get it :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Might want to look at other places where this fast-bitsetting logic exists to see if there might be an inappropriate memory access

…n Windows causes a compilation failure

Change-Id: I79ab0f7b3e77332b9bad2fe10eee132101417428
@wesm

wesm commented Mar 15, 2017

Copy link
Copy Markdown
Member Author

green build: https://travis-ci.org/wesm/arrow, except for the stalled OS X build because this isn't rebased on the nomkl patch

@asfgit asfgit closed this in c8d15d4 Mar 15, 2017
@wesm
wesm deleted the ARROW-491 branch March 15, 2017 15:22

@julienledem julienledem left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

from the metadata perspective, this looks good to me.

Comment thread format/Message.fbs
table FixedWidthBinary {
/// Number of bytes per value
byteWidth: int;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

do we want an equivalent FixedWidthUtf8?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Utf8 code points use a variable number of bytes (1 to 4), so to fully account for fixed width unicode, you would have to store (N code points) * 4 bytes. This is likely to be wasteful compared with the current list-like / variable-length UTF8 representation

wesm added a commit to wesm/arrow that referenced this pull request Sep 8, 2018
Also fixes a number of Clang warnings and uses of deprecated API calls as of Arrow 0.6.0

Author: Wes McKinney <wes.mckinney@twosigma.com>

Closes apache#379 from wesm/PARQUET-1072 and squashes the following commits:

1ecd4cd [Wes McKinney] Also set ARROW_NO_DEPRECATED_API for static build
4a09e61 [Wes McKinney] Upgrade Snappy in MSVC toolchain build to 1.1.6
7dd8242 [Wes McKinney] Add entry to Travis CI to build with deprecated APIs, too
c70e1bd [Wes McKinney] Skip coverage until fixed later
188100a [Wes McKinney] Build with ARROW_NO_DEPRECATED_API in Travis CI

Change-Id: I2050887ea691daf13d13b09c000f951564c185f7
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.

4 participants