KevinyhZou opened a new issue, #6042: URL: https://github.com/apache/incubator-gluten/issues/6042
### Backend CH (ClickHouse) ### Bug description if Function sparkToDate/sparkToDateTime execute by `Short Circuit`, then the result type of `executeImpl` is the type of its arguments, not created by its own `getReturnTypeImpl`, so if we check whether it is nullable ,then exception will be thrown ``` Caused by: org.apache.gluten.exception.GlutenException: Function sparkToDate's return type must be nullable: while executing 'FUNCTION and(greaterOrEquals(broadcast_right_day#303,col_0) :: 4, lessOrEquals(sparkToDate(broadcast_right_day#303),addDays(sparkToDate(col_0),29_4)) :: 2) -> and(greaterOrEquals(broadcast_right_day#303,col_0),lessOrEquals(sparkToDate(broadcast_right_day#303),addDays(sparkToDate(col_0),29_4))) Nullable(UInt8) : 1': While executing JoiningTransform 0. Poco::Exception::Exception(String const&, int) @ 0x0000000012998d19 1. DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0x00000000062736bb 2. DB::Exception::Exception(PreformattedMessage&&, int) @ 0x000000000614418c 3. DB::Exception::Exception<String>(int, FormatStringHelperImpl<std::type_identity<String>::type>, String&&) @ 0x000000000615154b 4. local_engine::FunctionGetDateData<false, true, int>::executeImpl(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long) const @ 0x00000000127de43f 5. DB::FunctionToExecutableFunctionAdaptor::executeImpl(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long) const @ 0x0000000008a3f2da 6. DB::IExecutableFunction::executeWithoutLowCardinalityColumns(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long, bool) const @ 0x000000000d7aa8e5 7. DB::IExecutableFunction::defaultImplementationForNulls(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long, bool) const @ 0x000000000d7aabe9 8. DB::IExecutableFunction::executeWithoutLowCardinalityColumns(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long, bool) const @ 0x000000000d7aa89d 9. DB::IExecutableFunction::executeWithoutSparseColumns(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long, bool) const @ 0x000000000d7ab2af 10. DB::IExecutableFunction::execute(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long, bool) const @ 0x000000000d7ac5d9 11. DB::IFunctionBase::execute(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long, bool) const @ 0x000000000813f039 12. DB::ColumnFunction::reduce() const @ 0x000000000f3143ab 13. DB::ColumnFunction::reduce() const @ 0x000000000f3141c5 14. DB::maskedExecute(DB::ColumnWithTypeAndName&, DB::PODArray<char8_t, 4096ul, Allocator<false, false>, 63ul, 64ul> const&, DB::MaskInfo const&) @ 0x000000000f576283 15. DB::FunctionsLogicalDetail::FunctionAnyArityLogical<DB::FunctionsLogicalDetail::AndImpl, DB::NameAnd>::executeShortCircuit(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>>&, std::shared_ptr<DB::IDataType const> const&) const @ 0x000000000d7e59e9 16. DB::FunctionsLogicalDetail::FunctionAnyArityLogical<DB::FunctionsLogicalDetail::AndImpl, DB::NameAnd>::executeImpl(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long) const @ 0x000000000d7db9ea 17. DB::FunctionToExecutableFunctionAdaptor::executeImpl(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long) const @ 0x0000000008a3f2da 18. DB::IExecutableFunction::executeWithoutLowCardinalityColumns(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long, bool) const @ 0x000000000d7aa8e5 19. DB::IExecutableFunction::executeWithoutSparseColumns(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long, bool) const @ 0x000000000d7ab2af 20. DB::IExecutableFunction::execute(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long, bool) const @ 0x000000000d7ac5d9 21. DB::ExpressionActions::execute(DB::Block&, unsigned long&, bool, bool) const @ 0x000000000e7c1d5a 22. DB::ExpressionActions::execute(DB::Block&, bool, bool) const @ 0x000000000e7c2e3f ``` ### Spark version Spark-3.3.x ### Spark configurations _No response_ ### System information _No response_ ### Relevant logs _No response_ -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
