Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f7d94f73
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
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看板
提交
f7d94f73
编写于
11月 30, 2022
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enh: support column mode write
上级
366f246f
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
19 addition
and
25 deletion
+19
-25
include/libs/parser/parser.h
include/libs/parser/parser.h
+1
-1
source/client/src/clientStmt.c
source/client/src/clientStmt.c
+8
-8
source/libs/parser/inc/parInsertUtil.h
source/libs/parser/inc/parInsertUtil.h
+2
-1
source/libs/parser/src/parInsertSql.c
source/libs/parser/src/parInsertSql.c
+2
-2
source/libs/parser/src/parInsertStmt.c
source/libs/parser/src/parInsertStmt.c
+5
-5
source/libs/parser/src/parInsertUtil.c
source/libs/parser/src/parInsertUtil.c
+1
-8
未找到文件。
include/libs/parser/parser.h
浏览文件 @
f7d94f73
...
...
@@ -86,7 +86,7 @@ void qCleanupKeywordsTable();
int32_t
qBuildStmtOutput
(
SQuery
*
pQuery
,
SHashObj
*
pVgHash
,
SHashObj
*
pBlockHash
);
int32_t
qResetStmtDataBlock
(
void
*
block
,
bool
keepBuf
);
int32_t
qCloneStmtDataBlock
(
void
**
pDst
,
void
*
pSrc
);
int32_t
qCloneStmtDataBlock
(
void
**
pDst
,
void
*
pSrc
,
bool
reset
);
int32_t
qRebuildStmtDataBlock
(
void
**
pDst
,
void
*
pSrc
,
uint64_t
uid
,
int32_t
vgId
);
void
qDestroyStmtDataBlock
(
void
*
pBlock
);
STableMeta
*
qGetTableMetaInDataBlock
(
void
*
pDataBlock
);
...
...
source/client/src/clientStmt.c
浏览文件 @
f7d94f73
...
...
@@ -214,16 +214,16 @@ int32_t stmtCacheBlock(STscStmt* pStmt) {
return
TSDB_CODE_SUCCESS
;
}
STableData
Blocks
**
pSrc
=
taosHashGet
(
pStmt
->
exec
.
pBlockHash
,
pStmt
->
bInfo
.
tbFName
,
strlen
(
pStmt
->
bInfo
.
tbFName
));
STableData
Cxt
**
pSrc
=
taosHashGet
(
pStmt
->
exec
.
pBlockHash
,
pStmt
->
bInfo
.
tbFName
,
strlen
(
pStmt
->
bInfo
.
tbFName
));
if
(
!
pSrc
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
STableData
Blocks
*
pDst
=
NULL
;
STableData
Cxt
*
pDst
=
NULL
;
STMT_ERR_RET
(
qCloneStmtDataBlock
(
&
pDst
,
*
pSrc
));
STMT_ERR_RET
(
qCloneStmtDataBlock
(
&
pDst
,
*
pSrc
,
true
));
SStmtTableCache
cache
=
{
.
pData
Block
=
pDst
,
.
pData
Ctx
=
pDst
,
.
boundTags
=
pStmt
->
bInfo
.
boundTags
,
};
...
...
@@ -289,7 +289,7 @@ int32_t stmtCleanExecInfo(STscStmt* pStmt, bool keepTable, bool deepClean) {
size_t
keyLen
=
0
;
void
*
pIter
=
taosHashIterate
(
pStmt
->
exec
.
pBlockHash
,
NULL
);
while
(
pIter
)
{
STableDataCxt
*
pBlocks
=
*
(
STableDataCxt
*
)
pIter
;
STableDataCxt
*
pBlocks
=
*
(
STableDataCxt
*
*
)
pIter
;
char
*
key
=
taosHashGetKey
(
pIter
,
&
keyLen
);
STableMeta
*
pMeta
=
qGetTableMetaInDataBlock
(
pBlocks
);
...
...
@@ -333,7 +333,7 @@ int32_t stmtCleanSQLInfo(STscStmt* pStmt) {
while
(
pIter
)
{
SStmtTableCache
*
pCache
=
(
SStmtTableCache
*
)
pIter
;
qDestroyStmtDataBlock
(
pCache
->
pData
Block
);
qDestroyStmtDataBlock
(
pCache
->
pData
Ctx
);
destroyBoundColumnInfo
(
pCache
->
boundTags
);
taosMemoryFreeClear
(
pCache
->
boundTags
);
...
...
@@ -775,9 +775,9 @@ int stmtUpdateTableUid(STscStmt* pStmt, SSubmitRsp* pRsp) {
int32_t
code
=
0
;
int32_t
finalCode
=
0
;
size_t
keyLen
=
0
;
STableDataCxt
*
*
pIter
=
taosHashIterate
(
pStmt
->
exec
.
pBlockHash
,
NULL
);
void
*
pIter
=
taosHashIterate
(
pStmt
->
exec
.
pBlockHash
,
NULL
);
while
(
pIter
)
{
STableData
Blocks
*
pBlock
=
*
pIter
;
STableData
Cxt
*
pBlock
=
*
(
STableDataCxt
**
)
pIter
;
char
*
key
=
taosHashGetKey
(
pIter
,
&
keyLen
);
STableMeta
*
pMeta
=
qGetTableMetaInDataBlock
(
pBlock
);
...
...
source/libs/parser/inc/parInsertUtil.h
浏览文件 @
f7d94f73
...
...
@@ -133,7 +133,7 @@ int32_t insMergeTableDataBlocks(SHashObj *pHashObj, SArray **pVgDataBlocks);
int32_t
insBuildCreateTbMsg
(
STableDataBlocks
*
pBlocks
,
SVCreateTbReq
*
pCreateTbReq
);
int32_t
insAllocateMemForSize
(
STableDataBlocks
*
pDataBlock
,
int32_t
allSize
);
int32_t
insCreateSName
(
SName
*
pName
,
struct
SToken
*
pTableName
,
int32_t
acctId
,
const
char
*
dbName
,
SMsgBuf
*
pMsgBuf
);
int
32_t
insFindCol
(
struct
SToken
*
pColname
,
int32_t
start
,
int32
_t
end
,
SSchema
*
pSchema
);
int
16_t
insFindCol
(
struct
SToken
*
pColname
,
int16_t
start
,
int16
_t
end
,
SSchema
*
pSchema
);
void
insBuildCreateTbReq
(
SVCreateTbReq
*
pTbReq
,
const
char
*
tname
,
STag
*
pTag
,
int64_t
suid
,
const
char
*
sname
,
SArray
*
tagName
,
uint8_t
tagNum
,
int32_t
ttl
);
int32_t
insMemRowAppend
(
SMsgBuf
*
pMsgBuf
,
const
void
*
value
,
int32_t
len
,
void
*
param
);
...
...
@@ -173,5 +173,6 @@ void insDestroyTableDataCxtHashMap(SHashObj *pTableCxtHash);
void
insDestroyVgroupDataCxt
(
SVgroupDataCxt
*
pVgCxt
);
void
insDestroyVgroupDataCxtList
(
SArray
*
pVgCxtList
);
void
insDestroyVgroupDataCxtHashMap
(
SHashObj
*
pVgCxtHash
);
void
insDestroyTableDataCxt
(
STableDataCxt
*
pTableCxt
);
#endif // TDENGINE_PAR_INSERT_UTIL_H
source/libs/parser/src/parInsertSql.c
浏览文件 @
f7d94f73
...
...
@@ -928,7 +928,7 @@ int32_t initTableColSubmitData(STableDataCxt* pTableCxt) {
}
for
(
int32_t
i
=
0
;
i
<
pTableCxt
->
boundColsInfo
.
numOfBound
;
++
i
)
{
SSchema
*
pSchema
=
pTableCxt
->
pMeta
->
schema
[
pTableCxt
->
boundColsInfo
.
pColIndex
[
i
]];
SSchema
*
pSchema
=
&
pTableCxt
->
pMeta
->
schema
[
pTableCxt
->
boundColsInfo
.
pColIndex
[
i
]];
SColData
*
pCol
=
taosArrayReserve
(
pTableCxt
->
pData
->
aCol
,
1
);
if
(
NULL
==
pCol
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
...
...
@@ -1193,7 +1193,7 @@ static int parseOneRow(SInsertParseContext* pCxt, const char** pSql, STableDataC
}
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
if
(
TSDB_CODE_SUCCESS
==
code
&&
!
isParseBindParam
)
{
SRow
**
pRow
=
taosArrayReserve
(
pTableCxt
->
pData
->
aRowP
,
1
);
code
=
tRowBuild
(
pTableCxt
->
pValues
,
pTableCxt
->
pSchema
,
pRow
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
...
...
source/libs/parser/src/parInsertStmt.c
浏览文件 @
f7d94f73
...
...
@@ -141,7 +141,7 @@ int32_t qBindStmtTagsValue(void* pBlock, void* boundTags, int64_t suid, const ch
goto
end
;
}
insBuildCreateTbReq
(
pDataBlock
->
pData
->
pCreateTbReq
,
tName
,
pTag
,
suid
,
sTableName
,
tagName
,
pDataBlock
->
pMeta
->
tableInfo
.
numOfTags
);
insBuildCreateTbReq
(
pDataBlock
->
pData
->
pCreateTbReq
,
tName
,
pTag
,
suid
,
sTableName
,
tagName
,
pDataBlock
->
pMeta
->
tableInfo
.
numOfTags
,
TSDB_DEFAULT_TABLE_TTL
);
end:
for
(
int
i
=
0
;
i
<
taosArrayGetSize
(
pTagArray
);
++
i
)
{
...
...
@@ -203,7 +203,7 @@ int32_t qBindStmtSingleColValue(void* pBlock, TAOS_MULTI_BIND* bind, char* msgBu
return
TSDB_CODE_SUCCESS
;
}
int32_t
buildBoundFields
(
int32_t
numOfBound
,
int16_t
boundColumns
,
SSchema
*
pSchema
,
int32_t
*
fieldNum
,
TAOS_FIELD_E
**
fields
,
int32_t
buildBoundFields
(
int32_t
numOfBound
,
int16_t
*
boundColumns
,
SSchema
*
pSchema
,
int32_t
*
fieldNum
,
TAOS_FIELD_E
**
fields
,
uint8_t
timePrec
)
{
if
(
fields
)
{
*
fields
=
taosMemoryCalloc
(
numOfBound
,
sizeof
(
TAOS_FIELD
));
...
...
@@ -265,7 +265,7 @@ int32_t qBuildStmtColFields(void* pBlock, int32_t* fieldNum, TAOS_FIELD_E** fiel
return
TSDB_CODE_SUCCESS
;
}
CHECK_CODE
(
buildBoundFields
(
&
pDataBlock
->
boundColsInfo
.
numOfBound
,
pDataBlock
->
boundColsInfo
.
pColIndex
,
pSchema
,
fieldNum
,
fields
,
CHECK_CODE
(
buildBoundFields
(
pDataBlock
->
boundColsInfo
.
numOfBound
,
pDataBlock
->
boundColsInfo
.
pColIndex
,
pSchema
,
fieldNum
,
fields
,
pDataBlock
->
pMeta
->
tableInfo
.
precision
));
return
TSDB_CODE_SUCCESS
;
...
...
@@ -338,12 +338,12 @@ int32_t qCloneStmtDataBlock(void** pDst, void* pSrc, bool reset) {
insDestroyTableDataCxt
(
*
pDst
);
return
TSDB_CODE_OUT_OF_MEMORY
;
}
pNewCxt
->
pData
=
pNewTb
;
if
(
reset
)
{
code
=
qResetStmtDataBlock
(
*
pDst
,
true
);
}
pNewCxt
->
pData
=
pNewTb
;
}
...
...
source/libs/parser/src/parInsertUtil.c
浏览文件 @
f7d94f73
...
...
@@ -1230,14 +1230,7 @@ int32_t insMergeTableDataCxt(SHashObj* pTableHash, SArray** pVgDataBlocks) {
if
(
colFormat
)
{
taosArraySort
(
pTableCxt
->
pData
->
aCol
,
insColDataComp
);
int32_t
colNum
=
taosArrayGetSize
(
pTableCxt
->
pData
->
aCol
);
for
(
int32_t
i
=
0
;
i
<
colNum
;
++
i
)
{
SColData
*
pCol
=
taosArrayGet
(
pTableCxt
->
pData
->
aCol
,
i
);
code
=
tColDataSortMerge
(
pCol
);
if
(
code
)
{
break
;
}
}
tColDataSortMerge
(
pTableCxt
->
pData
->
aCol
);
}
else
{
if
(
!
pTableCxt
->
ordered
)
{
tRowSort
(
pTableCxt
->
pData
->
aRowP
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录