Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a3166507
T
TDengine
项目概览
taosdata
/
TDengine
11 个月 前同步成功
通知
1179
Star
22014
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a3166507
编写于
8月 03, 2022
作者:
C
Cary Xu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enh: don't read bitmap when all col is normal
上级
bc600a49
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
52 addition
and
25 deletion
+52
-25
include/common/trow.h
include/common/trow.h
+5
-3
source/client/src/tmq.c
source/client/src/tmq.c
+2
-0
source/common/src/tdatablock.c
source/common/src/tdatablock.c
+1
-0
source/common/src/trow.c
source/common/src/trow.c
+35
-21
source/dnode/vnode/src/tq/tqSink.c
source/dnode/vnode/src/tq/tqSink.c
+1
-0
source/libs/executor/src/dataInserter.c
source/libs/executor/src/dataInserter.c
+1
-0
source/libs/parser/src/parInsert.c
source/libs/parser/src/parInsert.c
+6
-1
source/libs/parser/src/parInsertData.c
source/libs/parser/src/parInsertData.c
+1
-0
未找到文件。
include/common/trow.h
浏览文件 @
a3166507
...
@@ -38,7 +38,8 @@ typedef struct {
...
@@ -38,7 +38,8 @@ typedef struct {
uint16_t
type
:
2
;
uint16_t
type
:
2
;
uint16_t
del
:
1
;
uint16_t
del
:
1
;
uint16_t
endian
:
1
;
uint16_t
endian
:
1
;
uint16_t
reserve
:
12
;
uint16_t
normal
:
1
;
// all norm
uint16_t
reserve
:
11
;
uint16_t
sver
;
uint16_t
sver
;
};
};
};
};
...
@@ -149,6 +150,8 @@ typedef struct {
...
@@ -149,6 +150,8 @@ typedef struct {
void
*
pBitmap
;
void
*
pBitmap
;
void
*
pOffset
;
void
*
pOffset
;
int32_t
extendedRowSize
;
int32_t
extendedRowSize
;
int16_t
nNone
;
int16_t
nNull
;
}
SRowBuilder
;
}
SRowBuilder
;
#define TD_ROW_HEAD_LEN (sizeof(STSRow))
#define TD_ROW_HEAD_LEN (sizeof(STSRow))
...
@@ -287,9 +290,8 @@ int32_t tdSRowSetTpInfo(SRowBuilder *pBuilder, int32_t nCols, int32_t flen);
...
@@ -287,9 +290,8 @@ int32_t tdSRowSetTpInfo(SRowBuilder *pBuilder, int32_t nCols, int32_t flen);
int32_t
tdSRowSetExtendedInfo
(
SRowBuilder
*
pBuilder
,
int32_t
nCols
,
int32_t
nBoundCols
,
int32_t
flen
,
int32_t
tdSRowSetExtendedInfo
(
SRowBuilder
*
pBuilder
,
int32_t
nCols
,
int32_t
nBoundCols
,
int32_t
flen
,
int32_t
allNullLen
,
int32_t
boundNullLen
);
int32_t
allNullLen
,
int32_t
boundNullLen
);
int32_t
tdSRowResetBuf
(
SRowBuilder
*
pBuilder
,
void
*
pBuf
);
int32_t
tdSRowResetBuf
(
SRowBuilder
*
pBuilder
,
void
*
pBuf
);
int32_t
tdSRowEnd
(
SRowBuilder
*
pBuilder
);
int32_t
tdSRowGetBuf
(
SRowBuilder
*
pBuilder
,
void
*
pBuf
);
int32_t
tdSRowGetBuf
(
SRowBuilder
*
pBuilder
,
void
*
pBuf
);
int32_t
tdSRowInitEx
(
SRowBuilder
*
pBuilder
,
void
*
pBuf
,
uint32_t
allNullLen
,
uint32_t
boundNullLen
,
int32_t
nCols
,
int32_t
nBoundCols
,
int32_t
flen
);
void
tdSRowReset
(
SRowBuilder
*
pBuilder
);
void
tdSRowReset
(
SRowBuilder
*
pBuilder
);
int32_t
tdAppendColValToTpRow
(
SRowBuilder
*
pBuilder
,
TDRowValT
valType
,
const
void
*
val
,
bool
isCopyVarData
,
int32_t
tdAppendColValToTpRow
(
SRowBuilder
*
pBuilder
,
TDRowValT
valType
,
const
void
*
val
,
bool
isCopyVarData
,
int8_t
colType
,
int16_t
colIdx
,
int32_t
offset
);
int8_t
colType
,
int16_t
colIdx
,
int32_t
offset
);
...
...
source/client/src/tmq.c
浏览文件 @
a3166507
...
@@ -3129,6 +3129,7 @@ int taos_write_raw_block(TAOS *taos, int rows, char *pData, const char* tbname){
...
@@ -3129,6 +3129,7 @@ int taos_write_raw_block(TAOS *taos, int rows, char *pData, const char* tbname){
offset
+=
TYPE_BYTES
[
pColumn
->
type
];
offset
+=
TYPE_BYTES
[
pColumn
->
type
];
}
}
tdSRowEnd
(
&
rb
);
int32_t
rowLen
=
TD_ROW_LEN
(
rowData
);
int32_t
rowLen
=
TD_ROW_LEN
(
rowData
);
rowData
=
POINTER_SHIFT
(
rowData
,
rowLen
);
rowData
=
POINTER_SHIFT
(
rowData
,
rowLen
);
dataLen
+=
rowLen
;
dataLen
+=
rowLen
;
...
@@ -3360,6 +3361,7 @@ static int32_t tmqWriteRaw(TAOS *taos, void* data, int32_t dataLen){
...
@@ -3360,6 +3361,7 @@ static int32_t tmqWriteRaw(TAOS *taos, void* data, int32_t dataLen){
}
}
offset
+=
TYPE_BYTES
[
pColumn
->
type
];
offset
+=
TYPE_BYTES
[
pColumn
->
type
];
}
}
tdSRowEnd
(
&
rb
);
int32_t
rowLen
=
TD_ROW_LEN
(
rowData
);
int32_t
rowLen
=
TD_ROW_LEN
(
rowData
);
rowData
=
POINTER_SHIFT
(
rowData
,
rowLen
);
rowData
=
POINTER_SHIFT
(
rowData
,
rowLen
);
dataLen
+=
rowLen
;
dataLen
+=
rowLen
;
...
...
source/common/src/tdatablock.c
浏览文件 @
a3166507
...
@@ -1906,6 +1906,7 @@ int32_t buildSubmitReqFromDataBlock(SSubmitReq** pReq, const SArray* pDataBlocks
...
@@ -1906,6 +1906,7 @@ int32_t buildSubmitReqFromDataBlock(SSubmitReq** pReq, const SArray* pDataBlocks
}
}
offset
+=
TYPE_BYTES
[
pCol
->
type
];
// sum/avg would convert to int64_t/uint64_t/double during aggregation
offset
+=
TYPE_BYTES
[
pCol
->
type
];
// sum/avg would convert to int64_t/uint64_t/double during aggregation
}
}
tdSRowEnd
(
&
rb
);
dataLen
+=
TD_ROW_LEN
(
rb
.
pBuf
);
dataLen
+=
TD_ROW_LEN
(
rb
.
pBuf
);
#ifdef TD_DEBUG_PRINT_ROW
#ifdef TD_DEBUG_PRINT_ROW
tdSRowPrint
(
rb
.
pBuf
,
pTSchema
,
__func__
);
tdSRowPrint
(
rb
.
pBuf
,
pTSchema
,
__func__
);
...
...
source/common/src/trow.c
浏览文件 @
a3166507
...
@@ -666,6 +666,7 @@ int32_t tdSTSRowNew(SArray *pArray, STSchema *pTSchema, STSRow **ppRow) {
...
@@ -666,6 +666,7 @@ int32_t tdSTSRowNew(SArray *pArray, STSchema *pTSchema, STSRow **ppRow) {
++
iColVal
;
++
iColVal
;
}
}
tdSRowEnd
(
&
rb
);
taosMemoryFreeClear
(
varBuf
);
taosMemoryFreeClear
(
varBuf
);
...
@@ -880,26 +881,20 @@ int32_t tdGetKvRowValOfCol(SCellVal *output, STSRow *pRow, void *pBitmap, int32_
...
@@ -880,26 +881,20 @@ int32_t tdGetKvRowValOfCol(SCellVal *output, STSRow *pRow, void *pBitmap, int32_
int32_t
tdGetTpRowValOfCol
(
SCellVal
*
output
,
STSRow
*
pRow
,
void
*
pBitmap
,
int8_t
colType
,
int32_t
offset
,
int32_t
tdGetTpRowValOfCol
(
SCellVal
*
output
,
STSRow
*
pRow
,
void
*
pBitmap
,
int8_t
colType
,
int32_t
offset
,
int16_t
colIdx
)
{
int16_t
colIdx
)
{
#ifdef TD_SUPPORT_BITMAP
if
(
pRow
->
normal
)
{
if
(
tdGetBitmapValType
(
pBitmap
,
colIdx
,
&
output
->
valType
,
0
)
!=
TSDB_CODE_SUCCESS
)
{
output
->
valType
=
TD_VTYPE_NONE
;
return
terrno
;
}
if
(
tdValTypeIsNorm
(
output
->
valType
))
{
if
(
IS_VAR_DATA_TYPE
(
colType
))
{
if
(
IS_VAR_DATA_TYPE
(
colType
))
{
output
->
val
=
POINTER_SHIFT
(
pRow
,
*
(
VarDataOffsetT
*
)
POINTER_SHIFT
(
TD_ROW_DATA
(
pRow
),
offset
));
output
->
val
=
POINTER_SHIFT
(
pRow
,
*
(
VarDataOffsetT
*
)
POINTER_SHIFT
(
TD_ROW_DATA
(
pRow
),
offset
));
}
else
{
}
else
{
output
->
val
=
POINTER_SHIFT
(
TD_ROW_DATA
(
pRow
),
offset
);
output
->
val
=
POINTER_SHIFT
(
TD_ROW_DATA
(
pRow
),
offset
);
}
}
return
TSDB_CODE_SUCCESS
;
}
}
#else
if
(
IS_VAR_DATA_TYPE
(
colType
))
{
if
(
tdGetBitmapValType
(
pBitmap
,
colIdx
,
&
output
->
valType
,
0
)
!=
TSDB_CODE_SUCCESS
)
{
output
->
val
=
POINTER_SHIFT
(
pRow
,
*
(
VarDataOffsetT
*
)
POINTER_SHIFT
(
TD_ROW_DATA
(
pRow
),
offset
));
output
->
valType
=
TD_VTYPE_NONE
;
}
else
{
return
terrno
;
output
->
val
=
POINTER_SHIFT
(
TD_ROW_DATA
(
pRow
),
offset
);
}
}
output
->
valType
=
isNull
(
output
->
val
,
colType
)
?
TD_VTYPE_NULL
:
TD_VTYPE_NORM
;
#endif
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
@@ -925,6 +920,21 @@ int32_t tdAppendColValToRow(SRowBuilder *pBuilder, col_id_t colId, int8_t colTyp
...
@@ -925,6 +920,21 @@ int32_t tdAppendColValToRow(SRowBuilder *pBuilder, col_id_t colId, int8_t colTyp
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
// TODO: We can avoid the type judegement by FP, but would prevent the inline scheme.
// TODO: We can avoid the type judegement by FP, but would prevent the inline scheme.
switch
(
valType
)
{
case
TD_VTYPE_NORM
:
break
;
case
TD_VTYPE_NULL
:
++
pBuilder
->
nNull
;
break
;
case
TD_VTYPE_NONE
:
++
pBuilder
->
nNone
;
break
;
default:
ASSERT
(
0
);
break
;
}
if
(
TD_IS_TP_ROW
(
pRow
))
{
if
(
TD_IS_TP_ROW
(
pRow
))
{
tdAppendColValToTpRow
(
pBuilder
,
valType
,
val
,
isCopyVarData
,
colType
,
colIdx
,
offset
);
tdAppendColValToTpRow
(
pBuilder
,
valType
,
val
,
isCopyVarData
,
colType
,
colIdx
,
offset
);
}
else
{
}
else
{
...
@@ -1084,6 +1094,14 @@ int32_t tdSRowSetExtendedInfo(SRowBuilder *pBuilder, int32_t nCols, int32_t nBou
...
@@ -1084,6 +1094,14 @@ int32_t tdSRowSetExtendedInfo(SRowBuilder *pBuilder, int32_t nCols, int32_t nBou
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
int32_t
tdSRowEnd
(
SRowBuilder
*
pBuilder
)
{
STSRow
*
pRow
=
(
STSRow
*
)
pBuilder
->
pBuf
;
if
(
pBuilder
->
nNone
||
pBuilder
->
nNull
)
{
pRow
->
normal
=
1
;
}
return
TSDB_CODE_SUCCESS
;
}
int32_t
tdSRowResetBuf
(
SRowBuilder
*
pBuilder
,
void
*
pBuf
)
{
int32_t
tdSRowResetBuf
(
SRowBuilder
*
pBuilder
,
void
*
pBuf
)
{
pBuilder
->
pBuf
=
(
STSRow
*
)
pBuf
;
pBuilder
->
pBuf
=
(
STSRow
*
)
pBuf
;
if
(
!
pBuilder
->
pBuf
)
{
if
(
!
pBuilder
->
pBuf
)
{
...
@@ -1092,6 +1110,10 @@ int32_t tdSRowResetBuf(SRowBuilder *pBuilder, void *pBuf) {
...
@@ -1092,6 +1110,10 @@ int32_t tdSRowResetBuf(SRowBuilder *pBuilder, void *pBuf) {
return
terrno
;
return
terrno
;
}
}
if
(
pBuilder
->
nNone
)
pBuilder
->
nNone
=
0
;
if
(
pBuilder
->
nNull
)
pBuilder
->
nNull
=
0
;
pBuilder
->
nNull
=
0
;
TD_ROW_SET_INFO
(
pBuilder
->
pBuf
,
0
);
TD_ROW_SET_INFO
(
pBuilder
->
pBuf
,
0
);
TD_ROW_SET_TYPE
(
pBuilder
->
pBuf
,
pBuilder
->
rowType
);
TD_ROW_SET_TYPE
(
pBuilder
->
pBuf
,
pBuilder
->
rowType
);
...
@@ -1159,14 +1181,6 @@ int32_t tdSRowGetBuf(SRowBuilder *pBuilder, void *pBuf) {
...
@@ -1159,14 +1181,6 @@ int32_t tdSRowGetBuf(SRowBuilder *pBuilder, void *pBuf) {
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
int32_t
tdSRowInitEx
(
SRowBuilder
*
pBuilder
,
void
*
pBuf
,
uint32_t
allNullLen
,
uint32_t
boundNullLen
,
int32_t
nCols
,
int32_t
nBoundCols
,
int32_t
flen
)
{
if
(
tdSRowSetExtendedInfo
(
pBuilder
,
allNullLen
,
boundNullLen
,
nCols
,
nBoundCols
,
flen
)
<
0
)
{
return
terrno
;
}
return
tdSRowResetBuf
(
pBuilder
,
pBuf
);
}
void
tdSRowReset
(
SRowBuilder
*
pBuilder
)
{
void
tdSRowReset
(
SRowBuilder
*
pBuilder
)
{
pBuilder
->
rowType
=
TD_ROW_TP
;
pBuilder
->
rowType
=
TD_ROW_TP
;
pBuilder
->
pBuf
=
NULL
;
pBuilder
->
pBuf
=
NULL
;
...
...
source/dnode/vnode/src/tq/tqSink.c
浏览文件 @
a3166507
...
@@ -157,6 +157,7 @@ SSubmitReq* tdBlockToSubmit(const SArray* pBlocks, const STSchema* pTSchema, boo
...
@@ -157,6 +157,7 @@ SSubmitReq* tdBlockToSubmit(const SArray* pBlocks, const STSchema* pTSchema, boo
tdAppendColValToRow
(
&
rb
,
pColumn
->
colId
,
pColumn
->
type
,
TD_VTYPE_NORM
,
data
,
true
,
pColumn
->
offset
,
k
);
tdAppendColValToRow
(
&
rb
,
pColumn
->
colId
,
pColumn
->
type
,
TD_VTYPE_NORM
,
data
,
true
,
pColumn
->
offset
,
k
);
}
}
}
}
tdSRowEnd
(
&
rb
);
int32_t
rowLen
=
TD_ROW_LEN
(
rowData
);
int32_t
rowLen
=
TD_ROW_LEN
(
rowData
);
rowData
=
POINTER_SHIFT
(
rowData
,
rowLen
);
rowData
=
POINTER_SHIFT
(
rowData
,
rowLen
);
dataLen
+=
rowLen
;
dataLen
+=
rowLen
;
...
...
source/libs/executor/src/dataInserter.c
浏览文件 @
a3166507
...
@@ -213,6 +213,7 @@ int32_t dataBlockToSubmit(SDataInserterHandle* pInserter, SSubmitReq** pReq) {
...
@@ -213,6 +213,7 @@ int32_t dataBlockToSubmit(SDataInserterHandle* pInserter, SSubmitReq** pReq) {
tdAppendColValToRow
(
&
rb
,
pColumn
->
colId
,
pColumn
->
type
,
TD_VTYPE_NORM
,
data
,
true
,
pColumn
->
offset
,
k
);
tdAppendColValToRow
(
&
rb
,
pColumn
->
colId
,
pColumn
->
type
,
TD_VTYPE_NORM
,
data
,
true
,
pColumn
->
offset
,
k
);
}
}
}
}
tdSRowEnd
(
&
rb
);
if
(
ignoreRow
)
{
if
(
ignoreRow
)
{
continue
;
continue
;
...
...
source/libs/parser/src/parInsert.c
浏览文件 @
a3166507
...
@@ -1206,6 +1206,7 @@ static int parseOneRow(SInsertParseContext* pCxt, STableDataBlocks* pDataBlocks,
...
@@ -1206,6 +1206,7 @@ static int parseOneRow(SInsertParseContext* pCxt, STableDataBlocks* pDataBlocks,
}
}
// *len = pBuilder->extendedRowSize;
// *len = pBuilder->extendedRowSize;
tdSRowEnd
(
pBuilder
);
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
@@ -1973,6 +1974,7 @@ int32_t qBindStmtColsValue(void* pBlock, TAOS_MULTI_BIND* bind, char* msgBuf, in
...
@@ -1973,6 +1974,7 @@ int32_t qBindStmtColsValue(void* pBlock, TAOS_MULTI_BIND* bind, char* msgBuf, in
}
}
}
}
}
}
tdSRowEnd
(
pBuilder
);
#ifdef TD_DEBUG_PRINT_ROW
#ifdef TD_DEBUG_PRINT_ROW
STSchema
*
pSTSchema
=
tdGetSTSChemaFromSSChema
(
pSchema
,
spd
->
numOfCols
,
1
);
STSchema
*
pSTSchema
=
tdGetSTSChemaFromSSChema
(
pSchema
,
spd
->
numOfCols
,
1
);
tdSRowPrint
(
row
,
pSTSchema
,
__func__
);
tdSRowPrint
(
row
,
pSTSchema
,
__func__
);
...
@@ -2056,7 +2058,9 @@ int32_t qBindStmtSingleColValue(void* pBlock, TAOS_MULTI_BIND* bind, char* msgBu
...
@@ -2056,7 +2058,9 @@ int32_t qBindStmtSingleColValue(void* pBlock, TAOS_MULTI_BIND* bind, char* msgBu
}
}
}
}
}
}
if
(
rowEnd
)
{
tdSRowEnd
(
pBuilder
);
}
#ifdef TD_DEBUG_PRINT_ROW
#ifdef TD_DEBUG_PRINT_ROW
if
(
rowEnd
)
{
if
(
rowEnd
)
{
STSchema
*
pSTSchema
=
tdGetSTSChemaFromSSChema
(
pSchema
,
spd
->
numOfCols
,
1
);
STSchema
*
pSTSchema
=
tdGetSTSChemaFromSSChema
(
pSchema
,
spd
->
numOfCols
,
1
);
...
@@ -2436,6 +2440,7 @@ int32_t smlBindData(void* handle, SArray* tags, SArray* colsSchema, SArray* cols
...
@@ -2436,6 +2440,7 @@ int32_t smlBindData(void* handle, SArray* tags, SArray* colsSchema, SArray* cols
}
}
}
}
tdSRowEnd
(
pBuilder
);
pDataBlock
->
size
+=
extendedRowSize
;
pDataBlock
->
size
+=
extendedRowSize
;
}
}
...
...
source/libs/parser/src/parInsertData.c
浏览文件 @
a3166507
...
@@ -659,6 +659,7 @@ static int trimDataBlock(void* pDataBlock, STableDataBlocks* pTableDataBlock, SB
...
@@ -659,6 +659,7 @@ static int trimDataBlock(void* pDataBlock, STableDataBlocks* pTableDataBlock, SB
toffset
+=
TYPE_BYTES
[
colType
];
toffset
+=
TYPE_BYTES
[
colType
];
p
+=
pSchema
[
j
].
bytes
;
p
+=
pSchema
[
j
].
bytes
;
}
}
tdSRowEnd
(
&
builder
);
int32_t
rowLen
=
TD_ROW_LEN
((
STSRow
*
)
pDataBlock
);
int32_t
rowLen
=
TD_ROW_LEN
((
STSRow
*
)
pDataBlock
);
pDataBlock
=
(
char
*
)
pDataBlock
+
rowLen
;
pDataBlock
=
(
char
*
)
pDataBlock
+
rowLen
;
pBlock
->
dataLen
+=
rowLen
;
pBlock
->
dataLen
+=
rowLen
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录