Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
86a293d6
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,发现更多精彩内容 >>
未验证
提交
86a293d6
编写于
3月 25, 2021
作者:
V
Vitaly Baranov
提交者:
GitHub
3月 25, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #22057 from vitlibar/update-simdjson
Update simdjson
上级
977ebe8b
fb3af770
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
20 addition
and
12 deletion
+20
-12
.gitmodules
.gitmodules
+1
-1
contrib/simdjson
contrib/simdjson
+1
-1
src/Functions/SimdJSONParser.h
src/Functions/SimdJSONParser.h
+10
-10
tests/queries/0_stateless/00966_invalid_json_must_not_parse.reference
...s/0_stateless/00966_invalid_json_must_not_parse.reference
+4
-0
tests/queries/0_stateless/00966_invalid_json_must_not_parse.sql
...queries/0_stateless/00966_invalid_json_must_not_parse.sql
+4
-0
未找到文件。
.gitmodules
浏览文件 @
86a293d6
...
...
@@ -93,7 +93,7 @@
url = https://github.com/ClickHouse-Extras/libunwind.git
[submodule "contrib/simdjson"]
path = contrib/simdjson
url = https://github.com/
ClickHouse-Extras
/simdjson.git
url = https://github.com/
simdjson
/simdjson.git
[submodule "contrib/rapidjson"]
path = contrib/rapidjson
url = https://github.com/ClickHouse-Extras/rapidjson
...
...
simdjson
@
95b4870e
Subproject commit
3190d66a49059092a1753dc35595923debfc1698
Subproject commit
95b4870e20be5f97d9dcf63b23b1c6f520c366c1
src/Functions/SimdJSONParser.h
浏览文件 @
86a293d6
...
...
@@ -42,11 +42,11 @@ struct SimdJSONParser
ALWAYS_INLINE
bool
isBool
()
const
{
return
element
.
type
()
==
simdjson
::
dom
::
element_type
::
BOOL
;
}
ALWAYS_INLINE
bool
isNull
()
const
{
return
element
.
type
()
==
simdjson
::
dom
::
element_type
::
NULL_VALUE
;
}
ALWAYS_INLINE
Int64
getInt64
()
const
{
return
element
.
get_int64
().
first
;
}
ALWAYS_INLINE
UInt64
getUInt64
()
const
{
return
element
.
get_uint64
().
first
;
}
ALWAYS_INLINE
double
getDouble
()
const
{
return
element
.
get_double
().
first
;
}
ALWAYS_INLINE
bool
getBool
()
const
{
return
element
.
get_bool
().
first
;
}
ALWAYS_INLINE
std
::
string_view
getString
()
const
{
return
element
.
get_string
().
first
;
}
ALWAYS_INLINE
Int64
getInt64
()
const
{
return
element
.
get_int64
().
value_unsafe
()
;
}
ALWAYS_INLINE
UInt64
getUInt64
()
const
{
return
element
.
get_uint64
().
value_unsafe
()
;
}
ALWAYS_INLINE
double
getDouble
()
const
{
return
element
.
get_double
().
value_unsafe
()
;
}
ALWAYS_INLINE
bool
getBool
()
const
{
return
element
.
get_bool
().
value_unsafe
()
;
}
ALWAYS_INLINE
std
::
string_view
getString
()
const
{
return
element
.
get_string
().
value_unsafe
()
;
}
ALWAYS_INLINE
Array
getArray
()
const
;
ALWAYS_INLINE
Object
getObject
()
const
;
...
...
@@ -75,7 +75,7 @@ struct SimdJSONParser
ALWAYS_INLINE
Iterator
begin
()
const
{
return
array
.
begin
();
}
ALWAYS_INLINE
Iterator
end
()
const
{
return
array
.
end
();
}
ALWAYS_INLINE
size_t
size
()
const
{
return
array
.
size
();
}
ALWAYS_INLINE
Element
operator
[](
size_t
index
)
const
{
assert
(
index
<
size
());
return
array
.
at
(
index
).
first
;
}
ALWAYS_INLINE
Element
operator
[](
size_t
index
)
const
{
assert
(
index
<
size
());
return
array
.
at
(
index
).
value_unsafe
()
;
}
private:
simdjson
::
dom
::
array
array
;
...
...
@@ -111,7 +111,7 @@ struct SimdJSONParser
if
(
x
.
error
())
return
false
;
result
=
x
.
first
;
result
=
x
.
value_unsafe
()
;
return
true
;
}
...
...
@@ -137,7 +137,7 @@ struct SimdJSONParser
if
(
document
.
error
())
return
false
;
result
=
document
.
first
;
result
=
document
.
value_unsafe
()
;
return
true
;
}
...
...
@@ -155,12 +155,12 @@ private:
inline
ALWAYS_INLINE
SimdJSONParser
::
Array
SimdJSONParser
::
Element
::
getArray
()
const
{
return
element
.
get_array
().
first
;
return
element
.
get_array
().
value_unsafe
()
;
}
inline
ALWAYS_INLINE
SimdJSONParser
::
Object
SimdJSONParser
::
Element
::
getObject
()
const
{
return
element
.
get_object
().
first
;
return
element
.
get_object
().
value_unsafe
()
;
}
}
...
...
tests/queries/0_stateless/00966_invalid_json_must_not_parse.reference
浏览文件 @
86a293d6
...
...
@@ -4,3 +4,7 @@
0
0
0
0
0
0
0
tests/queries/0_stateless/00966_invalid_json_must_not_parse.sql
浏览文件 @
86a293d6
...
...
@@ -3,6 +3,8 @@ SET allow_simdjson=1;
SELECT
JSONLength
(
'"HX-='
);
SELECT
JSONLength
(
'[9]
\0\x
42
\x
D3
\x
36
\x
E3'
);
SELECT
JSONLength
(
unhex
(
'5B30000E06D7AA5D'
));
SELECT
JSONLength
(
'{"success"test:"123"}'
);
SELECT
isValidJSON
(
'{"success"test:"123"}'
);
SET
allow_simdjson
=
0
;
...
...
@@ -10,3 +12,5 @@ SET allow_simdjson=0;
SELECT
JSONLength
(
'"HX-='
);
SELECT
JSONLength
(
'[9]
\0\x
42
\x
D3
\x
36
\x
E3'
);
SELECT
JSONLength
(
unhex
(
'5B30000E06D7AA5D'
));
SELECT
JSONLength
(
'{"success"test:"123"}'
);
SELECT
isValidJSON
(
'{"success"test:"123"}'
);
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录