mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-17 20:02:05 +00:00
Merge pull request #65936 from hanfei1991/hanfei/exception-storage-join
add restriction for storage join
This commit is contained in:
commit
d3ede543bb
@ -395,11 +395,14 @@ void registerStorageJoin(StorageFactory & factory)
|
||||
else if (kind_str == "full")
|
||||
{
|
||||
if (strictness == JoinStrictness::Any)
|
||||
strictness = JoinStrictness::RightAny;
|
||||
throw Exception(ErrorCodes::NOT_IMPLEMENTED, "ANY FULL JOINs are not implemented");
|
||||
kind = JoinKind::Full;
|
||||
}
|
||||
}
|
||||
|
||||
if ((strictness == JoinStrictness::Semi || strictness == JoinStrictness::Anti) && (kind != JoinKind::Left && kind != JoinKind::Right))
|
||||
throw Exception(ErrorCodes::BAD_ARGUMENTS, " SEMI|ANTI JOIN should be LEFT or RIGHT");
|
||||
|
||||
if (kind == JoinKind::Comma)
|
||||
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Second parameter of storage Join must be LEFT or INNER or RIGHT or FULL (without quotes).");
|
||||
|
||||
|
@ -0,0 +1,42 @@
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1
|
||||
(
|
||||
a Int64,
|
||||
b Int64
|
||||
) Engine = Join(SEMI, ALL, a); -- { serverError BAD_ARGUMENTS }
|
||||
|
||||
CREATE TABLE t1
|
||||
(
|
||||
a Int64,
|
||||
b Int64
|
||||
) Engine = Join(SEMI, INNER, a); -- { serverError BAD_ARGUMENTS }
|
||||
|
||||
CREATE TABLE t1
|
||||
(
|
||||
a Int64,
|
||||
b Int64
|
||||
) Engine = Join(SEMI, FULL, a); -- { serverError BAD_ARGUMENTS }
|
||||
|
||||
CREATE TABLE t1
|
||||
(
|
||||
a Int64,
|
||||
b Int64
|
||||
) Engine = Join(ANTI, ALL, a); -- { serverError BAD_ARGUMENTS }
|
||||
|
||||
CREATE TABLE t1
|
||||
(
|
||||
a Int64,
|
||||
b Int64
|
||||
) Engine = Join(ANTI, INNER, a); -- { serverError BAD_ARGUMENTS }
|
||||
|
||||
CREATE TABLE t1
|
||||
(
|
||||
a Int64,
|
||||
b Int64
|
||||
) Engine = Join(ANTI, FULL, a); -- { serverError BAD_ARGUMENTS }
|
||||
|
||||
CREATE TABLE t1
|
||||
(
|
||||
a Int64,
|
||||
b Int64
|
||||
) Engine = Join(ANY, FULL, a); -- { serverError NOT_IMPLEMENTED }
|
Loading…
Reference in New Issue
Block a user