You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/07/18 10:50:14 UTC

[GitHub] [arrow] jpedroantunes opened a new pull request #10742: ARROW-13375: [C++][Gandiva] Implement POSITIVE and NEGATIVE Hive functions on Gandiva

jpedroantunes opened a new pull request #10742:
URL: https://github.com/apache/arrow/pull/10742


    Implement POSITIVE and NEGATIVE Hive functions on Gandiva


-- 
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: github-unsubscribe@arrow.apache.org

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



[GitHub] [arrow] ursabot edited a comment on pull request #10742: ARROW-13375: [C++][Gandiva] Implement POSITIVE and NEGATIVE Hive functions on Gandiva

Posted by GitBox <gi...@apache.org>.
ursabot edited a comment on pull request #10742:
URL: https://github.com/apache/arrow/pull/10742#issuecomment-1030759622


   Benchmark runs are scheduled for baseline = 51046e664418cebb6888f6c3302d69e98ffc4c68 and contender = dc2f678797d70ce990d4d73551ee573965dd38aa. dc2f678797d70ce990d4d73551ee573965dd38aa is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
   Conbench compare runs links:
   [Finished :arrow_down:0.0% :arrow_up:0.0%] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/695e2ec708a845f2a0b86f229bacce4e...836a68819ff04906aee38b9682b14b6b/)
   [Scheduled] [test-mac-arm](https://conbench.ursa.dev/compare/runs/d0661eb0a7ca4527ba4686e893fe7e11...831d33894b7c4fbe9bdd3e6280f8f598/)
   [Scheduled] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/90ae5c1fcf1f4a7486bb283c227c147f...3e9c56818333433b8110c7aa27b0ac71/)
   [Scheduled] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/958ef137cab444e2943a14b7a77dd85b...e04f45a7bd974c39b3a3b2ad6f441d3c/)
   Supported benchmarks:
   ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python. Runs only benchmarks with cloud = True
   test-mac-arm: Supported benchmark langs: C++, Python, R
   ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
   ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java
   


-- 
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: github-unsubscribe@arrow.apache.org

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



[GitHub] [arrow] pravindra closed pull request #10742: ARROW-13375: [C++][Gandiva] Implement POSITIVE and NEGATIVE Hive functions on Gandiva

Posted by GitBox <gi...@apache.org>.
pravindra closed pull request #10742:
URL: https://github.com/apache/arrow/pull/10742


   


-- 
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: github-unsubscribe@arrow.apache.org

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



[GitHub] [arrow] ursabot edited a comment on pull request #10742: ARROW-13375: [C++][Gandiva] Implement POSITIVE and NEGATIVE Hive functions on Gandiva

Posted by GitBox <gi...@apache.org>.
ursabot edited a comment on pull request #10742:
URL: https://github.com/apache/arrow/pull/10742#issuecomment-1030759622


   Benchmark runs are scheduled for baseline = 51046e664418cebb6888f6c3302d69e98ffc4c68 and contender = dc2f678797d70ce990d4d73551ee573965dd38aa. dc2f678797d70ce990d4d73551ee573965dd38aa is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
   Conbench compare runs links:
   [Finished :arrow_down:0.0% :arrow_up:0.0%] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/695e2ec708a845f2a0b86f229bacce4e...836a68819ff04906aee38b9682b14b6b/)
   [Scheduled] [test-mac-arm](https://conbench.ursa.dev/compare/runs/d0661eb0a7ca4527ba4686e893fe7e11...831d33894b7c4fbe9bdd3e6280f8f598/)
   [Scheduled] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/90ae5c1fcf1f4a7486bb283c227c147f...3e9c56818333433b8110c7aa27b0ac71/)
   [Finished :arrow_down:0.09% :arrow_up:0.04%] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/958ef137cab444e2943a14b7a77dd85b...e04f45a7bd974c39b3a3b2ad6f441d3c/)
   Supported benchmarks:
   ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python. Runs only benchmarks with cloud = True
   test-mac-arm: Supported benchmark langs: C++, Python, R
   ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
   ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java
   


-- 
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: github-unsubscribe@arrow.apache.org

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



[GitHub] [arrow] github-actions[bot] commented on pull request #10742: ARROW-13375: [C++][Gandiva] Implement POSITIVE and NEGATIVE Hive functions on Gandiva

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #10742:
URL: https://github.com/apache/arrow/pull/10742#issuecomment-882037086


   https://issues.apache.org/jira/browse/ARROW-13375


-- 
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: github-unsubscribe@arrow.apache.org

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



[GitHub] [arrow] ursabot edited a comment on pull request #10742: ARROW-13375: [C++][Gandiva] Implement POSITIVE and NEGATIVE Hive functions on Gandiva

Posted by GitBox <gi...@apache.org>.
ursabot edited a comment on pull request #10742:
URL: https://github.com/apache/arrow/pull/10742#issuecomment-1030759622


   Benchmark runs are scheduled for baseline = 51046e664418cebb6888f6c3302d69e98ffc4c68 and contender = dc2f678797d70ce990d4d73551ee573965dd38aa. dc2f678797d70ce990d4d73551ee573965dd38aa is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
   Conbench compare runs links:
   [Finished :arrow_down:0.0% :arrow_up:0.0%] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/695e2ec708a845f2a0b86f229bacce4e...836a68819ff04906aee38b9682b14b6b/)
   [Finished :arrow_down:0.85% :arrow_up:0.3%] [test-mac-arm](https://conbench.ursa.dev/compare/runs/d0661eb0a7ca4527ba4686e893fe7e11...831d33894b7c4fbe9bdd3e6280f8f598/)
   [Finished :arrow_down:0.36% :arrow_up:0.0%] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/90ae5c1fcf1f4a7486bb283c227c147f...3e9c56818333433b8110c7aa27b0ac71/)
   [Finished :arrow_down:0.09% :arrow_up:0.04%] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/958ef137cab444e2943a14b7a77dd85b...e04f45a7bd974c39b3a3b2ad6f441d3c/)
   Supported benchmarks:
   ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python. Runs only benchmarks with cloud = True
   test-mac-arm: Supported benchmark langs: C++, Python, R
   ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
   ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java
   


-- 
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: github-unsubscribe@arrow.apache.org

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



[GitHub] [arrow] ursabot edited a comment on pull request #10742: ARROW-13375: [C++][Gandiva] Implement POSITIVE and NEGATIVE Hive functions on Gandiva

Posted by GitBox <gi...@apache.org>.
ursabot edited a comment on pull request #10742:
URL: https://github.com/apache/arrow/pull/10742#issuecomment-1030759622


   Benchmark runs are scheduled for baseline = 51046e664418cebb6888f6c3302d69e98ffc4c68 and contender = dc2f678797d70ce990d4d73551ee573965dd38aa. dc2f678797d70ce990d4d73551ee573965dd38aa is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
   Conbench compare runs links:
   [Finished :arrow_down:0.0% :arrow_up:0.0%] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/695e2ec708a845f2a0b86f229bacce4e...836a68819ff04906aee38b9682b14b6b/)
   [Finished :arrow_down:0.85% :arrow_up:0.3%] [test-mac-arm](https://conbench.ursa.dev/compare/runs/d0661eb0a7ca4527ba4686e893fe7e11...831d33894b7c4fbe9bdd3e6280f8f598/)
   [Failed :arrow_down:0.36% :arrow_up:0.0%] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/90ae5c1fcf1f4a7486bb283c227c147f...3e9c56818333433b8110c7aa27b0ac71/)
   [Finished :arrow_down:0.09% :arrow_up:0.04%] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/958ef137cab444e2943a14b7a77dd85b...e04f45a7bd974c39b3a3b2ad6f441d3c/)
   Supported benchmarks:
   ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python. Runs only benchmarks with cloud = True
   test-mac-arm: Supported benchmark langs: C++, Python, R
   ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
   ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java
   


-- 
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: github-unsubscribe@arrow.apache.org

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



[GitHub] [arrow] ursabot commented on pull request #10742: ARROW-13375: [C++][Gandiva] Implement POSITIVE and NEGATIVE Hive functions on Gandiva

Posted by GitBox <gi...@apache.org>.
ursabot commented on pull request #10742:
URL: https://github.com/apache/arrow/pull/10742#issuecomment-1030759622


   Benchmark runs are scheduled for baseline = 51046e664418cebb6888f6c3302d69e98ffc4c68 and contender = dc2f678797d70ce990d4d73551ee573965dd38aa. dc2f678797d70ce990d4d73551ee573965dd38aa is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
   Conbench compare runs links:
   [Scheduled] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/695e2ec708a845f2a0b86f229bacce4e...836a68819ff04906aee38b9682b14b6b/)
   [Scheduled] [test-mac-arm](https://conbench.ursa.dev/compare/runs/d0661eb0a7ca4527ba4686e893fe7e11...831d33894b7c4fbe9bdd3e6280f8f598/)
   [Scheduled] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/90ae5c1fcf1f4a7486bb283c227c147f...3e9c56818333433b8110c7aa27b0ac71/)
   [Scheduled] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/958ef137cab444e2943a14b7a77dd85b...e04f45a7bd974c39b3a3b2ad6f441d3c/)
   Supported benchmarks:
   ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python. Runs only benchmarks with cloud = True
   test-mac-arm: Supported benchmark langs: C++, Python, R
   ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
   ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java
   


-- 
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: github-unsubscribe@arrow.apache.org

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



[GitHub] [arrow] ursabot edited a comment on pull request #10742: ARROW-13375: [C++][Gandiva] Implement POSITIVE and NEGATIVE Hive functions on Gandiva

Posted by GitBox <gi...@apache.org>.
ursabot edited a comment on pull request #10742:
URL: https://github.com/apache/arrow/pull/10742#issuecomment-1030759622


   Benchmark runs are scheduled for baseline = 51046e664418cebb6888f6c3302d69e98ffc4c68 and contender = dc2f678797d70ce990d4d73551ee573965dd38aa. dc2f678797d70ce990d4d73551ee573965dd38aa is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
   Conbench compare runs links:
   [Finished :arrow_down:0.0% :arrow_up:0.0%] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/695e2ec708a845f2a0b86f229bacce4e...836a68819ff04906aee38b9682b14b6b/)
   [Finished :arrow_down:0.85% :arrow_up:0.3%] [test-mac-arm](https://conbench.ursa.dev/compare/runs/d0661eb0a7ca4527ba4686e893fe7e11...831d33894b7c4fbe9bdd3e6280f8f598/)
   [Scheduled] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/90ae5c1fcf1f4a7486bb283c227c147f...3e9c56818333433b8110c7aa27b0ac71/)
   [Finished :arrow_down:0.09% :arrow_up:0.04%] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/958ef137cab444e2943a14b7a77dd85b...e04f45a7bd974c39b3a3b2ad6f441d3c/)
   Supported benchmarks:
   ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python. Runs only benchmarks with cloud = True
   test-mac-arm: Supported benchmark langs: C++, Python, R
   ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
   ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java
   


-- 
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: github-unsubscribe@arrow.apache.org

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



[GitHub] [arrow] ursabot edited a comment on pull request #10742: ARROW-13375: [C++][Gandiva] Implement POSITIVE and NEGATIVE Hive functions on Gandiva

Posted by GitBox <gi...@apache.org>.
ursabot edited a comment on pull request #10742:
URL: https://github.com/apache/arrow/pull/10742#issuecomment-1030759622


   Benchmark runs are scheduled for baseline = 51046e664418cebb6888f6c3302d69e98ffc4c68 and contender = dc2f678797d70ce990d4d73551ee573965dd38aa. dc2f678797d70ce990d4d73551ee573965dd38aa is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
   Conbench compare runs links:
   [Finished :arrow_down:0.0% :arrow_up:0.0%] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/695e2ec708a845f2a0b86f229bacce4e...836a68819ff04906aee38b9682b14b6b/)
   [Finished :arrow_down:0.85% :arrow_up:0.3%] [test-mac-arm](https://conbench.ursa.dev/compare/runs/d0661eb0a7ca4527ba4686e893fe7e11...831d33894b7c4fbe9bdd3e6280f8f598/)
   [Scheduled] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/90ae5c1fcf1f4a7486bb283c227c147f...3e9c56818333433b8110c7aa27b0ac71/)
   [Finished :arrow_down:0.09% :arrow_up:0.04%] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/958ef137cab444e2943a14b7a77dd85b...e04f45a7bd974c39b3a3b2ad6f441d3c/)
   Supported benchmarks:
   ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python. Runs only benchmarks with cloud = True
   test-mac-arm: Supported benchmark langs: C++, Python, R
   ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
   ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java
   


-- 
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: github-unsubscribe@arrow.apache.org

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



[GitHub] [arrow] projjal commented on a change in pull request #10742: ARROW-13375: [C++][Gandiva] Implement POSITIVE and NEGATIVE Hive functions on Gandiva

Posted by GitBox <gi...@apache.org>.
projjal commented on a change in pull request #10742:
URL: https://github.com/apache/arrow/pull/10742#discussion_r704123433



##########
File path: cpp/src/gandiva/precompiled/arithmetic_ops.cc
##########
@@ -208,6 +208,22 @@ NUMERIC_FUNCTION(DIVIDE)
 
 #undef DIVIDE
 
+#define POSITIVE(TYPE) \
+  FORCE_INLINE         \
+  gdv_##TYPE positive_##TYPE(gdv_##TYPE in) { return static_cast<gdv_##TYPE>(in); }
+
+NUMERIC_FUNCTION(POSITIVE)
+
+#undef POSITIVE
+
+#define NEGATIVE(TYPE) \
+  FORCE_INLINE         \
+  gdv_##TYPE negative_##TYPE(gdv_##TYPE in) { return static_cast<gdv_##TYPE>(-1 * in); }

Review comment:
       @jpedroantunes Can you address this? -1 * INT_MIN will cause overflow




-- 
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: github-unsubscribe@arrow.apache.org

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



[GitHub] [arrow] anthonylouisbsb commented on pull request #10742: ARROW-13375: [C++][Gandiva] Implement POSITIVE and NEGATIVE Hive functions on Gandiva

Posted by GitBox <gi...@apache.org>.
anthonylouisbsb commented on pull request #10742:
URL: https://github.com/apache/arrow/pull/10742#issuecomment-979439138


   @projjal can you review this function again? I applied the suggestions and I considered the case where occurs overflow.


-- 
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: github-unsubscribe@arrow.apache.org

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



[GitHub] [arrow] projjal commented on a change in pull request #10742: ARROW-13375: [C++][Gandiva] Implement POSITIVE and NEGATIVE Hive functions on Gandiva

Posted by GitBox <gi...@apache.org>.
projjal commented on a change in pull request #10742:
URL: https://github.com/apache/arrow/pull/10742#discussion_r766237068



##########
File path: cpp/src/gandiva/gdv_function_stubs.cc
##########
@@ -892,6 +892,28 @@ const char* gdv_fn_aes_decrypt(int64_t context, const char* data, int32_t data_l
 
   return ret;
 }
+
+// Expand inner macro for all integer types.
+#define NEGATIVE_FN_INTEGER_PARAMS(INNER) \

Review comment:
       why not include them in the precompiled code




-- 
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: github-unsubscribe@arrow.apache.org

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



[GitHub] [arrow] anthonylouisbsb commented on a change in pull request #10742: ARROW-13375: [C++][Gandiva] Implement POSITIVE and NEGATIVE Hive functions on Gandiva

Posted by GitBox <gi...@apache.org>.
anthonylouisbsb commented on a change in pull request #10742:
URL: https://github.com/apache/arrow/pull/10742#discussion_r674369764



##########
File path: cpp/src/gandiva/precompiled/arithmetic_ops.cc
##########
@@ -208,6 +208,22 @@ NUMERIC_FUNCTION(DIVIDE)
 
 #undef DIVIDE
 
+#define POSITIVE(TYPE) \
+  FORCE_INLINE         \
+  gdv_##TYPE positive_##TYPE(gdv_##TYPE in) { return static_cast<gdv_##TYPE>(in); }
+
+NUMERIC_FUNCTION(POSITIVE)
+
+#undef POSITIVE
+
+#define NEGATIVE(TYPE) \
+  FORCE_INLINE         \
+  gdv_##TYPE negative_##TYPE(gdv_##TYPE in) { return static_cast<gdv_##TYPE>(-1 * in); }

Review comment:
       I think is a good idea to add a test using the `MIN` and `MIN - 1` values to see if it is working correctly.

##########
File path: cpp/src/gandiva/precompiled/arithmetic_ops.cc
##########
@@ -208,6 +208,22 @@ NUMERIC_FUNCTION(DIVIDE)
 
 #undef DIVIDE
 
+#define POSITIVE(TYPE) \
+  FORCE_INLINE         \
+  gdv_##TYPE positive_##TYPE(gdv_##TYPE in) { return static_cast<gdv_##TYPE>(in); }
+
+NUMERIC_FUNCTION(POSITIVE)
+
+#undef POSITIVE
+
+#define NEGATIVE(TYPE) \
+  FORCE_INLINE         \
+  gdv_##TYPE negative_##TYPE(gdv_##TYPE in) { return static_cast<gdv_##TYPE>(-1 * in); }

Review comment:
       Check [this line](https://github.com/apache/arrow/blob/848fe4e6032f0291e7174cef5019e48ae2a55f21/cpp/src/gandiva/gdv_function_stubs.cc#L776) with the implementation of the ABS function.
   
   You need to take care if the input value is equals to the MIN value for an integer, because when converting to positive you cause loss of digits

##########
File path: cpp/src/gandiva/precompiled/arithmetic_ops.cc
##########
@@ -208,6 +208,22 @@ NUMERIC_FUNCTION(DIVIDE)
 
 #undef DIVIDE
 
+#define POSITIVE(TYPE) \
+  FORCE_INLINE         \
+  gdv_##TYPE positive_##TYPE(gdv_##TYPE in) { return static_cast<gdv_##TYPE>(in); }

Review comment:
       Since you are casting to the same type, I think you can just return the input number, right?




-- 
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: github-unsubscribe@arrow.apache.org

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