Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
231cce48
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,发现更多精彩内容 >>
提交
231cce48
编写于
12月 19, 2020
作者:
A
Alexey Milovidov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add a test
上级
ecc27060
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
129 addition
and
0 deletion
+129
-0
tests/queries/0_stateless/01606_git_import.reference
tests/queries/0_stateless/01606_git_import.reference
+4
-0
tests/queries/0_stateless/01606_git_import.sh
tests/queries/0_stateless/01606_git_import.sh
+125
-0
未找到文件。
tests/queries/0_stateless/01606_git_import.reference
0 → 100644
浏览文件 @
231cce48
913
888
2931
160553
tests/queries/0_stateless/01606_git_import.sh
0 → 100755
浏览文件 @
231cce48
#!/usr/bin/env bash
CURDIR
=
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&&
pwd
)
.
"
$CURDIR
"
/../shell_config.sh
# Clone some not too large repository and create a database from it.
# Protection for network errors
for
_
in
{
1..10
}
;
do
rm
-rf
./clickhouse-odbc
git clone
--quiet
https://github.com/ClickHouse/clickhouse-odbc.git
&&
pushd
clickhouse-odbc
>
/dev/null
&&
git checkout
--quiet
5d84ec591c53cbb272593f024230a052690fdf69
&&
break
sleep
1
done
${
CLICKHOUSE_GIT_IMPORT
}
2>&1 |
wc
-l
${
CLICKHOUSE_CLIENT
}
--multiline
--multiquery
--query
"
DROP TABLE IF EXISTS commits;
DROP TABLE IF EXISTS file_changes;
DROP TABLE IF EXISTS line_changes;
CREATE TABLE commits
(
hash String,
author LowCardinality(String),
time DateTime,
message String,
files_added UInt32,
files_deleted UInt32,
files_renamed UInt32,
files_modified UInt32,
lines_added UInt32,
lines_deleted UInt32,
hunks_added UInt32,
hunks_removed UInt32,
hunks_changed UInt32
) ENGINE = MergeTree ORDER BY time;
CREATE TABLE file_changes
(
change_type Enum('Add' = 1, 'Delete' = 2, 'Modify' = 3, 'Rename' = 4, 'Copy' = 5, 'Type' = 6),
path LowCardinality(String),
old_path LowCardinality(String),
file_extension LowCardinality(String),
lines_added UInt32,
lines_deleted UInt32,
hunks_added UInt32,
hunks_removed UInt32,
hunks_changed UInt32,
commit_hash String,
author LowCardinality(String),
time DateTime,
commit_message String,
commit_files_added UInt32,
commit_files_deleted UInt32,
commit_files_renamed UInt32,
commit_files_modified UInt32,
commit_lines_added UInt32,
commit_lines_deleted UInt32,
commit_hunks_added UInt32,
commit_hunks_removed UInt32,
commit_hunks_changed UInt32
) ENGINE = MergeTree ORDER BY time;
CREATE TABLE line_changes
(
sign Int8,
line_number_old UInt32,
line_number_new UInt32,
hunk_num UInt32,
hunk_start_line_number_old UInt32,
hunk_start_line_number_new UInt32,
hunk_lines_added UInt32,
hunk_lines_deleted UInt32,
hunk_context LowCardinality(String),
line LowCardinality(String),
indent UInt8,
line_type Enum('Empty' = 0, 'Comment' = 1, 'Punct' = 2, 'Code' = 3),
prev_commit_hash String,
prev_author LowCardinality(String),
prev_time DateTime,
file_change_type Enum('Add' = 1, 'Delete' = 2, 'Modify' = 3, 'Rename' = 4, 'Copy' = 5, 'Type' = 6),
path LowCardinality(String),
old_path LowCardinality(String),
file_extension LowCardinality(String),
file_lines_added UInt32,
file_lines_deleted UInt32,
file_hunks_added UInt32,
file_hunks_removed UInt32,
file_hunks_changed UInt32,
commit_hash String,
author LowCardinality(String),
time DateTime,
commit_message String,
commit_files_added UInt32,
commit_files_deleted UInt32,
commit_files_renamed UInt32,
commit_files_modified UInt32,
commit_lines_added UInt32,
commit_lines_deleted UInt32,
commit_hunks_added UInt32,
commit_hunks_removed UInt32,
commit_hunks_changed UInt32
) ENGINE = MergeTree ORDER BY time;
"
${
CLICKHOUSE_CLIENT
}
--query
"INSERT INTO commits FORMAT TSV"
< commits.tsv
${
CLICKHOUSE_CLIENT
}
--query
"INSERT INTO file_changes FORMAT TSV"
< file_changes.tsv
${
CLICKHOUSE_CLIENT
}
--query
"INSERT INTO line_changes FORMAT TSV"
< line_changes.tsv
${
CLICKHOUSE_CLIENT
}
--query
"SELECT count() FROM commits"
${
CLICKHOUSE_CLIENT
}
--query
"SELECT count() FROM file_changes"
${
CLICKHOUSE_CLIENT
}
--query
"SELECT count() FROM line_changes"
${
CLICKHOUSE_CLIENT
}
--multiline
--multiquery
--query
"
DROP TABLE commits;
DROP TABLE file_changes;
DROP TABLE line_changes;
"
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录