-
Notifications
You must be signed in to change notification settings - Fork 81
/
Copy pathjoinKind.cpp
52 lines (48 loc) · 1.37 KB
/
joinKind.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include <Interpreters/Streaming/joinKind.h>
namespace DB
{
namespace ErrorCodes
{
extern const int NOT_IMPLEMENTED;
}
namespace Streaming
{
Kind toJoinKind(JoinKind kind)
{
switch (kind)
{
case JoinKind::Inner:
return Kind::Inner;
case JoinKind::Left:
return Kind::Left;
case JoinKind::Right:
return Kind::Right;
default:
throw Exception(ErrorCodes::NOT_IMPLEMENTED, "Stream join only supports inner/left join");
}
}
Strictness toJoinStrictness(JoinStrictness strictness, bool is_range_join)
{
switch (strictness)
{
case JoinStrictness::Any:
if (is_range_join)
throw Exception(ErrorCodes::NOT_IMPLEMENTED, "Stream join only supports any/all/asof/range join");
else
return Strictness::Latest;
case JoinStrictness::All:
if (is_range_join)
return Strictness::Range;
else
return Strictness::All;
case JoinStrictness::Asof:
if (is_range_join)
throw Exception(ErrorCodes::NOT_IMPLEMENTED, "Stream join only supports any/all/asof/range join");
else
return Strictness::Asof;
default:
throw Exception(ErrorCodes::NOT_IMPLEMENTED, "Stream join only supports any/all/asof/range join");
}
}
}
}