Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[nereids](datetime) fix wrong result type of datetime add with interv…
…al as first arg (apache#26957) Incorrect result data type cause be cordump: drop table if exists testaaa; create table testaaa(k1 tinyint, k2 smallint, k3 int, k4 bigint, k5 decimal(9,3), k6 char(5), k10 date, k11 datetime, k7 varchar(20), k8 double max, k9 float sum) engine=olap distributed by hash(k1) buckets 5 properties("storage_type"="column","replication_num"="1") ; insert into testaaa values(1,1,1,1,9.3, "k6", "2023-11-14", "2023-11-14", "k7", 9.99, 9.99); select interval 10 year + k10 from testaaa; The plan result type is DATE: mysql [test]>explain verbose select interval 10 year + k10 from testaaa; +-------------------------------------------------------------------------------------------------------+ | Explain String(Nereids Planner) | +-------------------------------------------------------------------------------------------------------+ | PLAN FRAGMENT 0 | | OUTPUT EXPRS: | | years_add(k10, INTERVAL 10 YEAR)[apache#11] | | PARTITION: UNPARTITIONED | | | | HAS_COLO_PLAN_NODE: false | | | | VRESULT SINK | | MYSQL_PROTOCAL | | | | 64:VEXCHANGE | | offset: 0 | | tuple ids: 1N | | | | PLAN FRAGMENT 1 | | | | PARTITION: HASH_PARTITIONED: k1[#0] | | | | HAS_COLO_PLAN_NODE: false | | | | STREAM DATA SINK | | EXCHANGE ID: 64 | | UNPARTITIONED | | | | 58:VOlapScanNode | | TABLE: default_cluster:test.testaaa(testaaa), PREAGGREGATION: OFF. Reason: No aggregate on scan. | | partitions=1/1 (testaaa), tablets=5/5, tabletList=945025,945027,945029 ... | | cardinality=1, avgRowSize=9885.0, numNodes=1 | | pushAggOp=NONE | | projections: years_add(k10[apache#6], INTERVAL 10 YEAR) | | project output tuple id: 1 | | tuple ids: 0 | | | | Tuples: | | TupleDescriptor{id=0, tbl=testaaa, byteSize=8} | | SlotDescriptor{id=6, col=k10, colUniqueId=6, type=DATEV2, nullable=true, isAutoIncrement=false} | | | | TupleDescriptor{id=1, tbl=testaaa, byteSize=32} | | SlotDescriptor{id=11, col=null, colUniqueId=null, type=DATE, nullable=true, isAutoIncrement=false} | +-------------------------------------------------------------------------------------------------------+ 39 rows in set (1 min 31.50 sec) coredump stack: F1109 20:11:37.677680 323805 assert_cast.h:61] Bad cast from type:doris::vectorized::ColumnVector to doris::vectorized::ColumnVector *** Check failure stack trace: *** F1109 20:11:37.680608 323800 assert_cast.h:61] Bad cast from type:doris::vectorized::ColumnVector to doris::vectorized::ColumnVector *** Check failure stack trace: *** F1109 20:11:37.680608 323800 assert_cast.h:61] Bad cast from type:doris::vectorized::ColumnVector to doris::vectorized::ColumnVectorF1109 20:11:37.681102 323808 assert_cast.h:61] Bad cast from type:doris::vectorized::ColumnVector to doris::vectorized::ColumnVector *** Check failure stack trace: *** @ 0x56489d591d3d google::LogMessage::Fail() @ 0x56489d591d3d google::LogMessage::Fail() @ 0x56489d591d3d google::LogMessage::Fail() @ 0x56489d594279 google::LogMessage::SendToLog() @ 0x56489d594279 google::LogMessage::SendToLog() @ 0x56489d594279 google::LogMessage::SendToLog() @ 0x56489d5918a6 google::LogMessage::Flush() @ 0x56489d5918a6 google::LogMessage::Flush() @ 0x56489d5918a6 google::LogMessage::Flush() @ 0x56489d5948e9 google::LogMessageFatal::~LogMessageFatal() @ 0x56489d5948e9 google::LogMessageFatal::~LogMessageFatal() @ 0x56489d5948e9 google::LogMessageFatal::~LogMessageFatal() @ 0x56487a2a8a0c assert_cast<>() @ 0x56487a2a8a0c assert_cast<>() @ 0x56487a2a8a0c assert_cast<>() @ 0x5648893d8312 doris::vectorized::ColumnVector<>::insert_range_from() @ 0x5648893d8312 doris::vectorized::ColumnVector<>::insert_range_from() @ 0x5648893d8312 doris::vectorized::ColumnVector<>::insert_range_from() @ 0x56488924a670 doris::vectorized::ColumnNullable::insert_range_from() @ 0x56488924a670 doris::vectorized::ColumnNullable::insert_range_from() @ 0x56488924a670 doris::vectorized::ColumnNullable::insert_range_from() @ 0x56487a454475 doris::ExecNode::do_projections() @ 0x56487a454475 doris::ExecNode::do_projections() @ 0x56487a454475 doris::ExecNode::do_projections() @ 0x56487a454b89 doris::ExecNode::get_next_after_projects() @ 0x56487a454b89 doris::ExecNode::get_next_after_projects() *** Query id: a467995b35334741-b625042f56495aaf *** *** tablet id: 0 *** *** Aborted at 1699531898 (unix time) try "date -d @1699531898" if you are using GNU date *** *** Current BE git commitID: 0d83327 *** *** SIGABRT unknown detail explain (@0x190d64) received by PID 1641828 (TID 1642168 OR 0x7f6ff96c0700) from PID 1641828; stack trace: *** @ 0x556ca2a3ab8f std::_Function_handler<>::_M_invoke() @ 0x556c9f322787 std::function<>::operator()() @ 0x556ca29da0b0 doris::Thread::supervise_thread() @ 0x556c9f322787 std::function<>::operator()() @ 0x7f71b9c38609 start_thread @ 0x556ca29da0b0 doris::Thread::supervise_thread() @ 0x7f71b9c38609 start_thread 0# doris::signal::(anonymous namespace)::FailureSignalHandler(int, siginfo_t*, void*) at /home/zcp/repo_center/doris_branch-2.0/doris/be/src/common/signal_handler.h:417 1# 0x00007F71B9E09090 in /lib/x86_64-linux-gnu/libc.so.6 2# raise at ../sysdeps/unix/sysv/linux/raise.c:51 3# abort at /build/glibc-SzIz7B/glibc-2.31/stdlib/abort.c:81 4# 0x0000556CC51F3729 in /mnt/hdd01/ci/branch20-deploy/be/lib/doris_be 5# 0x0000556CC51E8D3D in /mnt/hdd01/ci/branch20-deploy/be/lib/doris_be 6# google::LogMessage::SendToLog() in /mnt/hdd01/ci/branch20-deploy/be/lib/doris_be 7# google::LogMessage::Flush() in /mnt/hdd01/ci/branch20-deploy/be/lib/doris_be 8# google::LogMessageFatal::~LogMessageFatal() in /mnt/hdd01/ci/branch20-deploy/be/lib/doris_be 9# doris::vectorized::ColumnVector const& assert_cast const&, doris::vectorized::IColumn const&>(doris::vectorized::IColumn const&) in /mnt/hdd01/ci/branch20-deploy/be/lib/doris_be 10# doris::vectorized::ColumnVector::insert_range_from(doris::vectorized::IColumn const&, unsigned long, unsigned long) at /home/zcp/repo_center/doris_branch-2.0/doris/be/src/vec/columns/column_vector.cpp:354 11# doris::vectorized::ColumnNullable::insert_range_from(doris::vectorized::IColumn const&, unsigned long, unsigned long) at /home/zcp/repo_center/doris_branch-2.0/doris/be/src/vec/columns/column_nullable.cpp:289 12# doris::ExecNode::do_projections(doris::vectorized::Block*, doris::vectorized::Block*) at /home/zcp/repo_center/doris_branch-2.0/doris/be/src/exec/exec_node.cpp:573 13# doris::ExecNode::get_next_after_projects(doris::RuntimeState*, doris::vectorized::Block*, bool*, std::function const&, bool) at /home/zcp/repo_center/doris_branch-2.0/doris/be/src/exec/exec_node.cpp:592 14# doris::pipeline::SourceOperator::get_block(doris::RuntimeState*, doris::vectorized::Block*, doris::pipeline::SourceState&) at /home/zcp/repo_center/doris_branch-2.0/doris/be/src/pipeline/exec/operator.h:413 15# doris::pipeline::PipelineTask::execute(bool*) at /home/zcp/repo_center/doris_branch-2.0/doris/be/src/pipeline/pipeline_task.cpp:259 16# doris::pipeline::TaskScheduler::_do_work(unsigned
- Loading branch information