2022-01-24 03:29:46 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
|
|
|
|
|
*
|
|
|
|
|
* This program is free software: you can use, redistribute, and/or modify
|
|
|
|
|
* it under the terms of the GNU Affero General Public License, version 3
|
|
|
|
|
* or later ("AGPL"), as published by the Free Software Foundation.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
|
2022-02-28 09:56:38 +00:00
|
|
|
#ifndef _TD_PARSER_INT_H_
|
|
|
|
|
#define _TD_PARSER_INT_H_
|
2022-01-24 03:29:46 +00:00
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2022-04-16 11:41:18 +00:00
|
|
|
#include "parToken.h"
|
|
|
|
|
#include "parUtil.h"
|
2023-10-09 10:34:08 +00:00
|
|
|
#include "parTranslater.h"
|
2022-04-26 03:50:35 +00:00
|
|
|
#include "parser.h"
|
2022-04-16 11:41:18 +00:00
|
|
|
|
2022-06-11 10:21:47 +00:00
|
|
|
#define QUERY_SMA_OPTIMIZE_DISABLE 0
|
|
|
|
|
#define QUERY_SMA_OPTIMIZE_ENABLE 1
|
|
|
|
|
|
2022-11-04 07:21:38 +00:00
|
|
|
int32_t parseInsertSql(SParseContext* pCxt, SQuery** pQuery, SCatalogReq* pCatalogReq, const SMetaData* pMetaData);
|
2024-07-09 01:10:27 +00:00
|
|
|
int32_t continueCreateTbFromFile(SParseContext* pCxt, SQuery** pQuery);
|
2022-04-02 11:57:44 +00:00
|
|
|
int32_t parse(SParseContext* pParseCxt, SQuery** pQuery);
|
2022-06-11 13:32:29 +00:00
|
|
|
int32_t collectMetaKey(SParseContext* pParseCxt, SQuery* pQuery, SParseMetaCache* pMetaCache);
|
|
|
|
|
int32_t authenticate(SParseContext* pParseCxt, SQuery* pQuery, SParseMetaCache* pMetaCache);
|
|
|
|
|
int32_t translate(SParseContext* pParseCxt, SQuery* pQuery, SParseMetaCache* pMetaCache);
|
2022-03-31 06:19:11 +00:00
|
|
|
int32_t extractResultSchema(const SNode* pRoot, int32_t* numOfCols, SSchema** pSchema);
|
2022-04-02 11:57:44 +00:00
|
|
|
int32_t calculateConstant(SParseContext* pParseCxt, SQuery* pQuery);
|
2024-02-01 03:37:57 +00:00
|
|
|
int32_t translatePostCreateStream(SParseContext* pParseCxt, SQuery* pQuery, SSDataBlock* pBlock);
|
|
|
|
|
int32_t translatePostCreateSmaIndex(SParseContext* pParseCxt, SQuery* pQuery, SSDataBlock* pBlock);
|
2024-02-20 09:09:48 +00:00
|
|
|
int32_t translatePostCreateTSMA(SParseContext* pParseCxt, SQuery* pQuery, SSDataBlock* pBlock);
|
2023-10-30 11:14:31 +00:00
|
|
|
int32_t buildQueryAfterParse(SQuery** pQuery, SNode* pRootNode, int16_t placeholderNo, SArray** pPlaceholderValues);
|
2023-11-29 12:06:30 +00:00
|
|
|
int32_t translateTable(STranslateContext* pCxt, SNode** pTable, SNode* pJoinParent);
|
2023-10-08 10:36:06 +00:00
|
|
|
int32_t getMetaDataFromHash(const char* pKey, int32_t len, SHashObj* pHash, void** pOutput);
|
2023-10-27 03:36:17 +00:00
|
|
|
void tfreeSParseQueryRes(void* p);
|
2022-01-24 03:29:46 +00:00
|
|
|
|
2023-10-08 10:36:06 +00:00
|
|
|
#ifdef TD_ENTERPRISE
|
|
|
|
|
int32_t translateView(STranslateContext* pCxt, SNode** pTable, SName* pName);
|
2023-10-19 00:31:31 +00:00
|
|
|
int32_t getViewMetaFromMetaCache(STranslateContext* pCxt, SName* pName, SViewMeta** ppViewMeta);
|
2023-10-08 10:36:06 +00:00
|
|
|
#endif
|
2022-01-24 03:29:46 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2022-02-28 09:56:38 +00:00
|
|
|
#endif /*_TD_PARSER_INT_H_*/
|