kou commented on code in PR #46709:
URL: https://github.com/apache/arrow/pull/46709#discussion_r2134962504
##########
cpp/src/gandiva/tests/decimal_test.cc:
##########
@@ -1237,4 +1237,42 @@ TEST_F(TestDecimal, TestSha) {
EXPECT_NE(value_at_position, response->GetScalar(i -
1).ValueOrDie()->ToString());
}
}
+
+TEST_F(TestDecimal, TestCastDecimalVarCharInvalidInputInvalidOutput) {
+ auto decimal_type_10_0 = std::make_shared<arrow::Decimal128Type>(10, 0);
+ auto decimal_type_38_30 = std::make_shared<arrow::Decimal128Type>(38, 30);
+ auto decimal_type_38_27 = std::make_shared<arrow::Decimal128Type>(38, 27);
+
+ auto field_str = field("in_str", utf8());
+ auto schema = arrow::schema({field_str});
+ auto res_bool = field("res_bool", arrow::boolean());
+
+ auto int_literal = TreeExprBuilder::MakeLiteral((int32_t)100);
+ auto int_literal_multiply = TreeExprBuilder::MakeLiteral((int32_t)10);
+ auto string_literal = TreeExprBuilder::MakeStringLiteral("foo");
+ auto cast_multiply_literal =
+ TreeExprBuilder::MakeFunction("castDECIMAL", {int_literal_multiply},
decimal_type_10_0);
+ auto cast_int_literal =
+ TreeExprBuilder::MakeFunction("castDECIMAL", {int_literal},
decimal_type_38_30);
+ auto cast_string_func =
+ TreeExprBuilder::MakeFunction("castDECIMAL", {string_literal},
decimal_type_38_30);
+ auto multiply_func =
+ TreeExprBuilder::MakeFunction("multiply", {cast_multiply_literal,
cast_int_literal}, decimal_type_38_27);
+ auto equal_func = TreeExprBuilder::MakeFunction("equal", {multiply_func,
cast_string_func}, arrow::boolean());
+ auto expr = TreeExprBuilder::MakeExpression(equal_func, res_bool);
Review Comment:
Hmm. I tried the current changes but it's still SEGV-ed.
I couldn't get backtrace:
```console
$ LD_LIBRARY_PATH=$PWD/cpp.build/debug gdb --args
cpp.build/debug/gandiva-projector-test
--gtest_filter=TestDecimal.TestCastDecimalVarCharInvalidInputInvalidOutput
...
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from TestDecimal
[ RUN ] TestDecimal.TestCastDecimalVarCharInvalidInputInvalidOutput
/home/kou/work/cpp/arrow.kou/cpp/src/gandiva/cache.cc:58: Creating gandiva
cache with capacity of 5000
/home/kou/work/cpp/arrow.kou/cpp/src/gandiva/engine.cc:282: Detected CPU
Name : arrowlake-s
/home/kou/work/cpp/arrow.kou/cpp/src/gandiva/engine.cc:283: Detected CPU
Features: [ +prfchw -cldemote +avx +aes +sahf +pclmul -xop +crc32 +xsaves
-avx512fp16 -usermsr +sm4 -egpr +sse4.1 -avx512ifma +xsave +sse4.2 -tsxldtrk
+sm3 +ptwrite -widekl +invpcid +64bit +xsavec -avx10.1-512 -avx512vpopcntdq
+cmov -avx512vp2intersect -avx512cd +movbe +avxvnniint8 -ccmp -amx-int8 -kl
-avx10.1-256 +sha512 +avxvnni -rtm +adx +avx2 +hreset +movdiri +serialize
+vpclmulqdq -avx512vl +uintr -cf +clflushopt -raoint +cmpccxadd +bmi -amx-tile
+sse +gfni +avxvnniint16 -amx-fp16 -ndd +xsaveopt +rdrnd -avx512f -amx-bf16
-avx512bf16 -avx512vnni -push2pop2 +cx8 -avx512bw +sse3 +pku +fsgsbase -clzero
-mwaitx -lwp +lzcnt +sha +movdir64b -ppx +wbnoinvd -enqcmd +avxneconvert -tbm
-pconfig -amx-complex +ssse3 +cx16 +bmi2 +fma +popcnt +avxifma +f16c
-avx512bitalg -rdpru +clwb +mmx +sse2 +rdseed -avx512vbmi2 -prefetchi +rdpid
-fma4 -avx512vbmi +shstk +vaes +waitpkg -sgx +fxsr -avx512dq -sse4a]
Program received signal SIGSEGV, Segmentation fault.
0x00007fffe5861d6e in ?? ()
(gdb) bt
#0 0x00007fffe5861d6e in ?? ()
#1 0x00007fffffffd770 in ?? ()
#2 0x000055015597d138 in ?? ()
#3 0x4674edea40000000 in ?? ()
#4 0x0000000c9f2c9cd0 in ?? ()
#5 0x85acef8100000000 in ?? ()
#6 0x000004ee2d6d415b in ?? ()
#7 0x00007fffffffd710 in ?? ()
#8 0x0000555555a2a550 in ?? ()
#9 0x0000000000000000 in ?? ()
```
Could you share the backtrace on your environment?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]