Repository navigation
Closed
Labels
bugConfirmed user-visible misbehaviour in official releasecomp-joinsJOINs end-to-end (planning hooks + runtime join operators/algorithms). Single bucket to avoid pla...comp-viewLogical (non-materialized) views.duplicate
Description
Normal VIEW is failed when defined JOIN with aliases (taken from stackoverflow).
CREATE TABLE test_table_01 (
column Int32
) ENGINE = Memory();
CREATE TABLE test_table_02 (
column Int32
) ENGINE = Memory();Creating view leads to error:
CREATE VIEW test_view_01 AS
SELECT
t1.column,
t2.column
FROM test_table_01 AS t1
INNER JOIN test_table_02 AS t2 ON t1.column = t2.column;Received exception from server (version 20.3.8):
Code: 352. DB::Exception: Received from localhost:9000. DB::Exception: Cannot detect left and right JOIN keys. JOIN ON section is ambiguous.. Stack trace:
0. Poco::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0x10542450 in /usr/bin/clickhouse
1. DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0x8f4272d in /usr/bin/clickhouse
2. ? @ 0xd50f7e8 in /usr/bin/clickhouse
3. DB::CollectJoinOnKeysMatcher::visit(DB::ASTFunction const&, std::__1::shared_ptr<DB::IAST> const&, DB::CollectJoinOnKeysMatcher::Data&) @ 0xd50f193 in /usr/bin/clickhouse
4. DB::InDepthNodeVisitor<DB::CollectJoinOnKeysMatcher, true, std::__1::shared_ptr<DB::IAST> const>::visit(std::__1::shared_ptr<DB::IAST> const&) @ 0xd4fe16d in /usr/bin/clickhouse
5. DB::SyntaxAnalyzer::analyzeSelect(std::__1::shared_ptr<DB::IAST>&, DB::SyntaxAnalyzerResult&&, DB::SelectQueryOptions const&, std::__1::vector<DB::TableWithColumnNamesAndTypes, std::__1::allocator<DB::TableWithColumnNamesAndTypes> > const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) const @ 0xd4f5538 in /usr/bin/clickhouse
6. ? @ 0xd148295 in /usr/bin/clickhouse
7. DB::InterpreterSelectQuery::InterpreterSelectQuery(std::__1::shared_ptr<DB::IAST> const&, DB::Context const&, std::__1::shared_ptr<DB::IBlockInputStream> const&, std::__1::optional<DB::Pipe>, std::__1::shared_ptr<DB::IStorage> const&, DB::SelectQueryOptions const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) @ 0xd1495ce in /usr/bin/clickhouse
8. DB::InterpreterSelectQuery::InterpreterSelectQuery(std::__1::shared_ptr<DB::IAST> const&, DB::Context const&, DB::SelectQueryOptions const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) @ 0xd14ab89 in /usr/bin/clickhouse
9. DB::InterpreterSelectWithUnionQuery::InterpreterSelectWithUnionQuery(std::__1::shared_ptr<DB::IAST> const&, DB::Context const&, DB::SelectQueryOptions const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) @ 0xd34fcd6 in /usr/bin/clickhouse
10. DB::InterpreterSelectWithUnionQuery::getSampleBlock(std::__1::shared_ptr<DB::IAST> const&, DB::Context const&) @ 0xd3507ba in /usr/bin/clickhouse
11. DB::InterpreterCreateQuery::setProperties(DB::ASTCreateQuery&) const @ 0xd051f62 in /usr/bin/clickhouse
12. DB::InterpreterCreateQuery::createTable(DB::ASTCreateQuery&) @ 0xd05261d in /usr/bin/clickhouse
13. DB::InterpreterCreateQuery::execute() @ 0xd054931 in /usr/bin/clickhouse
14. ? @ 0xd55f038 in /usr/bin/clickhouse
15. DB::executeQuery(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::Context&, bool, DB::QueryProcessingStage::Enum, bool, bool) @ 0xd561c71 in /usr/bin/clickhouse
16. DB::TCPHandler::runImpl() @ 0x9025489 in /usr/bin/clickhouse
17. DB::TCPHandler::run() @ 0x9026470 in /usr/bin/clickhouse
18. Poco::Net::TCPServerConnection::start() @ 0xe3b9a4b in /usr/bin/clickhouse
19. Poco::Net::TCPServerDispatcher::run() @ 0xe3b9ecd in /usr/bin/clickhouse
20. Poco::PooledThread::run() @ 0x105d05b7 in /usr/bin/clickhouse
21. Poco::ThreadImpl::runnableEntry(void*) @ 0x105cc3bc in /usr/bin/clickhouse
22. ? @ 0x105cdd5d in /usr/bin/clickhouse
23. start_thread @ 0x76db in /lib/x86_64-linux-gnu/libpthread-2.27.so
24. __clone @ 0x12188f in /lib/x86_64-linux-gnu/libc-2.27.soReacted by Jake Sylvestre
Metadata
Metadata
Assignees
Labels
bugConfirmed user-visible misbehaviour in official releasecomp-joinsJOINs end-to-end (planning hooks + runtime join operators/algorithms). Single bucket to avoid pla...comp-viewLogical (non-materialized) views.duplicate
Activity
den-crane commentedon May 18, 2020
duplicate #10894
alexey-milovidov commentedon Jul 10, 2020
@4ertus2 This is still relevant.
pprogs commentedon Nov 12, 2020
But it somehow works if you put full table names
this doesnt work
this works
Closes: #11000