Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
782823de
C
ClickHouse
项目概览
2dot5
/
ClickHouse
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
ClickHouse
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
782823de
编写于
9月 30, 2020
作者:
N
Nikolai Kochetov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix build.
上级
de56c025
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
15 addition
and
11 deletion
+15
-11
src/Interpreters/ActionsVisitor.cpp
src/Interpreters/ActionsVisitor.cpp
+12
-8
src/Interpreters/ActionsVisitor.h
src/Interpreters/ActionsVisitor.h
+2
-2
src/Interpreters/ExpressionAnalyzer.cpp
src/Interpreters/ExpressionAnalyzer.cpp
+1
-1
未找到文件。
src/Interpreters/ActionsVisitor.cpp
浏览文件 @
782823de
...
...
@@ -329,7 +329,7 @@ Block createBlockForSet(
}
SetPtr
makeExplicitSet
(
const
ASTFunction
*
node
,
const
ActionsDAG
::
Index
&
index
,
bool
create_ordered_set
,
const
ASTFunction
*
node
,
const
ActionsDAG
&
actions
,
bool
create_ordered_set
,
const
Context
&
context
,
const
SizeLimits
&
size_limits
,
PreparedSets
&
prepared_sets
)
{
const
IAST
&
args
=
*
node
->
arguments
;
...
...
@@ -340,6 +340,7 @@ SetPtr makeExplicitSet(
const
ASTPtr
&
left_arg
=
args
.
children
.
at
(
0
);
const
ASTPtr
&
right_arg
=
args
.
children
.
at
(
1
);
const
auto
&
index
=
actions
.
getIndex
();
auto
it
=
index
.
find
(
left_arg
->
getColumnName
());
if
(
it
==
index
.
end
())
throw
Exception
(
"Unknown identifier: '"
+
left_arg
->
getColumnName
()
+
"'"
,
ErrorCodes
::
UNKNOWN_IDENTIFIER
);
...
...
@@ -408,8 +409,10 @@ void ScopeStack::pushLevel(const NamesAndTypesList & input_columns)
size_t
ScopeStack
::
getColumnLevel
(
const
std
::
string
&
name
)
{
for
(
int
i
=
static_cast
<
int
>
(
stack
.
size
())
-
1
;
i
>=
0
;
--
i
)
for
(
size_t
i
=
stack
.
size
();
i
>
0
;
)
{
--
i
;
if
(
stack
[
i
].
inputs
.
count
(
name
))
return
i
;
...
...
@@ -482,9 +485,9 @@ std::string ScopeStack::dumpNames() const
return
stack
.
back
().
actions
->
dumpNames
();
}
const
ActionsDAG
::
Index
&
ScopeStack
::
getIndex
()
const
const
ActionsDAG
&
ScopeStack
::
getLastActions
()
const
{
return
stack
.
back
().
actions
->
getIndex
()
;
return
*
stack
.
back
().
actions
;
}
struct
CachedColumnName
...
...
@@ -707,7 +710,7 @@ void ActionsMatcher::visit(const ASTFunction & node, const ASTPtr & ast, Data &
child_column_name
=
as_literal
->
unique_column_name
;
}
const
auto
&
index
=
data
.
actions_stack
.
getIndex
();
const
auto
&
index
=
data
.
actions_stack
.
get
LastActions
().
get
Index
();
auto
it
=
index
.
find
(
child_column_name
);
if
(
it
!=
index
.
end
())
{
...
...
@@ -813,7 +816,7 @@ void ActionsMatcher::visit(const ASTLiteral & literal, const ASTPtr & /* ast */,
if
(
literal
.
unique_column_name
.
empty
())
{
const
auto
default_name
=
literal
.
getColumnName
();
const
auto
&
index
=
data
.
actions_stack
.
getIndex
();
const
auto
&
index
=
data
.
actions_stack
.
get
LastActions
().
get
Index
();
const
ActionsDAG
::
Node
*
existing_column
=
nullptr
;
auto
it
=
index
.
find
(
default_name
);
...
...
@@ -927,10 +930,11 @@ SetPtr ActionsMatcher::makeSet(const ASTFunction & node, Data & data, bool no_su
}
else
{
const
auto
&
index
=
data
.
actions_stack
.
getIndex
();
const
auto
&
last_actions
=
data
.
actions_stack
.
getLastActions
();
const
auto
&
index
=
last_actions
.
getIndex
();
if
(
index
.
count
(
left_in_operand
->
getColumnName
())
!=
0
)
/// An explicit enumeration of values in parentheses.
return
makeExplicitSet
(
&
node
,
index
,
false
,
data
.
context
,
data
.
set_size_limit
,
data
.
prepared_sets
);
return
makeExplicitSet
(
&
node
,
last_actions
,
false
,
data
.
context
,
data
.
set_size_limit
,
data
.
prepared_sets
);
else
return
{};
}
...
...
src/Interpreters/ActionsVisitor.h
浏览文件 @
782823de
...
...
@@ -21,7 +21,7 @@ using ActionsDAGPtr = std::shared_ptr<ActionsDAG>;
/// The case of an explicit enumeration of values.
SetPtr
makeExplicitSet
(
const
ASTFunction
*
node
,
const
ActionsDAG
::
Index
&
index
,
bool
create_ordered_set
,
const
ASTFunction
*
node
,
const
ActionsDAG
&
actions
,
bool
create_ordered_set
,
const
Context
&
context
,
const
SizeLimits
&
limits
,
PreparedSets
&
prepared_sets
);
/** Create a block for set from expression.
...
...
@@ -89,7 +89,7 @@ struct ScopeStack
ActionsDAGPtr
popLevel
();
const
ActionsDAG
::
Index
&
getIndex
()
const
;
const
ActionsDAG
&
getLastActions
()
const
;
std
::
string
dumpNames
()
const
;
};
...
...
src/Interpreters/ExpressionAnalyzer.cpp
浏览文件 @
782823de
...
...
@@ -380,7 +380,7 @@ void SelectQueryExpressionAnalyzer::makeSetsForIndex(const ASTPtr & node)
getRootActions
(
left_in_operand
,
true
,
temp_actions
);
if
(
temp_actions
->
getIndex
().
count
(
left_in_operand
->
getColumnName
())
!=
0
)
makeExplicitSet
(
func
,
temp_actions
->
getIndex
()
,
true
,
context
,
makeExplicitSet
(
func
,
*
temp_actions
,
true
,
context
,
settings
.
size_limits_for_set
,
prepared_sets
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录