Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
74d9bc55
提交
74d9bc55
authored
17 年前
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
javadocs
上级
16f43776
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
71 行增加
和
6 行删除
+71
-6
Aggregate.java
h2/src/main/org/h2/expression/Aggregate.java
+65
-6
ExpressionVisitor.java
h2/src/main/org/h2/expression/ExpressionVisitor.java
+6
-0
没有找到文件。
h2/src/main/org/h2/expression/Aggregate.java
浏览文件 @
74d9bc55
...
...
@@ -42,12 +42,64 @@ import org.h2.value.ValueString;
* Implements the integrated aggregate functions, such as COUNT, MAX, SUM.
*/
public
class
Aggregate
extends
Expression
{
// TODO incompatibility to hsqldb: aggregates: hsqldb uses automatic data
// type for sum if value is too big,
// h2 uses the same type as the data
public
static
final
int
COUNT_ALL
=
0
,
COUNT
=
1
,
SUM
=
2
,
MIN
=
3
,
MAX
=
4
,
AVG
=
5
;
public
static
final
int
GROUP_CONCAT
=
6
,
STDDEV_POP
=
7
,
STDDEV_SAMP
=
8
;
public
static
final
int
VAR_POP
=
9
,
VAR_SAMP
=
10
,
SOME
=
11
,
EVERY
=
12
,
SELECTIVITY
=
13
;
/**
* The aggregate type for COUNT(*).
*/
public
static
final
int
COUNT_ALL
=
0
;
/**
* The aggregate type for COUNT(expression).
*/
public
static
final
int
COUNT
=
1
;
/**
* The aggregate type for SUM(expression).
*/
public
static
final
int
SUM
=
2
;
/**
* The aggregate type for MIN(expression).
*/
public
static
final
int
MIN
=
3
;
/**
* The aggregate type for MAX(expression).
*/
public
static
final
int
MAX
=
4
;
/**
* The aggregate type for AVG(expression).
*/
public
static
final
int
AVG
=
5
;
/**
* The aggregate type for GROUP_CONCAT(...).
*/
public
static
final
int
GROUP_CONCAT
=
6
;
/**
* The aggregate type for STDDEV_POP(expression).
*/
public
static
final
int
STDDEV_POP
=
7
;
/**
* The aggregate type for STDDEV_SAMP(expression).
*/
public
static
final
int
STDDEV_SAMP
=
8
;
/**
* The aggregate type for VAR_POP(expression).
*/
public
static
final
int
VAR_POP
=
9
;
/**
* The aggregate type for VAR_SAMP(expression).
*/
public
static
final
int
VAR_SAMP
=
10
;
public
static
final
int
SOME
=
11
;
public
static
final
int
EVERY
=
12
;
public
static
final
int
SELECTIVITY
=
13
;
private
final
Database
database
;
private
final
int
type
;
...
...
@@ -97,6 +149,13 @@ public class Aggregate extends Expression {
AGGREGATES
.
put
(
name
,
ObjectUtils
.
getInteger
(
type
));
}
/**
* Get the aggregate type for this name, or -1 if no aggregate has been
* found.
*
* @param name the aggregate function name
* @return -1 if no aggregate function has been found, or the aggregate type
*/
public
static
int
getAggregateType
(
String
name
)
{
Integer
type
=
(
Integer
)
AGGREGATES
.
get
(
name
);
return
type
==
null
?
-
1
:
type
.
intValue
();
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/expression/ExpressionVisitor.java
浏览文件 @
74d9bc55
...
...
@@ -70,6 +70,12 @@ public class ExpressionVisitor {
private
ColumnResolver
resolver
;
private
HashSet
dependencies
;
/**
* Create a new visitor object with the given type.
*
* @param type the visitor type
* @return the new visitor
*/
public
static
ExpressionVisitor
get
(
int
type
)
{
return
new
ExpressionVisitor
(
type
);
}
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论