Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
26f1e91d
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
26f1e91d
编写于
4月 07, 2023
作者:
S
slzhou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: change binarylib/script dir to tsdatadir
上级
59676447
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
8 addition
and
8 deletion
+8
-8
source/libs/function/src/udfd.c
source/libs/function/src/udfd.c
+8
-8
未找到文件。
source/libs/function/src/udfd.c
浏览文件 @
26f1e91d
...
@@ -387,12 +387,12 @@ int32_t udfdInitializePythonPlugin(SUdfScriptPlugin *plugin) {
...
@@ -387,12 +387,12 @@ int32_t udfdInitializePythonPlugin(SUdfScriptPlugin *plugin) {
}
}
if
(
plugin
->
openFunc
)
{
if
(
plugin
->
openFunc
)
{
int16_t
lenPythonPath
=
strlen
(
tsUdfdLdLibPath
)
+
strlen
(
ts
TempDir
)
+
1
+
1
;
// tsTemp
Dir:tsUdfdLdLibPath
int16_t
lenPythonPath
=
strlen
(
tsUdfdLdLibPath
)
+
strlen
(
ts
DataDir
)
+
1
+
1
;
// tsData
Dir:tsUdfdLdLibPath
char
*
pythonPath
=
taosMemoryMalloc
(
lenPythonPath
);
char
*
pythonPath
=
taosMemoryMalloc
(
lenPythonPath
);
#ifdef WINDOWS
#ifdef WINDOWS
snprintf
(
pythonPath
,
lenPythonPath
,
"%s;%s"
,
ts
Temp
Dir
,
tsUdfdLdLibPath
);
snprintf
(
pythonPath
,
lenPythonPath
,
"%s;%s"
,
ts
Data
Dir
,
tsUdfdLdLibPath
);
#else
#else
snprintf
(
pythonPath
,
lenPythonPath
,
"%s:%s"
,
ts
Temp
Dir
,
tsUdfdLdLibPath
);
snprintf
(
pythonPath
,
lenPythonPath
,
"%s:%s"
,
ts
Data
Dir
,
tsUdfdLdLibPath
);
#endif
#endif
SScriptUdfEnvItem
items
[]
=
{{
"PYTHONPATH"
,
pythonPath
},
{
"LOGDIR"
,
tsLogDir
}};
SScriptUdfEnvItem
items
[]
=
{{
"PYTHONPATH"
,
pythonPath
},
{
"LOGDIR"
,
tsLogDir
}};
err
=
plugin
->
openFunc
(
items
,
2
);
err
=
plugin
->
openFunc
(
items
,
2
);
...
@@ -527,9 +527,9 @@ void convertUdf2UdfInfo(SUdf *udf, SScriptUdfInfo *udfInfo) {
...
@@ -527,9 +527,9 @@ void convertUdf2UdfInfo(SUdf *udf, SScriptUdfInfo *udfInfo) {
int32_t
udfdRenameUdfFile
(
SUdf
*
udf
)
{
int32_t
udfdRenameUdfFile
(
SUdf
*
udf
)
{
char
newPath
[
PATH_MAX
];
char
newPath
[
PATH_MAX
];
if
(
udf
->
scriptType
==
TSDB_FUNC_SCRIPT_BIN_LIB
)
{
if
(
udf
->
scriptType
==
TSDB_FUNC_SCRIPT_BIN_LIB
)
{
snprintf
(
newPath
,
PATH_MAX
,
"%s/lib%s_%d_%"
PRI
d64
".so"
,
tsTemp
Dir
,
udf
->
name
,
udf
->
version
,
udf
->
lastFetchTime
);
snprintf
(
newPath
,
PATH_MAX
,
"%s/lib%s_%d_%"
PRI
x64
".so"
,
tsData
Dir
,
udf
->
name
,
udf
->
version
,
udf
->
lastFetchTime
);
}
else
if
(
udf
->
scriptType
==
TSDB_FUNC_SCRIPT_PYTHON
)
{
}
else
if
(
udf
->
scriptType
==
TSDB_FUNC_SCRIPT_PYTHON
)
{
snprintf
(
newPath
,
PATH_MAX
,
"%s/%s_%d_%"
PRI
d64
".py"
,
tsTemp
Dir
,
udf
->
name
,
udf
->
version
,
udf
->
lastFetchTime
);
snprintf
(
newPath
,
PATH_MAX
,
"%s/%s_%d_%"
PRI
x64
".py"
,
tsData
Dir
,
udf
->
name
,
udf
->
version
,
udf
->
lastFetchTime
);
}
else
{
}
else
{
return
TSDB_CODE_UDF_SCRIPT_NOT_SUPPORTED
;
return
TSDB_CODE_UDF_SCRIPT_NOT_SUPPORTED
;
}
}
...
@@ -827,7 +827,7 @@ void udfdProcessTeardownRequest(SUvUdfWork *uvUdf, SUdfRequest *request) {
...
@@ -827,7 +827,7 @@ void udfdProcessTeardownRequest(SUvUdfWork *uvUdf, SUdfRequest *request) {
}
}
int32_t
udfdSaveFuncBodyToFile
(
SFuncInfo
*
pFuncInfo
,
SUdf
*
udf
)
{
int32_t
udfdSaveFuncBodyToFile
(
SFuncInfo
*
pFuncInfo
,
SUdf
*
udf
)
{
if
(
!
os
Temp
SpaceAvailable
())
{
if
(
!
os
Data
SpaceAvailable
())
{
terrno
=
TSDB_CODE_NO_AVAIL_DISK
;
terrno
=
TSDB_CODE_NO_AVAIL_DISK
;
fnError
(
"udfd create shared library failed since %s"
,
terrstr
(
terrno
));
fnError
(
"udfd create shared library failed since %s"
,
terrstr
(
terrno
));
return
terrno
;
return
terrno
;
...
@@ -835,9 +835,9 @@ int32_t udfdSaveFuncBodyToFile(SFuncInfo *pFuncInfo, SUdf *udf) {
...
@@ -835,9 +835,9 @@ int32_t udfdSaveFuncBodyToFile(SFuncInfo *pFuncInfo, SUdf *udf) {
char
path
[
PATH_MAX
]
=
{
0
};
char
path
[
PATH_MAX
]
=
{
0
};
#ifdef WINDOWS
#ifdef WINDOWS
snprintf
(
path
,
sizeof
(
path
),
"%s%s_%d_%"
PRI
d64
,
tsTemp
Dir
,
pFuncInfo
->
name
,
udf
->
version
,
udf
->
lastFetchTime
);
snprintf
(
path
,
sizeof
(
path
),
"%s%s_%d_%"
PRI
x64
,
tsData
Dir
,
pFuncInfo
->
name
,
udf
->
version
,
udf
->
lastFetchTime
);
#else
#else
snprintf
(
path
,
sizeof
(
path
),
"%s/%s_%d_%"
PRI
d64
,
tsTemp
Dir
,
pFuncInfo
->
name
,
udf
->
version
,
udf
->
lastFetchTime
);
snprintf
(
path
,
sizeof
(
path
),
"%s/%s_%d_%"
PRI
x64
,
tsData
Dir
,
pFuncInfo
->
name
,
udf
->
version
,
udf
->
lastFetchTime
);
#endif
#endif
TdFilePtr
file
=
taosOpenFile
(
path
,
TD_FILE_CREATE
|
TD_FILE_WRITE
|
TD_FILE_READ
|
TD_FILE_TRUNC
);
TdFilePtr
file
=
taosOpenFile
(
path
,
TD_FILE_CREATE
|
TD_FILE_WRITE
|
TD_FILE_READ
|
TD_FILE_TRUNC
);
if
(
file
==
NULL
)
{
if
(
file
==
NULL
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录