Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
c10e32eb
TDengine
项目概览
taosdata
/
TDengine
12 个月 前同步成功
通知
1180
Star
22014
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c10e32eb
编写于
3月 09, 2023
作者:
S
slzhou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: null bitmap error
上级
a39ada58
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
15 addition
and
12 deletion
+15
-12
include/libs/function/taosudf.h
include/libs/function/taosudf.h
+14
-11
source/libs/function/src/udfd.c
source/libs/function/src/udfd.c
+1
-1
未找到文件。
include/libs/function/taosudf.h
浏览文件 @
c10e32eb
...
...
@@ -149,6 +149,8 @@ static FORCE_INLINE int32_t udfColEnsureCapacity(SUdfColumn *pColumn, int32_t ne
allocCapacity
*=
UDF_MEMORY_EXP_GROWTH
;
}
int32_t
existedRows
=
data
->
numOfRows
;
if
(
IS_VAR_DATA_TYPE
(
meta
->
type
))
{
char
*
tmp
=
(
char
*
)
realloc
(
data
->
varLenCol
.
varOffsets
,
sizeof
(
int32_t
)
*
allocCapacity
);
if
(
tmp
==
NULL
)
{
...
...
@@ -156,6 +158,7 @@ static FORCE_INLINE int32_t udfColEnsureCapacity(SUdfColumn *pColumn, int32_t ne
}
data
->
varLenCol
.
varOffsets
=
(
int32_t
*
)
tmp
;
data
->
varLenCol
.
varOffsetsLen
=
sizeof
(
int32_t
)
*
allocCapacity
;
memset
(
&
data
->
varLenCol
.
varOffsets
[
existedRows
],
0
,
sizeof
(
int32_t
)
*
(
allocCapacity
-
existedRows
));
// for payload, add data in udfColDataAppend
}
else
{
char
*
tmp
=
(
char
*
)
realloc
(
data
->
fixLenCol
.
nullBitmap
,
BitmapLen
(
allocCapacity
));
...
...
@@ -164,6 +167,9 @@ static FORCE_INLINE int32_t udfColEnsureCapacity(SUdfColumn *pColumn, int32_t ne
}
data
->
fixLenCol
.
nullBitmap
=
tmp
;
data
->
fixLenCol
.
nullBitmapLen
=
BitmapLen
(
allocCapacity
);
int32_t
oldLen
=
BitmapLen
(
existedRows
);
memset
(
&
data
->
fixLenCol
.
nullBitmap
[
oldLen
],
0
,
BitmapLen
(
allocCapacity
)
-
oldLen
);
if
(
meta
->
type
==
TSDB_DATA_TYPE_NULL
)
{
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -260,24 +266,21 @@ typedef int32_t (*TUdfAggMergeFunc)(SUdfInterBuf *inputBuf1, SUdfInterBuf *input
typedef
int32_t
(
*
TUdfAggFinishFunc
)(
SUdfInterBuf
*
buf
,
SUdfInterBuf
*
resultData
);
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
typedef
struct
SScriptUdfEnvItem
{
typedef
struct
SScriptUdfEnvItem
{
const
char
*
name
;
const
char
*
value
;
}
SScriptUdfEnvItem
;
typedef
enum
EUdfFuncType
{
UDF_FUNC_TYPE_SCALAR
=
1
,
UDF_FUNC_TYPE_AGG
=
2
}
EUdfFuncType
;
typedef
enum
EUdfFuncType
{
UDF_FUNC_TYPE_SCALAR
=
1
,
UDF_FUNC_TYPE_AGG
=
2
}
EUdfFuncType
;
typedef
struct
SScriptUdfInfo
{
const
char
*
name
;
EUdfFuncType
funcType
;
int8_t
scriptType
;
int8_t
outputType
;
int32_t
outputLen
;
int32_t
bufSize
;
EUdfFuncType
funcType
;
int8_t
scriptType
;
int8_t
outputType
;
int32_t
outputLen
;
int32_t
bufSize
;
const
char
*
path
;
}
SScriptUdfInfo
;
...
...
@@ -294,7 +297,7 @@ typedef int32_t (*TScriptUdfInitFunc)(SScriptUdfInfo *info, void **pUdfCtx);
typedef
int32_t
(
*
TScriptUdfDestoryFunc
)(
void
*
udfCtx
);
// the following function is for open/close script plugin.
typedef
int32_t
(
*
TScriptOpenFunc
)(
SScriptUdfEnvItem
*
items
,
int
numItems
);
typedef
int32_t
(
*
TScriptOpenFunc
)(
SScriptUdfEnvItem
*
items
,
int
numItems
);
typedef
int32_t
(
*
TScriptCloseFunc
)();
#ifdef __cplusplus
...
...
source/libs/function/src/udfd.c
浏览文件 @
c10e32eb
...
...
@@ -372,7 +372,7 @@ int32_t udfdInitializePythonPlugin(SUdfScriptPlugin *plugin) {
snprintf
(
pythonPath
,
lenPythonPath
,
"%s:%s"
,
tsTempDir
,
tsUdfdLdLibPath
);
#endif
SScriptUdfEnvItem
items
[]
=
{{
"PYTHONPATH"
,
pythonPath
},
{
"LOGDIR"
,
tsLogDir
}};
err
=
plugin
->
openFunc
(
items
,
1
);
err
=
plugin
->
openFunc
(
items
,
2
);
taosMemoryFree
(
pythonPath
);
}
if
(
err
!=
0
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录