-
Notifications
You must be signed in to change notification settings - Fork 409
Closed
Labels
type/enhancementThe issue or PR belongs to an enhancement.The issue or PR belongs to an enhancement.type/testingIssue or PR for testingIssue or PR for testing
Description
Bug Report
Current executor test framework fails to support qualified column reference. ex. "select t.a from t;"
1. Minimal reproduce step (Required)
By writing a gtest case
TEST_F(ExecutorTestRunner, Filter)
try
{
context.addMockTable({"test_db", "test_table"},
{{"s1", TiDB::TP::TypeString}, {"s2", TiDB::TP::TypeString}},
{toNullableVec<String>("s1", {"banana", {}, "banana"}),
toNullableVec<String>("s2", {"apple", {}, "banana"})});
auto request = context
.scan("test_db", "test_table")
.filter(eq(col("test_table.s1"), col("test_table.s2")))
.build(context);
{
ASSERT_COLUMNS_EQ_R(executeStreams(request),
createColumns({toNullableVec<String>({"banana"}),
toNullableVec<String>({"banana"})}));
}
}
CATCH2. What did you expect to see? (Required)
test passed
3. What did you see instead (Required)
program threw exception
Code: 16. DB::Exception: No such column test_table.s1
Stack trace:
0x110e04b00 StackTrace::StackTrace() [gtests_dbms+4497509120]
dbms/src/Common/StackTrace.cpp:23
0x110e04b3c StackTrace::StackTrace() [gtests_dbms+4497509180]
dbms/src/Common/StackTrace.cpp:22
0x104ce5f30 DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) [gtests_dbms+4295008048]
dbms/src/Common/Exception.h:32
0x104ce5088 DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) [gtests_dbms+4295004296]
dbms/src/Common/Exception.h:34
0x10db25a9c DB::(anonymous namespace)::compileExpr(std::__1::vector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, TiDB::ColumnInfo>, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, TiDB::ColumnInfo> > > const&, std::__1::shared_ptr<DB::IAST>) [gtests_dbms+4444166812]
dbms/src/Debug/astToExecutor.cpp:613
0x10db263b8 DB::(anonymous namespace)::compileExpr(std::__1::vector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, TiDB::ColumnInfo>, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, TiDB::ColumnInfo> > > const&, std::__1::shared_ptr<DB::IAST>) [gtests_dbms+4444169144]
dbms/src/Debug/astToExecutor.cpp:731
0x10db254f0 DB::(anonymous namespace)::compileFilter(std::__1::vector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, TiDB::ColumnInfo>, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, TiDB::ColumnInfo> > > const&, std::__1::shared_ptr<DB::IAST>, std::__1::vector<std::__1::shared_ptr<DB::IAST>, std::__1::allocator<std::__1::shared_ptr<DB::IAST> > >&) [gtests_dbms+4444165360]
dbms/src/Debug/astToExecutor.cpp:787
0x10db252cc DB::compileSelection(std::__1::shared_ptr<DB::mock::Executor>, unsigned long&, std::__1::shared_ptr<DB::IAST>) [gtests_dbms+4444164812]
dbms/src/Debug/astToExecutor.cpp:1507
0x106e69c08 DB::tests::DAGRequestBuilder::filter(std::__1::shared_ptr<DB::IAST>) [gtests_dbms+4330150920]
dbms/src/TestUtils/mockExecutor.cpp:174
0x1050463bc DB::tests::ExecutorTestRunner_Filter_Test::TestBody() [gtests_dbms+4298548156]
dbms/src/Flash/tests/gtest_executor.cpp:44
0x10cb78800 void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) [gtests_dbms+4427728896]
contrib/googletest/googletest/src/gtest.cc:2443
0x10cb4d90c void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) [gtests_dbms+4427553036]
contrib/googletest/googletest/src/gtest.cc:2479
0x10cb4d868 testing::Test::Run() [gtests_dbms+4427552872]
contrib/googletest/googletest/src/gtest.cc:2517
0x10cb4e6f0 testing::TestInfo::Run() [gtests_dbms+4427556592]
contrib/googletest/googletest/src/gtest.cc:2693
0x10cb4f404 testing::TestCase::Run() [gtests_dbms+4427559940]
contrib/googletest/googletest/src/gtest.cc:2811
0x10cb58a0c testing::internal::UnitTestImpl::RunAllTests() [gtests_dbms+4427598348]
contrib/googletest/googletest/src/gtest.cc:5177
0x10cb7d3f8 bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) [gtests_dbms+4427748344]
contrib/googletest/googletest/src/gtest.cc:2443
0x10cb5858c bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) [gtests_dbms+4427597196]
contrib/googletest/googletest/src/gtest.cc:2479
0x10cb58484 testing::UnitTest::Run() [gtests_dbms+4427596932]
contrib/googletest/googletest/src/gtest.cc:4786
0x106cfe6e0 RUN_ALL_TESTS() [gtests_dbms+4328662752]
contrib/googletest/googletest/include/gtest/gtest.h:2341
0x106cfe41c main [gtests_dbms+4328662044]
dbms/src/TestUtils/gtests_dbms_main.cpp:77
0x185029430 <unknown symbol> [libdyld.dylib+6445634608]
[ FAILED ] ExecutorTestRunner.Filter (883 ms)
[----------] 1 test from ExecutorTestRunner (883 ms total)
[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (887 ms total)
[ PASSED ] 0 tests.
[ FAILED ] 1 test, listed below:
[ FAILED ] ExecutorTestRunner.Filter4. What is your TiFlash version? (Required)
master
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
type/enhancementThe issue or PR belongs to an enhancement.The issue or PR belongs to an enhancement.type/testingIssue or PR for testingIssue or PR for testing