You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ra...@apache.org on 2019/08/02 09:40:42 UTC

[arrow] branch master updated: ARROW-6002: [C++][Gandiva] test casting int64 to decimal

This is an automated email from the ASF dual-hosted git repository.

ravindra pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new 4f520a4  ARROW-6002: [C++][Gandiva] test casting int64 to decimal
4f520a4 is described below

commit 4f520a40f55792705778dd1aed0b31e2cf5fe912
Author: Benjamin Kietzman <be...@gmail.com>
AuthorDate: Fri Aug 2 15:10:17 2019 +0530

    ARROW-6002: [C++][Gandiva] test casting int64 to decimal
    
    copy paste error: float32 was being checked twice, int64 not at all
    
    Closes #4991 from bkietz/6002-Gandiva-TestCastFunctions-does-not-test- and squashes the following commits:
    
    1b94487e8 <Benjamin Kietzman> correct decimal test
    
    Authored-by: Benjamin Kietzman <be...@gmail.com>
    Signed-off-by: Pindikura Ravindra <ra...@dremio.com>
---
 cpp/src/gandiva/tests/decimal_test.cc | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/cpp/src/gandiva/tests/decimal_test.cc b/cpp/src/gandiva/tests/decimal_test.cc
index 7e07c12..a03daaa 100644
--- a/cpp/src/gandiva/tests/decimal_test.cc
+++ b/cpp/src/gandiva/tests/decimal_test.cc
@@ -466,16 +466,14 @@ TEST_F(TestDecimal, TestCastFunctions) {
   DCHECK_OK(status);
 
   // Validate results
+  auto expected_int_dec = MakeArrowArrayDecimal(
+      decimal_type, MakeDecimalVector({"123", "158", "-123", "-158"}, scale), validity);
 
   // castDECIMAL(int32)
-  EXPECT_ARROW_ARRAY_EQUALS(
-      MakeArrowArrayDecimal(decimal_type,
-                            MakeDecimalVector({"123", "158", "-123", "-158"}, scale),
-                            validity),
-      outputs[0]);
+  EXPECT_ARROW_ARRAY_EQUALS(expected_int_dec, outputs[0]);
 
   // castDECIMAL(int64)
-  EXPECT_ARROW_ARRAY_EQUALS(array_dec, outputs[2]);
+  EXPECT_ARROW_ARRAY_EQUALS(expected_int_dec, outputs[1]);
 
   // castDECIMAL(float32)
   EXPECT_ARROW_ARRAY_EQUALS(array_dec, outputs[2]);