Skip to content

Conversation

@maxhora
Copy link
Contributor

@maxhora maxhora commented Mar 28, 2017

Resolve Arrow and Arrow IPC build issues on Windows; Running unit tests in Appveyor.

Changes description:

class MessageImpl;
std::unique_ptr<MessageImpl> impl_;

MSVC compiler requires constructor and destructor of Message class be defined. Currently, they are defined by default, and because of this, compiler places auto generated code into the .hpp file, which is not visible for others libs during the linking (We got unresolved linking issues). The solution is to define destructors explicitly. More there http://stackoverflow.com/a/42158611/2266412 and there http://stackoverflow.com/a/6089065/2266412

Copy link
Member

@wesm wesm left a comment

Choose a reason for hiding this comment

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

See code comments. There are some code formatting issues that would be fixed by clang-format (I think you can get this on Windows: http://llvm.org/builds/), but the make format target only works on Linux/OS X

Copy link
Member

Choose a reason for hiding this comment

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

Is it possible to use the C++11 codecvt header for this? e.g. https://github.com/wesm/feather/blob/master/cpp/src/feather/io.cc#L169

Copy link
Member

Choose a reason for hiding this comment

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

Note that the Google style guide forbids mutable reference arguments: https://google.github.io/styleguide/cppguide.html#Reference_Arguments, so this would need to be std::wstring* result

Copy link
Member

Choose a reason for hiding this comment

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

See Google style guide on variable names https://google.github.io/styleguide/cppguide.html#Variable_Names

Copy link
Member

Choose a reason for hiding this comment

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

Variables name

Copy link
Member

Choose a reason for hiding this comment

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

Was this code copy and pasted from https://msdn.microsoft.com/en-us/library/a9yf33zb.aspx? If so, what is the license? It looks like this is MS Public License, but we need to be sure. In general, if any code is contributed to an ASF project, it must be your original work, otherwise it must be attributed to a source with a compatible license. I might suggest writing a new function here

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

We don't use Hungarian notation (https://google.github.io/styleguide/cppguide.html#Windows_Code), see note below though

Copy link
Member

Choose a reason for hiding this comment

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

Function name

Copy link
Member

Choose a reason for hiding this comment

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

It looks like this code is from StackOverflow: http://stackoverflow.com/a/26914562/776560 -- you cannot use StackOverflow code in ASF projects.

Since we have C++11, I think we should be able to use the locale/codecvt libraries in the STL

@wesm
Copy link
Member

wesm commented Mar 29, 2017

codecvt isn't available in gcc, see https://github.com/wesm/feather/blob/master/cpp/src/feather/io.cc#L81

Copy link
Member

@wesm wesm left a comment

Choose a reason for hiding this comment

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

+1, there's a minor rebase conflict, would you mind rebasing? I'm not sure what to do on the possibility of a UTF16 decoding error, we can either address it in this patch or in a follow up patch -- in the latter case, can you open a JIRA? Thanks!

Copy link
Member

Choose a reason for hiding this comment

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

It seems this can fail either with an std::range_error or a decoding error set in the utf16_converter.state():

https://msdn.microsoft.com/en-us/library/ee191684.aspx#Anchor_5

Might be worth writing a unit test to trigger these cases

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, sure, I will create separate ticket for that. I have seen other places ( https://github.com/apache/arrow/blob/master/cpp/src/arrow/io/file.cc#L134 ) without exception handling. It seems all of them should be covered at once.

Copy link
Member

@wesm wesm left a comment

Choose a reason for hiding this comment

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

+1, merging. thanks @Maxris! The build has passed here https://ci.appveyor.com/project/MaxRisuhin/arrow/build/1.0.23

@asfgit asfgit closed this in 15b874e Mar 30, 2017
wesm pushed a commit to wesm/arrow that referenced this pull request Sep 8, 2018
Author: Antoine Pitrou <antoine@python.org>

Closes apache#449 from pitrou/PARQUET-1071-arrow-filewriter-close-idempotent and squashes the following commits:

8c3fb19 [Antoine Pitrou] PARQUET-1071: Check that arrow::FileWriter::Close() is idempotent

Change-Id: Ie3e34cdf2cd1f095a34ebf89abfb3c951b744c5e
pribor pushed a commit to GlobalWebIndex/arrow that referenced this pull request Oct 24, 2025
Fixes #13.

---------

Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
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.

2 participants