You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@orc.apache.org by GitBox <gi...@apache.org> on 2022/11/23 03:50:54 UTC

[GitHub] [orc] luffy-zh opened a new pull request, #1323: ORC-1315:[C++] Fix byte to integer conversions fail on platforms with…

luffy-zh opened a new pull request, #1323:
URL: https://github.com/apache/orc/pull/1323

   … unsigned char type.
   
   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. File a JIRA issue first and use it as a prefix of your PR title, e.g., `ORC-001: Fix ABC`.
     2. Use your PR title to summarize what this PR proposes instead of describing the problem.
     3. Make PR title and description complete because these will be the permanent commit log.
     4. If possible, provide a concise and reproducible example to reproduce the issue for a faster review.
     5. If the PR is unfinished, use GitHub PR Draft feature.
   -->
   
   ### What changes were proposed in this pull request?
   <!--
   Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue. 
   If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
     1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
     2. If there is a discussion in the mailing list, please add the link.
   -->
   This patch adds static_cast for the char type cast in RLE/ColumnReader.
   
   ### Why are the changes needed?
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   For the context of [ORC-1315](https://issues.apache.org/jira/browse/ORC-1315), this patch fixes signed char to unsigned char conversions fail where char is by default unsigned.
   
   ### How was this patch tested?
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   -->
   No new tests were added.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@orc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [orc] wgtmac merged pull request #1323: ORC-1315:[C++] Fix byte to integer conversions fail on platforms with unsigned char type

Posted by GitBox <gi...@apache.org>.
wgtmac merged PR #1323:
URL: https://github.com/apache/orc/pull/1323


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@orc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [orc] wgtmac commented on a diff in pull request #1323: ORC-1315:[C++] Fix byte to integer conversions fail on platforms with unsigned char type

Posted by GitBox <gi...@apache.org>.
wgtmac commented on code in PR #1323:
URL: https://github.com/apache/orc/pull/1323#discussion_r1031009829


##########
c++/src/ByteRLE.cc:
##########
@@ -354,7 +354,7 @@ namespace orc {
     if (bufferStart == bufferEnd) {
       nextBuffer();
     }
-    return *(bufferStart++);
+    return static_cast<signed char>(*(bufferStart++));

Review Comment:
   How about changing the return type from `signed char` to `int8_t`? But this may introduce a larger change.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@orc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [orc] wgtmac commented on pull request #1323: ORC-1315:[C++] Fix byte to integer conversions fail on platforms with unsigned char type

Posted by GitBox <gi...@apache.org>.
wgtmac commented on PR #1323:
URL: https://github.com/apache/orc/pull/1323#issuecomment-1325880114

   > 
   
   I believe we need to port to 1.8.1.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@orc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [orc] dongjoon-hyun commented on pull request #1323: ORC-1315:[C++] Fix byte to integer conversions fail on platforms with unsigned char type

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on PR #1323:
URL: https://github.com/apache/orc/pull/1323#issuecomment-1330169424

   Sorry, I was confused. I found your comment, https://github.com/apache/orc/issues/1318#issuecomment-1328183678
   > I can confirm that this issue only exists in the main branch, therefore we don't need backport the fix to branch-1.8.
   
   I'll change the milestone of this PR.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@orc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [orc] dongjoon-hyun commented on pull request #1323: ORC-1315:[C++] Fix byte to integer conversions fail on platforms with unsigned char type

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on PR #1323:
URL: https://github.com/apache/orc/pull/1323#issuecomment-1330140440

   Hi, @wgtmac . Is there a reason why this is not backported to `branch-1.8`?
   > I believe we need to port to 1.8.1. @dongjoon-hyun
   
   And, do we need 2 patches to be complete for ORC-1315?
   ```
   $ git log --oneline main | grep ORC-1315
   91ded769 ORC-1315: [C++] Fix test failure when unsigned char is in effect
   acb8d6ca ORC-1315: [C++] Fix byte to integer conversion failure on platforms with unsigned char type
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@orc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [orc] coderex2522 commented on a diff in pull request #1323: ORC-1315:[C++] Fix byte to integer conversions fail on platforms with unsigned char type

Posted by GitBox <gi...@apache.org>.
coderex2522 commented on code in PR #1323:
URL: https://github.com/apache/orc/pull/1323#discussion_r1031020838


##########
c++/src/ColumnReader.cc:
##########
@@ -129,7 +129,7 @@ namespace orc {
       return;
     }
     for (size_t i = numValues - 1; i < numValues; --i) {

Review Comment:
   The line should be optimized. It looks a bit confusing.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@orc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [orc] coderex2522 commented on a diff in pull request #1323: ORC-1315:[C++] Fix byte to integer conversions fail on platforms with unsigned char type

Posted by GitBox <gi...@apache.org>.
coderex2522 commented on code in PR #1323:
URL: https://github.com/apache/orc/pull/1323#discussion_r1031018395


##########
c++/src/ColumnReader.cc:
##########
@@ -129,7 +129,7 @@ namespace orc {
       return;
     }
     for (size_t i = numValues - 1; i < numValues; --i) {

Review Comment:
   Very poor readability of code logic. The line should be optimized.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@orc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [orc] dongjoon-hyun commented on a diff in pull request #1323: ORC-1315:[C++] Fix byte to integer conversions fail on platforms with unsigned char type

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on code in PR #1323:
URL: https://github.com/apache/orc/pull/1323#discussion_r1030845066


##########
c++/src/ByteRLE.cc:
##########
@@ -354,7 +354,7 @@ namespace orc {
     if (bufferStart == bufferEnd) {
       nextBuffer();
     }
-    return *(bufferStart++);
+    return static_cast<signed char>(*(bufferStart++));

Review Comment:
   Unlike the other places, this is `static_cast<signed char>`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@orc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [orc] dongjoon-hyun commented on pull request #1323: ORC-1315:[C++] Fix byte to integer conversions fail on platforms with unsigned char type

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on PR #1323:
URL: https://github.com/apache/orc/pull/1323#issuecomment-1325880649

   Got it. Thanks, @wgtmac .


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@orc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [orc] luffy-zh commented on a diff in pull request #1323: ORC-1315:[C++] Fix byte to integer conversions fail on platforms with unsigned char type

Posted by GitBox <gi...@apache.org>.
luffy-zh commented on code in PR #1323:
URL: https://github.com/apache/orc/pull/1323#discussion_r1030996352


##########
c++/src/ByteRLE.cc:
##########
@@ -354,7 +354,7 @@ namespace orc {
     if (bufferStart == bufferEnd) {
       nextBuffer();
     }
-    return *(bufferStart++);
+    return static_cast<signed char>(*(bufferStart++));

Review Comment:
   ByteRleDecoderImpl::readByte requires the signed char,  also see line 362.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@orc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org