Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
oceanbase
oceanbase
提交
d9824868
O
oceanbase
项目概览
oceanbase
/
oceanbase
9 个月 前同步成功
通知
261
Star
6084
Fork
1301
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oceanbase
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
d9824868
编写于
4月 20, 2024
作者:
D
dontknow9179
提交者:
ob-robot
4月 20, 2024
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix mysqltest and modify outfile suffix
上级
ab9346b0
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
21 addition
and
23 deletion
+21
-23
src/sql/code_generator/ob_static_engine_cg.cpp
src/sql/code_generator/ob_static_engine_cg.cpp
+1
-0
src/sql/engine/basic/ob_select_into_op.cpp
src/sql/engine/basic/ob_select_into_op.cpp
+17
-22
src/sql/engine/basic/ob_select_into_op.h
src/sql/engine/basic/ob_select_into_op.h
+3
-1
未找到文件。
src/sql/code_generator/ob_static_engine_cg.cpp
浏览文件 @
d9824868
...
...
@@ -7556,6 +7556,7 @@ int ObStaticEngineCG::generate_spec(ObLogSelectInto &op, ObSelectIntoSpec &spec,
spec
.
is_single_
=
op
.
get_is_single
();
spec
.
max_file_size_
=
op
.
get_max_file_size
();
spec
.
cs_type_
=
op
.
get_cs_type
();
spec
.
parallel_
=
op
.
get_parallel
();
spec
.
plan_
->
need_drive_dml_query_
=
true
;
}
}
...
...
src/sql/engine/basic/ob_select_into_op.cpp
浏览文件 @
d9824868
...
...
@@ -29,7 +29,7 @@ namespace sql
OB_SERIALIZE_MEMBER
(
ObSelectIntoOpInput
,
task_id_
,
sqc_id_
);
OB_SERIALIZE_MEMBER
((
ObSelectIntoSpec
,
ObOpSpec
),
into_type_
,
user_vars_
,
outfile_name_
,
field_str_
,
line_str_
,
closed_cht_
,
is_optional_
,
select_exprs_
,
is_single_
,
max_file_size_
,
escaped_cht_
,
cs_type_
);
max_file_size_
,
escaped_cht_
,
cs_type_
,
parallel_
);
int
ObSelectIntoOp
::
inner_open
()
...
...
@@ -118,29 +118,27 @@ int ObSelectIntoOp::inner_open()
input_file_name
=
file_location_
==
IntoFileLocation
::
REMOTE_OSS
?
path
.
split_on
(
'?'
).
trim
()
:
path
;
if
(
OB_ISNULL
(
input
))
{
if
(
input_file_name
.
length
()
==
0
||
path
.
length
()
==
0
||
OB_ISNULL
(
input
))
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"select into operator input is null"
,
K
(
ret
));
}
else
if
(
input_file_name
.
ptr
()[
input_file_name
.
length
()
-
1
]
==
'/'
){
file_name_with_suffix
.
append_fmt
(
"%sdata_%ld_%ld_%ld"
,
to_cstring
(
input_file_name
),
input
->
sqc_id_
,
input
->
task_id_
,
split_file_id_
);
LOG_WARN
(
"get unexpected path or input is null"
,
K
(
ret
));
}
else
{
file_name_with_suffix
.
append_fmt
(
"%s_%ld_%ld_%ld"
,
to_cstring
(
input_file_name
),
input
->
sqc_id_
,
input
->
task_id_
,
split_file_id_
);
}
if
(
file_location_
==
IntoFileLocation
::
REMOTE_OSS
)
{
file_name_with_suffix
.
append_fmt
(
"?%s"
,
to_cstring
(
path
));
if
(
input_file_name
.
ptr
()[
input_file_name
.
length
()
-
1
]
==
'/'
){
file_name_with_suffix
.
append_fmt
(
"%sdata"
,
to_cstring
(
input_file_name
));
}
else
{
file_name_with_suffix
.
append_fmt
(
"%s"
,
to_cstring
(
input_file_name
));
}
if
(
MY_SPEC
.
parallel_
>
1
)
{
file_name_with_suffix
.
append_fmt
(
"_%ld_%ld_%ld"
,
input
->
sqc_id_
,
input
->
task_id_
,
split_file_id_
);
}
else
{
file_name_with_suffix
.
append_fmt
(
"_%ld"
,
split_file_id_
);
}
if
(
file_location_
==
IntoFileLocation
::
REMOTE_OSS
)
{
file_name_with_suffix
.
append_fmt
(
"?%s"
,
to_cstring
(
path
));
}
path
=
file_name_with_suffix
.
string
();
}
path
=
file_name_with_suffix
.
string
();
}
if
(
OB_FAIL
(
ret
))
{
// do nothing
}
else
if
(
file_location_
==
IntoFileLocation
::
REMOTE_OSS
)
{
ObString
temp_url
=
path
.
split_on
(
'?'
);
temp_url
.
trim
();
...
...
@@ -557,8 +555,6 @@ int ObSelectIntoOp::try_split_file()
||
(
file_location_
==
IntoFileLocation
::
REMOTE_OSS
&&
((
!
MY_SPEC
.
is_single_
&&
curr_bytes
>
min
(
MY_SPEC
.
max_file_size_
,
MAX_OSS_FILE_SIZE
))
||
(
MY_SPEC
.
is_single_
&&
curr_bytes
>
MAX_OSS_FILE_SIZE
))))
{
LOG_DEBUG
(
"debug select into"
,
K
(
curr_bytes
),
K
(
MY_SPEC
.
max_file_size_
),
K
(
data_writer_
.
get_curr_line_len
()),
K
(
data_writer_
.
get_curr_pos
()));
if
(
OB_FAIL
(
split_file
()))
{
LOG_WARN
(
"failed to split file"
,
K
(
ret
));
}
else
{
...
...
@@ -571,7 +567,6 @@ int ObSelectIntoOp::try_split_file()
}
else
{
write_bytes_
=
has_split
?
0
:
curr_bytes
;
data_writer_
.
reset_curr_line_len
();
LOG_DEBUG
(
"debug select into"
,
K
(
has_split
),
K
(
write_bytes_
));
}
data_writer_
.
update_last_line_pos
();
}
...
...
src/sql/engine/basic/ob_select_into_op.h
浏览文件 @
d9824868
...
...
@@ -65,7 +65,8 @@ public:
select_exprs_
(
alloc
),
is_single_
(
true
),
max_file_size_
(
DEFAULT_MAX_FILE_SIZE
),
escaped_cht_
()
escaped_cht_
(),
parallel_
(
1
)
{
cs_type_
=
ObCharset
::
get_system_collation
();
}
...
...
@@ -82,6 +83,7 @@ public:
int64_t
max_file_size_
;
common
::
ObObj
escaped_cht_
;
common
::
ObCollationType
cs_type_
;
int64_t
parallel_
;
static
const
int64_t
DEFAULT_MAX_FILE_SIZE
=
256LL
*
1024
*
1024
;
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录