-
Notifications
You must be signed in to change notification settings - Fork 409
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix that coalesce mistakenly removed nullable from the result column (#…
- Loading branch information
1 parent
209d49b
commit d7566fe
Showing
3 changed files
with
48 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#include <Interpreters/Context.h> | ||
#include <TestUtils/FunctionTestUtils.h> | ||
#include <TestUtils/TiFlashTestBasic.h> | ||
|
||
#include <string> | ||
#include <vector> | ||
|
||
namespace DB::tests | ||
{ | ||
class CoalesceTest : public DB::tests::FunctionTest | ||
{ | ||
}; | ||
|
||
TEST_F(CoalesceTest, testOnlyNull) | ||
try | ||
{ | ||
const String & func_name = "coalesce"; | ||
|
||
ASSERT_COLUMN_EQ( | ||
createColumn<Nullable<String>>({"a"}), | ||
executeFunction( | ||
func_name, | ||
createColumn<Nullable<String>>({"a"}), | ||
createConstColumn<Nullable<String>>(1, std::nullopt))); | ||
|
||
ASSERT_COLUMN_EQ( | ||
createColumn<Nullable<String>>({"a"}), | ||
executeFunction( | ||
func_name, | ||
createColumn<Nullable<String>>({"a"}), | ||
createOnlyNullColumn(1))); | ||
} | ||
CATCH | ||
} // namespace DB::tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters