2022-01-23 12:34:16 +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-01-24 03:29:46 +00:00
|
|
|
#ifndef _TD_AST_CREATE_FUNCS_H_
|
|
|
|
|
#define _TD_AST_CREATE_FUNCS_H_
|
2022-01-23 12:34:16 +00:00
|
|
|
|
2022-01-24 03:29:46 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2022-03-01 02:13:22 +00:00
|
|
|
#include "cmdnodes.h"
|
2022-03-10 07:36:06 +00:00
|
|
|
#include "parToken.h"
|
|
|
|
|
#include "parUtil.h"
|
2022-04-26 03:50:35 +00:00
|
|
|
#include "parser.h"
|
2022-02-28 09:56:38 +00:00
|
|
|
#include "querynodes.h"
|
2022-02-07 21:09:35 +00:00
|
|
|
|
2022-02-28 09:56:38 +00:00
|
|
|
typedef struct SAstCreateContext {
|
|
|
|
|
SParseContext* pQueryCxt;
|
2022-04-26 03:50:35 +00:00
|
|
|
SMsgBuf msgBuf;
|
|
|
|
|
bool notSupport;
|
|
|
|
|
SNode* pRootNode;
|
|
|
|
|
int16_t placeholderNo;
|
2022-05-12 12:33:52 +00:00
|
|
|
SArray* pPlaceholderValues;
|
2022-04-28 13:02:11 +00:00
|
|
|
int32_t errCode;
|
2022-02-28 09:56:38 +00:00
|
|
|
} SAstCreateContext;
|
|
|
|
|
|
2022-03-07 12:18:05 +00:00
|
|
|
typedef enum EDatabaseOptionType {
|
2022-04-27 10:18:37 +00:00
|
|
|
DB_OPTION_BUFFER = 1,
|
2022-07-16 03:47:26 +00:00
|
|
|
DB_OPTION_CACHEMODEL,
|
|
|
|
|
DB_OPTION_CACHESIZE,
|
2022-03-07 12:18:05 +00:00
|
|
|
DB_OPTION_COMP,
|
|
|
|
|
DB_OPTION_DAYS,
|
|
|
|
|
DB_OPTION_FSYNC,
|
|
|
|
|
DB_OPTION_MAXROWS,
|
|
|
|
|
DB_OPTION_MINROWS,
|
|
|
|
|
DB_OPTION_KEEP,
|
2022-04-27 10:18:37 +00:00
|
|
|
DB_OPTION_PAGES,
|
|
|
|
|
DB_OPTION_PAGESIZE,
|
2022-09-13 06:19:50 +00:00
|
|
|
DB_OPTION_TSDB_PAGESIZE,
|
2022-03-07 12:18:05 +00:00
|
|
|
DB_OPTION_PRECISION,
|
|
|
|
|
DB_OPTION_REPLICA,
|
2022-04-27 10:18:37 +00:00
|
|
|
DB_OPTION_STRICT,
|
2022-03-07 12:18:05 +00:00
|
|
|
DB_OPTION_WAL,
|
|
|
|
|
DB_OPTION_VGROUPS,
|
2022-03-16 11:28:40 +00:00
|
|
|
DB_OPTION_SINGLE_STABLE,
|
2022-05-25 13:20:11 +00:00
|
|
|
DB_OPTION_RETENTIONS,
|
2022-07-25 13:09:06 +00:00
|
|
|
DB_OPTION_SCHEMALESS,
|
|
|
|
|
DB_OPTION_WAL_RETENTION_PERIOD,
|
|
|
|
|
DB_OPTION_WAL_RETENTION_SIZE,
|
|
|
|
|
DB_OPTION_WAL_ROLL_PERIOD,
|
2022-09-01 11:01:37 +00:00
|
|
|
DB_OPTION_WAL_SEGMENT_SIZE,
|
2022-09-13 06:19:50 +00:00
|
|
|
DB_OPTION_STT_TRIGGER,
|
2022-09-03 03:22:36 +00:00
|
|
|
DB_OPTION_TABLE_PREFIX,
|
2023-09-19 10:44:27 +00:00
|
|
|
DB_OPTION_TABLE_SUFFIX,
|
2024-04-08 02:31:26 +00:00
|
|
|
DB_OPTION_S3_CHUNKSIZE,
|
|
|
|
|
DB_OPTION_S3_KEEPLOCAL,
|
|
|
|
|
DB_OPTION_S3_COMPACT,
|
2024-03-26 11:56:15 +00:00
|
|
|
DB_OPTION_KEEP_TIME_OFFSET,
|
|
|
|
|
DB_OPTION_ENCRYPT_ALGORITHM,
|
2022-03-07 12:18:05 +00:00
|
|
|
} EDatabaseOptionType;
|
|
|
|
|
|
|
|
|
|
typedef enum ETableOptionType {
|
2022-04-27 10:18:37 +00:00
|
|
|
TABLE_OPTION_COMMENT = 1,
|
2022-06-16 03:13:59 +00:00
|
|
|
TABLE_OPTION_MAXDELAY,
|
|
|
|
|
TABLE_OPTION_WATERMARK,
|
2022-04-27 10:18:37 +00:00
|
|
|
TABLE_OPTION_ROLLUP,
|
|
|
|
|
TABLE_OPTION_TTL,
|
2022-12-06 08:07:11 +00:00
|
|
|
TABLE_OPTION_SMA,
|
|
|
|
|
TABLE_OPTION_DELETE_MARK
|
2022-03-07 12:18:05 +00:00
|
|
|
} ETableOptionType;
|
2022-03-02 02:50:51 +00:00
|
|
|
|
2024-03-07 10:06:15 +00:00
|
|
|
typedef enum EColumnOptionType {
|
|
|
|
|
COLUMN_OPTION_COMMENT = 1,
|
|
|
|
|
COLUMN_OPTION_ENCODE,
|
|
|
|
|
COLUMN_OPTION_COMPRESS,
|
|
|
|
|
COLUMN_OPTION_LEVEL,
|
2024-03-14 11:06:34 +00:00
|
|
|
COLUMN_OPTION_PRIMARYKEY,
|
2024-03-07 10:06:15 +00:00
|
|
|
} EColumnOptionType;
|
|
|
|
|
|
2022-03-16 11:28:40 +00:00
|
|
|
typedef struct SAlterOption {
|
2022-04-27 10:18:37 +00:00
|
|
|
int32_t type;
|
|
|
|
|
SToken val;
|
|
|
|
|
SNodeList* pList;
|
2022-03-16 11:28:40 +00:00
|
|
|
} SAlterOption;
|
|
|
|
|
|
2023-03-28 10:43:58 +00:00
|
|
|
typedef struct STokenPair {
|
|
|
|
|
SToken first;
|
|
|
|
|
SToken second;
|
|
|
|
|
} STokenPair;
|
|
|
|
|
|
2023-09-19 08:14:17 +00:00
|
|
|
typedef struct SShowTablesOption {
|
|
|
|
|
EShowKind kind;
|
2024-04-08 02:31:26 +00:00
|
|
|
SToken dbName;
|
2023-09-19 08:14:17 +00:00
|
|
|
} SShowTablesOption;
|
|
|
|
|
|
2022-01-27 06:32:40 +00:00
|
|
|
extern SToken nil_token;
|
|
|
|
|
|
2022-03-01 02:13:22 +00:00
|
|
|
void initAstCreateContext(SParseContext* pParseCxt, SAstCreateContext* pCxt);
|
|
|
|
|
|
2022-02-08 03:56:41 +00:00
|
|
|
SNode* createRawExprNode(SAstCreateContext* pCxt, const SToken* pToken, SNode* pNode);
|
|
|
|
|
SNode* createRawExprNodeExt(SAstCreateContext* pCxt, const SToken* pStart, const SToken* pEnd, SNode* pNode);
|
2023-09-20 03:06:59 +00:00
|
|
|
SNode* setRawExprNodeIsPseudoColumn(SAstCreateContext* pCxt, SNode* pNode, bool isPseudoColumn);
|
2022-02-08 03:56:41 +00:00
|
|
|
SNode* releaseRawExprNode(SAstCreateContext* pCxt, SNode* pNode);
|
|
|
|
|
SToken getTokenFromRawExprNode(SAstCreateContext* pCxt, SNode* pNode);
|
2022-02-07 21:09:35 +00:00
|
|
|
|
2022-01-27 06:32:40 +00:00
|
|
|
SNodeList* createNodeList(SAstCreateContext* pCxt, SNode* pNode);
|
2022-01-24 03:29:46 +00:00
|
|
|
SNodeList* addNodeToList(SAstCreateContext* pCxt, SNodeList* pList, SNode* pNode);
|
2022-01-27 06:32:40 +00:00
|
|
|
|
2024-05-30 11:41:22 +00:00
|
|
|
SNode* createColumnNode(SAstCreateContext* pCxt, SToken* pTableAlias, SToken* pColumnName);
|
|
|
|
|
SNode* createValueNode(SAstCreateContext* pCxt, int32_t dataType, const SToken* pLiteral);
|
|
|
|
|
SNode* createRawValueNode(SAstCreateContext* pCxt, int32_t dataType, const SToken* pLiteral, SNode* pNode);
|
|
|
|
|
SNode* createRawValueNodeExt(SAstCreateContext* pCxt, int32_t dataType, const SToken* pLiteral, SNode* pLeft,
|
|
|
|
|
SNode* pRight);
|
2023-08-16 06:28:39 +00:00
|
|
|
SNodeList* createHintNodeList(SAstCreateContext* pCxt, const SToken* pLiteral);
|
2024-05-30 11:41:22 +00:00
|
|
|
SNode* createIdentifierValueNode(SAstCreateContext* pCxt, SToken* pLiteral);
|
|
|
|
|
SNode* createDurationValueNode(SAstCreateContext* pCxt, const SToken* pLiteral);
|
|
|
|
|
SNode* createTimeOffsetValueNode(SAstCreateContext* pCxt, const SToken* pLiteral);
|
|
|
|
|
SNode* createDefaultDatabaseCondValue(SAstCreateContext* pCxt);
|
|
|
|
|
SNode* createPlaceholderValueNode(SAstCreateContext* pCxt, const SToken* pLiteral);
|
|
|
|
|
SNode* setProjectionAlias(SAstCreateContext* pCxt, SNode* pNode, SToken* pAlias);
|
|
|
|
|
SNode* createLogicConditionNode(SAstCreateContext* pCxt, ELogicConditionType type, SNode* pParam1, SNode* pParam2);
|
|
|
|
|
SNode* createOperatorNode(SAstCreateContext* pCxt, EOperatorType type, SNode* pLeft, SNode* pRight);
|
|
|
|
|
SNode* createBetweenAnd(SAstCreateContext* pCxt, SNode* pExpr, SNode* pLeft, SNode* pRight);
|
|
|
|
|
SNode* createNotBetweenAnd(SAstCreateContext* pCxt, SNode* pExpr, SNode* pLeft, SNode* pRight);
|
|
|
|
|
SNode* createFunctionNode(SAstCreateContext* pCxt, const SToken* pFuncName, SNodeList* pParameterList);
|
|
|
|
|
SNode* createCastFunctionNode(SAstCreateContext* pCxt, SNode* pExpr, SDataType dt);
|
|
|
|
|
SNode* createNodeListNode(SAstCreateContext* pCxt, SNodeList* pList);
|
|
|
|
|
SNode* createNodeListNodeEx(SAstCreateContext* pCxt, SNode* p1, SNode* p2);
|
|
|
|
|
SNode* createRealTableNode(SAstCreateContext* pCxt, SToken* pDbName, SToken* pTableName, SToken* pTableAlias);
|
2024-07-04 06:53:34 +00:00
|
|
|
SNode* createTempTableNode(SAstCreateContext* pCxt, SNode* pSubquery, SToken* pTableAlias);
|
2024-05-30 11:41:22 +00:00
|
|
|
SNode* createJoinTableNode(SAstCreateContext* pCxt, EJoinType type, EJoinSubType stype, SNode* pLeft, SNode* pRight,
|
|
|
|
|
SNode* pJoinCond);
|
|
|
|
|
SNode* createViewNode(SAstCreateContext* pCxt, SToken* pDbName, SToken* pViewName);
|
|
|
|
|
SNode* createLimitNode(SAstCreateContext* pCxt, const SToken* pLimit, const SToken* pOffset);
|
|
|
|
|
SNode* createOrderByExprNode(SAstCreateContext* pCxt, SNode* pExpr, EOrder order, ENullOrder nullOrder);
|
|
|
|
|
SNode* createSessionWindowNode(SAstCreateContext* pCxt, SNode* pCol, SNode* pGap);
|
|
|
|
|
SNode* createStateWindowNode(SAstCreateContext* pCxt, SNode* pExpr);
|
|
|
|
|
SNode* createEventWindowNode(SAstCreateContext* pCxt, SNode* pStartCond, SNode* pEndCond);
|
|
|
|
|
SNode* createCountWindowNode(SAstCreateContext* pCxt, const SToken* pCountToken, const SToken* pSlidingToken);
|
|
|
|
|
SNode* createIntervalWindowNode(SAstCreateContext* pCxt, SNode* pInterval, SNode* pOffset, SNode* pSliding,
|
|
|
|
|
SNode* pFill);
|
|
|
|
|
SNode* createWindowOffsetNode(SAstCreateContext* pCxt, SNode* pStartOffset, SNode* pEndOffset);
|
|
|
|
|
SNode* createFillNode(SAstCreateContext* pCxt, EFillMode mode, SNode* pValues);
|
|
|
|
|
SNode* createGroupingSetNode(SAstCreateContext* pCxt, SNode* pNode);
|
|
|
|
|
SNode* createInterpTimeRange(SAstCreateContext* pCxt, SNode* pStart, SNode* pEnd);
|
|
|
|
|
SNode* createInterpTimePoint(SAstCreateContext* pCxt, SNode* pPoint);
|
|
|
|
|
SNode* createWhenThenNode(SAstCreateContext* pCxt, SNode* pWhen, SNode* pThen);
|
|
|
|
|
SNode* createCaseWhenNode(SAstCreateContext* pCxt, SNode* pCase, SNodeList* pWhenThenList, SNode* pElse);
|
2022-01-27 06:32:40 +00:00
|
|
|
|
|
|
|
|
SNode* addWhereClause(SAstCreateContext* pCxt, SNode* pStmt, SNode* pWhere);
|
|
|
|
|
SNode* addPartitionByClause(SAstCreateContext* pCxt, SNode* pStmt, SNodeList* pPartitionByList);
|
|
|
|
|
SNode* addWindowClauseClause(SAstCreateContext* pCxt, SNode* pStmt, SNode* pWindow);
|
|
|
|
|
SNode* addGroupByClause(SAstCreateContext* pCxt, SNode* pStmt, SNodeList* pGroupByList);
|
|
|
|
|
SNode* addHavingClause(SAstCreateContext* pCxt, SNode* pStmt, SNode* pHaving);
|
|
|
|
|
SNode* addOrderByClause(SAstCreateContext* pCxt, SNode* pStmt, SNodeList* pOrderByList);
|
|
|
|
|
SNode* addSlimitClause(SAstCreateContext* pCxt, SNode* pStmt, SNode* pSlimit);
|
|
|
|
|
SNode* addLimitClause(SAstCreateContext* pCxt, SNode* pStmt, SNode* pLimit);
|
2022-06-19 11:39:12 +00:00
|
|
|
SNode* addRangeClause(SAstCreateContext* pCxt, SNode* pStmt, SNode* pRange);
|
|
|
|
|
SNode* addEveryClause(SAstCreateContext* pCxt, SNode* pStmt, SNode* pEvery);
|
|
|
|
|
SNode* addFillClause(SAstCreateContext* pCxt, SNode* pStmt, SNode* pFill);
|
2023-11-27 12:01:00 +00:00
|
|
|
SNode* addJLimitClause(SAstCreateContext* pCxt, SNode* pJoin, SNode* pJLimit);
|
|
|
|
|
SNode* addWindowOffsetClause(SAstCreateContext* pCxt, SNode* pJoin, SNode* pWinOffset);
|
2024-05-30 11:41:22 +00:00
|
|
|
SNode* createSelectStmt(SAstCreateContext* pCxt, bool isDistinct, SNodeList* pProjectionList, SNode* pTable,
|
|
|
|
|
SNodeList* pHint);
|
2023-08-15 07:16:57 +00:00
|
|
|
SNode* setSelectStmtTagMode(SAstCreateContext* pCxt, SNode* pStmt, bool bSelectTags);
|
2022-01-24 03:29:46 +00:00
|
|
|
SNode* createSetOperator(SAstCreateContext* pCxt, ESetOperatorType type, SNode* pLeft, SNode* pRight);
|
2022-01-27 06:32:40 +00:00
|
|
|
|
2022-03-03 12:25:16 +00:00
|
|
|
SDataType createDataType(uint8_t type);
|
|
|
|
|
SDataType createVarLenDataType(uint8_t type, const SToken* pLen);
|
2022-04-27 10:18:37 +00:00
|
|
|
|
|
|
|
|
SNode* createDefaultDatabaseOptions(SAstCreateContext* pCxt);
|
|
|
|
|
SNode* createAlterDatabaseOptions(SAstCreateContext* pCxt);
|
|
|
|
|
SNode* setDatabaseOption(SAstCreateContext* pCxt, SNode* pOptions, EDatabaseOptionType type, void* pVal);
|
|
|
|
|
SNode* setAlterDatabaseOption(SAstCreateContext* pCxt, SNode* pOptions, SAlterOption* pAlterOption);
|
|
|
|
|
SNode* createCreateDatabaseStmt(SAstCreateContext* pCxt, bool ignoreExists, SToken* pDbName, SNode* pOptions);
|
|
|
|
|
SNode* createDropDatabaseStmt(SAstCreateContext* pCxt, bool ignoreNotExists, SToken* pDbName);
|
|
|
|
|
SNode* createAlterDatabaseStmt(SAstCreateContext* pCxt, SToken* pDbName, SNode* pOptions);
|
2022-06-29 10:20:27 +00:00
|
|
|
SNode* createFlushDatabaseStmt(SAstCreateContext* pCxt, SToken* pDbName);
|
2022-09-26 10:39:47 +00:00
|
|
|
SNode* createTrimDatabaseStmt(SAstCreateContext* pCxt, SToken* pDbName, int32_t maxSpeed);
|
2024-04-08 02:31:26 +00:00
|
|
|
SNode* createS3MigrateDatabaseStmt(SAstCreateContext* pCxt, SToken* pDbName);
|
2023-03-07 07:24:04 +00:00
|
|
|
SNode* createCompactStmt(SAstCreateContext* pCxt, SToken* pDbName, SNode* pStart, SNode* pEnd);
|
2022-04-27 10:18:37 +00:00
|
|
|
SNode* createDefaultTableOptions(SAstCreateContext* pCxt);
|
|
|
|
|
SNode* createAlterTableOptions(SAstCreateContext* pCxt);
|
|
|
|
|
SNode* setTableOption(SAstCreateContext* pCxt, SNode* pOptions, ETableOptionType type, void* pVal);
|
2024-03-14 11:56:19 +00:00
|
|
|
SNode* createColumnDefNode(SAstCreateContext* pCxt, SToken* pColName, SDataType dataType, SNode* pOptions);
|
2024-03-11 03:39:19 +00:00
|
|
|
SNode* setColumnOptions(SAstCreateContext* pCxt, SNode* pOptions, EColumnOptionType type, void* pVal);
|
2024-03-07 10:06:15 +00:00
|
|
|
SNode* createDefaultColumnOptions(SAstCreateContext* pCxt);
|
2022-04-27 10:18:37 +00:00
|
|
|
SNode* createCreateTableStmt(SAstCreateContext* pCxt, bool ignoreExists, SNode* pRealTable, SNodeList* pCols,
|
|
|
|
|
SNodeList* pTags, SNode* pOptions);
|
2022-04-26 03:50:35 +00:00
|
|
|
SNode* createCreateSubTableClause(SAstCreateContext* pCxt, bool ignoreExists, SNode* pRealTable, SNode* pUseRealTable,
|
2022-04-27 10:18:37 +00:00
|
|
|
SNodeList* pSpecificTags, SNodeList* pValsOfTags, SNode* pOptions);
|
2024-06-24 14:13:03 +00:00
|
|
|
SNode* createCreateSubTableFromFileClause(SAstCreateContext* pCxt, bool ignoreExists, SNode* pUseRealTable,
|
|
|
|
|
SNodeList* pSpecificTags, const SToken* pFilePath);
|
2022-03-05 23:12:08 +00:00
|
|
|
SNode* createCreateMultiTableStmt(SAstCreateContext* pCxt, SNodeList* pSubTables);
|
2022-03-07 12:18:05 +00:00
|
|
|
SNode* createDropTableClause(SAstCreateContext* pCxt, bool ignoreNotExists, SNode* pRealTable);
|
|
|
|
|
SNode* createDropTableStmt(SAstCreateContext* pCxt, SNodeList* pTables);
|
2022-03-08 09:25:26 +00:00
|
|
|
SNode* createDropSuperTableStmt(SAstCreateContext* pCxt, bool ignoreNotExists, SNode* pRealTable);
|
2022-04-27 10:18:37 +00:00
|
|
|
SNode* createAlterTableModifyOptions(SAstCreateContext* pCxt, SNode* pRealTable, SNode* pOptions);
|
2023-08-24 05:42:51 +00:00
|
|
|
SNode* createAlterTableAddModifyCol(SAstCreateContext* pCxt, SNode* pRealTable, int8_t alterType, SToken* pColName,
|
|
|
|
|
SDataType dataType);
|
2024-05-30 11:41:22 +00:00
|
|
|
|
|
|
|
|
SNode* createAlterTableAddModifyColOptions2(SAstCreateContext* pCxt, SNode* pRealTable, int8_t alterType,
|
|
|
|
|
SToken* pColName, SDataType dataType, SNode* pOptions);
|
|
|
|
|
|
|
|
|
|
SNode* createAlterTableAddModifyColOptions(SAstCreateContext* pCxt, SNode* pRealTable, int8_t alterType,
|
|
|
|
|
SToken* pColName, SNode* pOptions);
|
2022-05-24 09:37:53 +00:00
|
|
|
SNode* createAlterTableDropCol(SAstCreateContext* pCxt, SNode* pRealTable, int8_t alterType, SToken* pColName);
|
|
|
|
|
SNode* createAlterTableRenameCol(SAstCreateContext* pCxt, SNode* pRealTable, int8_t alterType, SToken* pOldColName,
|
|
|
|
|
SToken* pNewColName);
|
|
|
|
|
SNode* createAlterTableSetTag(SAstCreateContext* pCxt, SNode* pRealTable, SToken* pTagName, SNode* pVal);
|
2022-07-02 10:19:10 +00:00
|
|
|
SNode* setAlterSuperTableType(SNode* pStmt);
|
2022-03-23 02:59:20 +00:00
|
|
|
SNode* createUseDatabaseStmt(SAstCreateContext* pCxt, SToken* pDbName);
|
2023-09-19 06:03:06 +00:00
|
|
|
SNode* setShowKind(SAstCreateContext* pCxt, SNode* pStmt, EShowKind showKind);
|
2022-06-18 10:37:18 +00:00
|
|
|
SNode* createShowStmt(SAstCreateContext* pCxt, ENodeType type);
|
2024-06-17 06:31:39 +00:00
|
|
|
SNode* createShowStmtWithFull(SAstCreateContext* pCxt, ENodeType type);
|
2022-06-18 10:37:18 +00:00
|
|
|
SNode* createShowStmtWithCond(SAstCreateContext* pCxt, ENodeType type, SNode* pDbName, SNode* pTbName,
|
|
|
|
|
EOperatorType tableCondType);
|
2024-05-30 11:41:22 +00:00
|
|
|
SNode* createShowTablesStmt(SAstCreateContext* pCxt, SShowTablesOption option, SNode* pTbName,
|
|
|
|
|
EOperatorType tableCondType);
|
2022-06-17 13:16:13 +00:00
|
|
|
SNode* createShowCreateDatabaseStmt(SAstCreateContext* pCxt, SToken* pDbName);
|
2022-12-29 10:07:57 +00:00
|
|
|
SNode* createShowAliveStmt(SAstCreateContext* pCxt, SNode* pDbName, ENodeType type);
|
2022-04-01 08:31:24 +00:00
|
|
|
SNode* createShowCreateTableStmt(SAstCreateContext* pCxt, ENodeType type, SNode* pRealTable);
|
2023-10-11 02:38:22 +00:00
|
|
|
SNode* createShowCreateViewStmt(SAstCreateContext* pCxt, ENodeType type, SNode* pRealTable);
|
2022-06-18 10:37:18 +00:00
|
|
|
SNode* createShowTableDistributedStmt(SAstCreateContext* pCxt, SNode* pRealTable);
|
2022-10-24 08:34:10 +00:00
|
|
|
SNode* createShowDnodeVariablesStmt(SAstCreateContext* pCxt, SNode* pDnodeId, SNode* pLikePattern);
|
2022-09-01 11:01:37 +00:00
|
|
|
SNode* createShowVnodesStmt(SAstCreateContext* pCxt, SNode* pDnodeId, SNode* pDnodeEndpoint);
|
2022-11-10 09:22:13 +00:00
|
|
|
SNode* createShowTableTagsStmt(SAstCreateContext* pCxt, SNode* pTbName, SNode* pDbName, SNodeList* pTags);
|
2024-06-17 06:31:39 +00:00
|
|
|
SNode* createCreateUserStmt(SAstCreateContext* pCxt, SToken* pUserName, const SToken* pPassword, int8_t sysinfo,
|
|
|
|
|
int8_t createdb, int8_t is_import);
|
2023-08-24 07:54:10 +00:00
|
|
|
SNode* addCreateUserStmtWhiteList(SAstCreateContext* pCxt, SNode* pStmt, SNodeList* pIpRangesNodeList);
|
|
|
|
|
SNode* createAlterUserStmt(SAstCreateContext* pCxt, SToken* pUserName, int8_t alterType, void* pAlterInfo);
|
2022-03-23 02:45:57 +00:00
|
|
|
SNode* createDropUserStmt(SAstCreateContext* pCxt, SToken* pUserName);
|
2022-03-07 12:18:05 +00:00
|
|
|
SNode* createCreateDnodeStmt(SAstCreateContext* pCxt, const SToken* pFqdn, const SToken* pPort);
|
2023-05-16 01:50:10 +00:00
|
|
|
SNode* createDropDnodeStmt(SAstCreateContext* pCxt, const SToken* pDnode, bool force, bool unsafe);
|
2022-03-16 11:28:40 +00:00
|
|
|
SNode* createAlterDnodeStmt(SAstCreateContext* pCxt, const SToken* pDnode, const SToken* pConfig, const SToken* pValue);
|
2024-03-29 02:25:19 +00:00
|
|
|
SNode* createEncryptKeyStmt(SAstCreateContext* pCxt, const SToken* pValue);
|
2022-12-29 06:39:02 +00:00
|
|
|
SNode* createRealTableNodeForIndexName(SAstCreateContext* pCxt, SToken* pDbName, SToken* pIndexName);
|
2022-08-02 12:20:44 +00:00
|
|
|
SNode* createCreateIndexStmt(SAstCreateContext* pCxt, EIndexType type, bool ignoreExists, SNode* pIndexName,
|
2022-08-01 07:54:53 +00:00
|
|
|
SNode* pRealTable, SNodeList* pCols, SNode* pOptions);
|
2022-06-23 10:03:15 +00:00
|
|
|
SNode* createIndexOption(SAstCreateContext* pCxt, SNodeList* pFuncs, SNode* pInterval, SNode* pOffset, SNode* pSliding,
|
|
|
|
|
SNode* pStreamOptions);
|
2022-08-02 12:20:44 +00:00
|
|
|
SNode* createDropIndexStmt(SAstCreateContext* pCxt, bool ignoreNotExists, SNode* pIndexName);
|
2022-04-09 06:57:28 +00:00
|
|
|
SNode* createCreateComponentNodeStmt(SAstCreateContext* pCxt, ENodeType type, const SToken* pDnodeId);
|
|
|
|
|
SNode* createDropComponentNodeStmt(SAstCreateContext* pCxt, ENodeType type, const SToken* pDnodeId);
|
2023-05-09 11:29:57 +00:00
|
|
|
SNode* createRestoreComponentNodeStmt(SAstCreateContext* pCxt, ENodeType type, const SToken* pDnodeId);
|
2022-12-29 06:39:02 +00:00
|
|
|
SNode* createCreateTopicStmtUseQuery(SAstCreateContext* pCxt, bool ignoreExists, SToken* pTopicName, SNode* pQuery);
|
|
|
|
|
SNode* createCreateTopicStmtUseDb(SAstCreateContext* pCxt, bool ignoreExists, SToken* pTopicName, SToken* pSubDbName,
|
2023-06-30 03:42:40 +00:00
|
|
|
int8_t withMeta);
|
2022-12-29 06:39:02 +00:00
|
|
|
SNode* createCreateTopicStmtUseTable(SAstCreateContext* pCxt, bool ignoreExists, SToken* pTopicName, SNode* pRealTable,
|
2023-06-30 03:42:40 +00:00
|
|
|
int8_t withMeta, SNode* pWhere);
|
2022-12-29 06:39:02 +00:00
|
|
|
SNode* createDropTopicStmt(SAstCreateContext* pCxt, bool ignoreNotExists, SToken* pTopicName);
|
2023-06-09 03:13:22 +00:00
|
|
|
SNode* createDropCGroupStmt(SAstCreateContext* pCxt, bool ignoreNotExists, SToken* pCGroupId, SToken* pTopicName);
|
2023-12-18 06:18:52 +00:00
|
|
|
SNode* createAlterClusterStmt(SAstCreateContext* pCxt, const SToken* pConfig, const SToken* pValue);
|
2022-03-16 11:28:40 +00:00
|
|
|
SNode* createAlterLocalStmt(SAstCreateContext* pCxt, const SToken* pConfig, const SToken* pValue);
|
2022-03-30 06:50:50 +00:00
|
|
|
SNode* createDefaultExplainOptions(SAstCreateContext* pCxt);
|
|
|
|
|
SNode* setExplainVerbose(SAstCreateContext* pCxt, SNode* pOptions, const SToken* pVal);
|
|
|
|
|
SNode* setExplainRatio(SAstCreateContext* pCxt, SNode* pOptions, const SToken* pVal);
|
|
|
|
|
SNode* createExplainStmt(SAstCreateContext* pCxt, bool analyze, SNode* pOptions, SNode* pQuery);
|
2022-03-31 06:19:11 +00:00
|
|
|
SNode* createDescribeStmt(SAstCreateContext* pCxt, SNode* pRealTable);
|
|
|
|
|
SNode* createResetQueryCacheStmt(SAstCreateContext* pCxt);
|
2022-04-26 03:50:35 +00:00
|
|
|
SNode* createCreateFunctionStmt(SAstCreateContext* pCxt, bool ignoreExists, bool aggFunc, const SToken* pFuncName,
|
2023-04-04 09:45:18 +00:00
|
|
|
const SToken* pLibPath, SDataType dataType, int32_t bufSize, const SToken* pLanguage,
|
|
|
|
|
bool orReplace);
|
2022-05-07 09:37:17 +00:00
|
|
|
SNode* createDropFunctionStmt(SAstCreateContext* pCxt, bool ignoreNotExists, const SToken* pFuncName);
|
2022-04-15 10:30:01 +00:00
|
|
|
SNode* createStreamOptions(SAstCreateContext* pCxt);
|
2023-03-03 08:57:13 +00:00
|
|
|
SNode* setStreamOptions(SAstCreateContext* pCxt, SNode* pOptions, EStreamOptionsSetFlag setflag, SToken* pToken,
|
|
|
|
|
SNode* pNode);
|
2022-12-29 06:39:02 +00:00
|
|
|
SNode* createCreateStreamStmt(SAstCreateContext* pCxt, bool ignoreExists, SToken* pStreamName, SNode* pRealTable,
|
2022-12-30 02:11:41 +00:00
|
|
|
SNode* pOptions, SNodeList* pTags, SNode* pSubtable, SNode* pQuery, SNodeList* pCols);
|
2022-12-29 06:39:02 +00:00
|
|
|
SNode* createDropStreamStmt(SAstCreateContext* pCxt, bool ignoreNotExists, SToken* pStreamName);
|
2023-04-24 06:48:33 +00:00
|
|
|
SNode* createPauseStreamStmt(SAstCreateContext* pCxt, bool ignoreNotExists, SToken* pStreamName);
|
|
|
|
|
SNode* createResumeStreamStmt(SAstCreateContext* pCxt, bool ignoreNotExists, bool ignoreUntreated, SToken* pStreamName);
|
2022-04-01 08:31:24 +00:00
|
|
|
SNode* createKillStmt(SAstCreateContext* pCxt, ENodeType type, const SToken* pId);
|
2022-06-15 05:49:29 +00:00
|
|
|
SNode* createKillQueryStmt(SAstCreateContext* pCxt, const SToken* pQueryId);
|
2022-06-07 03:53:32 +00:00
|
|
|
SNode* createBalanceVgroupStmt(SAstCreateContext* pCxt);
|
2023-10-09 07:46:41 +00:00
|
|
|
SNode* createBalanceVgroupLeaderStmt(SAstCreateContext* pCxt, const SToken* pVgId);
|
2024-05-13 08:20:27 +00:00
|
|
|
SNode* createBalanceVgroupLeaderDBNameStmt(SAstCreateContext* pCxt, const SToken* pDbName);
|
2022-04-01 08:31:24 +00:00
|
|
|
SNode* createMergeVgroupStmt(SAstCreateContext* pCxt, const SToken* pVgId1, const SToken* pVgId2);
|
|
|
|
|
SNode* createRedistributeVgroupStmt(SAstCreateContext* pCxt, const SToken* pVgId, SNodeList* pDnodes);
|
|
|
|
|
SNode* createSplitVgroupStmt(SAstCreateContext* pCxt, const SToken* pVgId);
|
|
|
|
|
SNode* createSyncdbStmt(SAstCreateContext* pCxt, const SToken* pDbName);
|
2023-03-28 10:43:58 +00:00
|
|
|
SNode* createGrantStmt(SAstCreateContext* pCxt, int64_t privileges, STokenPair* pPrivLevel, SToken* pUserName,
|
|
|
|
|
SNode* pTagCond);
|
|
|
|
|
SNode* createRevokeStmt(SAstCreateContext* pCxt, int64_t privileges, STokenPair* pPrivLevel, SToken* pUserName,
|
|
|
|
|
SNode* pTagCond);
|
2022-06-04 11:54:55 +00:00
|
|
|
SNode* createDeleteStmt(SAstCreateContext* pCxt, SNode* pTable, SNode* pWhere);
|
2022-07-05 13:12:10 +00:00
|
|
|
SNode* createInsertStmt(SAstCreateContext* pCxt, SNode* pTable, SNodeList* pCols, SNode* pQuery);
|
2023-09-22 03:36:53 +00:00
|
|
|
SNode* createCreateViewStmt(SAstCreateContext* pCxt, bool orReplace, SNode* pView, const SToken* pAs, SNode* pQuery);
|
2023-09-21 11:28:07 +00:00
|
|
|
SNode* createDropViewStmt(SAstCreateContext* pCxt, bool ignoreNotExists, SNode* pView);
|
2023-11-23 07:26:21 +00:00
|
|
|
SNode* createShowCompactDetailsStmt(SAstCreateContext* pCxt, SNode* pCompactIdNode);
|
|
|
|
|
SNode* createShowCompactsStmt(SAstCreateContext* pCxt, ENodeType type);
|
2023-11-20 08:36:13 +00:00
|
|
|
|
|
|
|
|
SNode* createCreateTSMAStmt(SAstCreateContext* pCxt, bool ignoreExists, SToken* tsmaName, SNode* pOptions,
|
|
|
|
|
SNode* pRealTable, SNode* pInterval);
|
2024-01-31 06:20:49 +00:00
|
|
|
SNode* createTSMAOptions(SAstCreateContext* pCxt, SNodeList* pFuncs);
|
2023-11-20 08:36:13 +00:00
|
|
|
SNode* createDefaultTSMAOptions(SAstCreateContext* pCxt);
|
|
|
|
|
SNode* createDropTSMAStmt(SAstCreateContext* pCxt, bool ignoreNotExists, SNode* pRealTable);
|
|
|
|
|
SNode* createShowCreateTSMAStmt(SAstCreateContext* pCxt, SNode* pRealTable);
|
|
|
|
|
SNode* createShowTSMASStmt(SAstCreateContext* pCxt, SNode* dbName);
|
|
|
|
|
|
2022-01-24 03:29:46 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif /*_TD_AST_CREATE_FUNCS_H_*/
|