-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure serializing Arrow.DictEncoded writes dictionary messages (#149)
Fixes #126. The issue here was when `Arrow.write` was faced with the task of serializing an `Arrow.DictEncoded`. For most arrow array types, if the input array is already an arrow array type, it's a no-op (e.g. if you're writing out an `Arrow.Table`). The problem comes from `Arrow.DictEncoded`, where there is still no conversion required, but we do need to make a note of the dict encoded column to ensure a dictionary message is written before the record batch. In addition, we also add some code for handling delta dictionary messages if required from multiple record batches that contain `Arrow.DictEncoded`s, which is a valid use-case where you may have multiple arrow files, with the same schema, that you wish to serialize as a single arrow file w/ each file as a separate record batch. Slightly unrelated, but there's also a fix here in our use of Lockable. We actually had a race condition I ran into once where the locking was on the Lockable object, but inside the locked region, we replaced the entire Lockable instead of the _contents_ of the Lockable. This meant anyone who started waiting on the Lockable's lock didn't see updates when unlocked because the entire Lockable had been updated.
- Loading branch information
Showing
4 changed files
with
62 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters