Merge branch '3.0' into enh/TD-29968-3.0
This commit is contained in:
commit
b318121e8e
|
@ -13,7 +13,7 @@ TDengine greatly improves the efficiency of data ingestion, querying, and storag
|
|||
|
||||
If you are a developer, please read the [Developer Guide](./develop) carefully. This section introduces the database connection, data modeling, data ingestion, query, continuous query, cache, data subscription, user-defined functions, and other functionality in detail. Sample code is provided for a variety of programming languages. In most cases, you can just copy and paste the sample code, and make a few changes to accommodate your application, and it will work.
|
||||
|
||||
We live in the era of big data, and scale-up is unable to meet the growing needs of the business. Any modern data system must have the ability to scale out, and clustering has become an indispensable feature of big data systems. Not only did the TDengine team develop the cluster feature, but also decided to open source this important feature. To learn how to deploy, manage and maintain a TDengine cluster please refer to [Cluster Deployment](../deployment).
|
||||
We live in the era of big data, and scale-up is unable to meet the growing needs of the business. Any modern data system must have the ability to scale out, and clustering has become an indispensable feature of big data systems. Not only did the TDengine team develop the cluster feature, but also decided to open source this important feature. To learn how to deploy, manage and maintain a TDengine cluster please refer to [Cluster Deployment](./deployment).
|
||||
|
||||
TDengine uses ubiquitous SQL as its query language, which greatly reduces learning costs and migration costs. In addition to the standard SQL, TDengine has extensions to better support time series data analysis. These extensions include functions such as roll-up, interpolation, and time-weighted average, among many others. The [SQL Reference](./taos-sql) chapter describes the SQL syntax in detail and lists the various supported commands and functions.
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ For REST and native connections, client libraries provide similar APIs for perfo
|
|||
Key differences:
|
||||
|
||||
3. The REST connection is more accessible with cross-platform support, however it results in a 30% performance downgrade.
|
||||
1. The TDengine client driver (taosc) has the highest performance with all the features of TDengine like [Parameter Binding](../../client-libraries/cpp#parameter-binding-api), [Subscription](../../client-libraries/cpp#subscription-and-consumption-api), etc.
|
||||
1. The TDengine client driver (taosc) has the highest performance with all the features of TDengine like [Parameter Binding](../../client-libraries/cpp#parameter-binding-api), [Subscription](../../client-libraries/cpp#subscription-api), etc.
|
||||
|
||||
## Install Client Driver taosc
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ Without the current database specified, table name must be preceded with the cor
|
|||
|
||||
## Create STable
|
||||
|
||||
In a time-series application, there may be multiple kinds of data collection points. For example, in the electrical power system there are meters, transformers, bus bars, switches, etc. For easy and efficient aggregation of multiple tables, one STable needs to be created for each kind of data collection point. For example, for the meters in [table 1](../../concept/#model_table1), the SQL statement below can be used to create the super table.
|
||||
In a time-series application, there may be multiple kinds of data collection points. For example, in the electrical power system there are meters, transformers, bus bars, switches, etc. For easy and efficient aggregation of multiple tables, one STable needs to be created for each kind of data collection point. For example, for the meters in [table 1](../../concept/), the SQL statement below can be used to create the super table.
|
||||
|
||||
```sql
|
||||
CREATE STABLE meters (ts timestamp, current float, voltage int, phase float) TAGS (location binary(64), groupId int);
|
||||
|
|
|
@ -46,7 +46,7 @@ meters,location=California.LosAngeles,groupid=2 current=13.4,voltage=223,phase=0
|
|||
|
||||
:::
|
||||
|
||||
For more details please refer to [InfluxDB Line Protocol](https://docs.influxdata.com/influxdb/v2.0/reference/syntax/line-protocol/) and [TDengine Schemaless](../../../reference/schemaless/#Schemaless-Line-Protocol)
|
||||
For more details please refer to [InfluxDB Line Protocol](https://docs.influxdata.com/influxdb/v2.0/reference/syntax/line-protocol/) and [TDengine Schemaless](../../../reference/schemaless/)
|
||||
|
||||
## Examples
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ The version number of the TDengine client driver and the version number of the T
|
|||
|
||||
## Installation Steps
|
||||
|
||||
Please refer to the [Installation Steps](../#installation-steps) for TDengine client driver installation
|
||||
Please refer to [Install Client Driver](../#install-client-driver) for TDengine client driver installation
|
||||
|
||||
## Establishing a connection
|
||||
|
||||
|
|
|
@ -160,7 +160,7 @@ For Java connector, the jts library can be used to easily create GEOMETRY type o
|
|||
Before using Java client library to connect to the database, the following conditions are required.
|
||||
|
||||
- Java 1.8 or above runtime environment and Maven 3.6 or above installed
|
||||
- TDengine client driver installed (required for native connections, not required for REST connections), please refer to [Installing Client Driver](../#Install-Client-Driver)
|
||||
- TDengine client driver installed (required for native connections, not required for REST connections), please refer to [Install Client Driver](../#install-client-driver)
|
||||
|
||||
### Install the client library
|
||||
|
||||
|
@ -368,7 +368,7 @@ The configuration parameters in properties are as follows.
|
|||
- TSDBDriver.PROPERTY_KEY_MESSAGE_WAIT_TIMEOUT: message transmission timeout in milliseconds, the default value is 60000 ms. It only takes effect when using JDBC REST connection and batchfetch is true.
|
||||
- TSDBDriver.PROPERTY_KEY_USE_SSL: connecting Securely Using SSL. true: using SSL connection, false: not using SSL connection. It only takes effect when using JDBC REST connection.
|
||||
- TSDBDriver.HTTP_POOL_SIZE: size of REST concurrent requests. The default value is 20.
|
||||
For JDBC native connections, you can specify other parameters, such as log level, SQL length, etc., by specifying URL and Properties. For more detailed configuration, please refer to [Client Configuration](../../reference/config/#Client-Only).
|
||||
For JDBC native connections, you can specify other parameters, such as log level, SQL length, etc., by specifying URL and Properties. For more detailed configuration, please refer to [Client Configuration](../../reference/config/#configuration-file-on-client-side).
|
||||
|
||||
### Priority of configuration parameters
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ username:password@protocol(address)/dbname?param=value
|
|||
|
||||
_taosSql_ implements Go's `database/sql/driver` interface via cgo. You can use the [`database/sql`](https://golang.org/pkg/database/sql/) interface by simply introducing the driver.
|
||||
|
||||
Use `taosSql` as `driverName` and use a correct [DSN](#DSN) as `dataSourceName`, DSN supports the following parameters.
|
||||
Use `taosSql` as `driverName` and use a correct DSN as `dataSourceName`, DSN supports the following parameters.
|
||||
|
||||
* cfg specifies the `taos.cfg` directory
|
||||
|
||||
|
@ -160,7 +160,7 @@ func main() {
|
|||
|
||||
_taosRestful_ implements Go's `database/sql/driver` interface via `http client`. You can use the [`database/sql`](https://golang.org/pkg/database/sql/) interface by simply introducing the driver.
|
||||
|
||||
Use `taosRestful` as `driverName` and use a correct [DSN](#DSN) as `dataSourceName` with the following parameters supported by the DSN.
|
||||
Use `taosRestful` as `driverName` and use a correct DSN as `dataSourceName` with the following parameters supported by the DSN.
|
||||
|
||||
* `disableCompression` whether to accept compressed data, default is true do not accept compressed data, set to false if transferring data using gzip compression.
|
||||
* `readBufferSize` The default size of the buffer for reading data is 4K (4096), which can be adjusted upwards when the query result has a lot of data.
|
||||
|
@ -191,7 +191,7 @@ func main() {
|
|||
|
||||
_taosRestful_ implements Go's `database/sql/driver` interface via `http client`. You can use the [`database/sql`](https://golang.org/pkg/database/sql/) interface by simply introducing the driver (driver-go minimum version 3.0.2).
|
||||
|
||||
Use `taosWS` as `driverName` and use a correct [DSN](#DSN) as `dataSourceName` with the following parameters supported by the DSN.
|
||||
Use `taosWS` as `driverName` and use a correct DSN as `dataSourceName` with the following parameters supported by the DSN.
|
||||
|
||||
* `writeTimeout` The timeout to send data via WebSocket.
|
||||
* `readTimeout` The timeout to receive response data via WebSocket.
|
||||
|
|
|
@ -321,7 +321,7 @@ let rs = taos.query_with_req_id("select * from stable where tag1 is null", 1)?;
|
|||
|
||||
TDengine has significantly improved the bind APIs to support data writing (INSERT) scenarios. Writing data in this way avoids the resource consumption of SQL syntax parsing, resulting in significant write performance improvements in many cases.
|
||||
|
||||
Parameter binding details see [API Reference](#stmt-api)
|
||||
Parameter binding details see [API Reference](#bind-interface)
|
||||
|
||||
<RustBind />
|
||||
|
||||
|
@ -578,11 +578,7 @@ Note that Rust asynchronous functions and an asynchronous runtime are required.
|
|||
|
||||
In addition, this structure is also the entry point for Parameter Binding and Line Protocol Interface. Please refer to the specific API descriptions for usage.
|
||||
|
||||
<p>
|
||||
<a id="stmt-api" style={{color:'#141414'}}>
|
||||
Bind Interface
|
||||
</a>
|
||||
</p>
|
||||
### Bind Interface
|
||||
|
||||
Similar to the C interface, Rust provides the bind interface's wrapping. First, the [Taos][struct.taos] object creates a parameter binding object [Stmt] for an SQL statement.
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ TDengine currently supports timestamp, number, character, Boolean type, and the
|
|||
|
||||
1. Install Python. The recent taospy package requires Python 3.6.2+. The earlier versions of taospy require Python 3.7+. The taos-ws-py package requires Python 3.7+. If Python is not available on your system, refer to the [Python BeginnersGuide](https://wiki.python.org/moin/BeginnersGuide/Download) to install it.
|
||||
2. Install [pip](https://pypi.org/project/pip/). In most cases, the Python installer comes with the pip utility. If not, please refer to [pip documentation](https://pip.pypa.io/en/stable/installation/) to install it.
|
||||
If you use a native connection, you will also need to [Install Client Driver](../#Install-Client-Driver). The client install package includes the TDengine client dynamic link library (`libtaos.so` or `taos.dll`) and the TDengine CLI.
|
||||
If you use a native connection, you will also need to [Install Client Driver](../#install-client-driver). The client install package includes the TDengine client dynamic link library (`libtaos.so` or `taos.dll`) and the TDengine CLI.
|
||||
|
||||
### Install via pip
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ Please refer to [version support list](../#version-support)
|
|||
### Pre-installation preparation
|
||||
|
||||
- Install the Node.js development environment
|
||||
- If you are using the REST client library, skip this step. However, if you use the native client library, please install the TDengine client driver. Please refer to [Install Client Driver](../#Install-Client-Driver) for more details. We use [node-gyp](https://github.com/nodejs/node-gyp) to interact with TDengine instances and also need to install some dependencies mentioned below depending on the specific OS.
|
||||
- If you are using the REST client library, skip this step. However, if you use the native client library, please install the TDengine client driver. Please refer to [Install Client Driver](../#install-client-driver) for more details. We use [node-gyp](https://github.com/nodejs/node-gyp) to interact with TDengine instances and also need to install some dependencies mentioned below depending on the specific OS.
|
||||
|
||||
<Tabs defaultValue="Linux">
|
||||
<TabItem value="Linux" label="Linux system installation dependencies">
|
||||
|
|
|
@ -40,7 +40,7 @@ Because the version of TDengine client driver is tightly associated with that of
|
|||
|
||||
### Install TDengine Client Driver
|
||||
|
||||
Regarding how to install TDengine client driver please refer to [Install Client Driver](../#installation-steps)
|
||||
Regarding how to install TDengine client driver please refer to [Install Client Driver](../#install-client-driver)
|
||||
|
||||
### Install php-tdengine
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ taosBenchmark -f <json file>
|
|||
|
||||
</details>
|
||||
|
||||
## Command-line argument in detail
|
||||
## Command-line arguments in detail
|
||||
|
||||
- **-f/--file <json file>** :
|
||||
specify the configuration file to use. This file includes All parameters. Users should not use this parameter with other parameters on the command-line. There is no default value.
|
||||
|
|
|
@ -23,7 +23,7 @@ Methods of installing taosKeeper:
|
|||
|
||||
### Configuration
|
||||
|
||||
taosKeeper needs to be executed on the terminal of the operating system, it supports three configuration methods: [Command-line arguments](#command-line-arguments-in-detail), [environment variable](#environment-variable-in-detail) and [configuration file](#configuration-file-parameters-in-detail). The precedence of those is Command-line, environment variable and configuration file.
|
||||
taosKeeper needs to be executed on the terminal of the operating system, it supports three configuration methods: Command-line arguments, environment variable and configuration file. The precedence of those is Command-line, environment variable and configuration file.
|
||||
|
||||
**Make sure that the TDengine cluster is running correctly before running taosKeeper.** Ensure that the monitoring service in TDengine has been started. At least the values of `monitor` and `monitorFqdn` need to be set in `taos.cfg`.
|
||||
|
||||
|
@ -32,7 +32,7 @@ monitor 1
|
|||
monitorFqdn localhost # taoskeeper's FQDN
|
||||
```
|
||||
|
||||
For more information, see [TDengine Monitoring Configuration](../config/#monitoring).
|
||||
For more information, see [TDengine Monitoring Configuration](../config/#monitoring-parameters).
|
||||
|
||||
### Quick Launch
|
||||
|
||||
|
|
|
@ -73,6 +73,6 @@ Query OK, 3 row(s) in set (0.013269s)
|
|||
|
||||
- TDengine take influxdb format data and create unique ID for table names by the rule.
|
||||
The user can configure `smlChildTableName` parameter to generate specified table names if he/she needs. And he/she also need to insert data with specified data format.
|
||||
For example, Add `smlChildTableName=tname` in the taos.cfg file. Insert data `st,tname=cpu1,t1=4 c1=3 1626006833639000000` then the table name will be cpu1. If there are multiple lines has same tname but different tag_set, the first line's tag_set will be used to automatically creating table and ignore other lines. Please refer to [TDengine Schemaless](../../reference/schemaless/#Schemaless-Line-Protocol)
|
||||
For example, Add `smlChildTableName=tname` in the taos.cfg file. Insert data `st,tname=cpu1,t1=4 c1=3 1626006833639000000` then the table name will be cpu1. If there are multiple lines has same tname but different tag_set, the first line's tag_set will be used to automatically creating table and ignore other lines. Please refer to [TDengine Schemaless](../../reference/schemaless/)
|
||||
:::
|
||||
|
||||
|
|
|
@ -101,6 +101,7 @@ else
|
|||
${script_dir}/remove.sh \
|
||||
${script_dir}/set_core.sh \
|
||||
${script_dir}/startPre.sh \
|
||||
${script_dir}/quick_deploy.sh \
|
||||
${script_dir}/taosd-dump-cfg.gdb"
|
||||
fi
|
||||
|
||||
|
@ -258,7 +259,7 @@ cp ${install_files} ${install_dir}
|
|||
cp ${install_dir}/install.sh install_temp.sh
|
||||
if [ "$verMode" == "cluster" ]; then
|
||||
sed -i 's/verMode=edge/verMode=cluster/g' install_temp.sh
|
||||
sed -i "s/PREFIX=\"taos\"/PREFIX=\"${serverName2}\"/g" install_temp.sh
|
||||
sed -i "s/PREFIX=\"taos\"/PREFIX=\"${clientName2}\"/g" install_temp.sh
|
||||
sed -i "s/productName=\"TDengine\"/productName=\"${productName2}\"/g" install_temp.sh
|
||||
cusDomain=`echo "${cusEmail2}" | sed 's/^[^@]*@//'`
|
||||
sed -i "s/emailName=\"taosdata.com\"/emailName=\"${cusDomain}\"/g" install_temp.sh
|
||||
|
|
|
@ -30,6 +30,11 @@ static tb_uid_t processSuid(tb_uid_t suid, char* db) { return suid + MurmurHash3
|
|||
|
||||
static char* buildCreateTableJson(SSchemaWrapper* schemaRow, SSchemaWrapper* schemaTag, char* name, int64_t id,
|
||||
int8_t t, SColCmprWrapper* pColCmprRow) {
|
||||
int8_t buildDefaultCompress = 0;
|
||||
if (pColCmprRow->nCols <= 0) {
|
||||
buildDefaultCompress = 1;
|
||||
}
|
||||
|
||||
char* string = NULL;
|
||||
cJSON* json = cJSON_CreateObject();
|
||||
if (json == NULL) {
|
||||
|
@ -70,13 +75,20 @@ static char* buildCreateTableJson(SSchemaWrapper* schemaRow, SSchemaWrapper* sch
|
|||
cJSON_AddItemToObject(column, "isPrimarykey", isPk);
|
||||
cJSON_AddItemToArray(columns, column);
|
||||
|
||||
if (pColCmprRow == NULL || pColCmprRow->nCols <= i) {
|
||||
if (pColCmprRow == NULL) {
|
||||
continue;
|
||||
}
|
||||
|
||||
uint32_t alg = 0;
|
||||
if (buildDefaultCompress) {
|
||||
alg = createDefaultColCmprByType(s->type);
|
||||
} else {
|
||||
SColCmpr* pColCmpr = pColCmprRow->pColCmpr + i;
|
||||
const char* encode = columnEncodeStr(COMPRESS_L1_TYPE_U32(pColCmpr->alg));
|
||||
const char* compress = columnCompressStr(COMPRESS_L2_TYPE_U32(pColCmpr->alg));
|
||||
const char* level = columnLevelStr(COMPRESS_L2_TYPE_LEVEL_U32(pColCmpr->alg));
|
||||
alg = pColCmpr->alg;
|
||||
}
|
||||
const char* encode = columnEncodeStr(COMPRESS_L1_TYPE_U32(alg));
|
||||
const char* compress = columnCompressStr(COMPRESS_L2_TYPE_U32(alg));
|
||||
const char* level = columnLevelStr(COMPRESS_L2_TYPE_LEVEL_U32(alg));
|
||||
|
||||
cJSON* encodeJson = cJSON_CreateString(encode);
|
||||
cJSON_AddItemToObject(column, "encode", encodeJson);
|
||||
|
@ -767,14 +779,25 @@ static int32_t taosCreateStb(TAOS* taos, void* meta, int32_t metaLen) {
|
|||
code = TSDB_CODE_INVALID_PARA;
|
||||
goto end;
|
||||
}
|
||||
|
||||
int8_t createDefaultCompress = 0;
|
||||
SColCmprWrapper* p = &req.colCmpr;
|
||||
if (p->nCols == 0) {
|
||||
createDefaultCompress = 1;
|
||||
}
|
||||
// build create stable
|
||||
pReq.pColumns = taosArrayInit(req.schemaRow.nCols, sizeof(SFieldWithOptions));
|
||||
for (int32_t i = 0; i < req.schemaRow.nCols; i++) {
|
||||
SSchema* pSchema = req.schemaRow.pSchema + i;
|
||||
SFieldWithOptions field = {.type = pSchema->type, .flags = pSchema->flags, .bytes = pSchema->bytes};
|
||||
strcpy(field.name, pSchema->name);
|
||||
SColCmpr *p = &req.colCmpr.pColCmpr[i];
|
||||
|
||||
if (createDefaultCompress) {
|
||||
field.compress = createDefaultColCmprByType(pSchema->type);
|
||||
} else {
|
||||
SColCmpr* p = &req.colCmpr.pColCmpr[i];
|
||||
field.compress = p->alg;
|
||||
}
|
||||
taosArrayPush(pReq.pColumns, &field);
|
||||
}
|
||||
pReq.pTags = taosArrayInit(req.schemaTag.nCols, sizeof(SField));
|
||||
|
|
|
@ -27,6 +27,8 @@ static S3UriStyle uriStyleG = S3UriStylePath;
|
|||
static int retriesG = 5;
|
||||
static int timeoutMsG = 0;
|
||||
|
||||
extern int8_t tsS3Oss;
|
||||
|
||||
int32_t s3Begin() {
|
||||
S3Status status;
|
||||
const char *hostname = tsS3Hostname;
|
||||
|
@ -42,6 +44,9 @@ int32_t s3Begin() {
|
|||
}
|
||||
|
||||
protocolG = !tsS3Https;
|
||||
if (tsS3Oss) {
|
||||
uriStyleG = S3UriStyleVirtualHost;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -45,8 +45,8 @@ char tsEncryptAlgorithm[16] = {0};
|
|||
char tsEncryptScope[100] = {0};
|
||||
EEncryptAlgor tsiEncryptAlgorithm = 0;
|
||||
EEncryptScope tsiEncryptScope = 0;
|
||||
//char tsAuthCode[500] = {0};
|
||||
//char tsEncryptKey[17] = {0};
|
||||
// char tsAuthCode[500] = {0};
|
||||
// char tsEncryptKey[17] = {0};
|
||||
char tsEncryptKey[17] = {0};
|
||||
|
||||
// common
|
||||
|
@ -296,6 +296,7 @@ char tsS3AccessKeySecret[TSDB_FQDN_LEN] = "<accesskeysecrect>";
|
|||
char tsS3BucketName[TSDB_FQDN_LEN] = "<bucketname>";
|
||||
char tsS3AppId[TSDB_FQDN_LEN] = "<appid>";
|
||||
int8_t tsS3Enabled = false;
|
||||
int8_t tsS3Oss = false;
|
||||
int8_t tsS3StreamEnabled = false;
|
||||
|
||||
int8_t tsS3Https = true;
|
||||
|
@ -366,6 +367,10 @@ int32_t taosSetS3Cfg(SConfig *pCfg) {
|
|||
tstrncpy(tsS3AppId, appid + 1, TSDB_FQDN_LEN);
|
||||
}
|
||||
}
|
||||
char *oss = strstr(tsS3Endpoint, "aliyuncs.");
|
||||
if (oss) {
|
||||
tsS3Oss = true;
|
||||
}
|
||||
if (tsS3BucketName[0] != '<') {
|
||||
#if defined(USE_COS) || defined(USE_S3)
|
||||
#ifdef TD_ENTERPRISE
|
||||
|
@ -563,11 +568,12 @@ static int32_t taosAddClientCfg(SConfig *pCfg) {
|
|||
if (cfgAddBool(pCfg, "monitor", tsEnableMonitor, CFG_SCOPE_BOTH, CFG_DYN_BOTH) != 0) return -1;
|
||||
if (cfgAddInt32(pCfg, "monitorInterval", tsMonitorInterval, 1, 200000, CFG_SCOPE_BOTH, CFG_DYN_NONE) != 0) return -1;
|
||||
|
||||
if (cfgAddBool(pCfg, "multiResultFunctionStarReturnTags", tsMultiResultFunctionStarReturnTags, CFG_SCOPE_CLIENT, CFG_DYN_CLIENT) != 0) return -1;
|
||||
if (cfgAddBool(pCfg, "multiResultFunctionStarReturnTags", tsMultiResultFunctionStarReturnTags, CFG_SCOPE_CLIENT,
|
||||
CFG_DYN_CLIENT) != 0)
|
||||
return -1;
|
||||
if (cfgAddInt32(pCfg, "countAlwaysReturnValue", tsCountAlwaysReturnValue, 0, 1, CFG_SCOPE_BOTH, CFG_DYN_CLIENT) != 0)
|
||||
return -1;
|
||||
if (cfgAddInt32(pCfg, "maxTsmaCalcDelay", tsMaxTsmaCalcDelay, 600, 86400, CFG_SCOPE_CLIENT, CFG_DYN_CLIENT) !=
|
||||
0)
|
||||
if (cfgAddInt32(pCfg, "maxTsmaCalcDelay", tsMaxTsmaCalcDelay, 600, 86400, CFG_SCOPE_CLIENT, CFG_DYN_CLIENT) != 0)
|
||||
return -1;
|
||||
if (cfgAddInt32(pCfg, "tsmaDataDeleteMark", tsmaDataDeleteMark, 60 * 60 * 1000, INT64_MAX, CFG_SCOPE_CLIENT,
|
||||
CFG_DYN_CLIENT) != 0)
|
||||
|
@ -618,11 +624,12 @@ static int32_t taosAddServerCfg(SConfig *pCfg) {
|
|||
|
||||
tsNumOfSupportVnodes = tsNumOfCores * 2;
|
||||
tsNumOfSupportVnodes = TMAX(tsNumOfSupportVnodes, 2);
|
||||
if (cfgAddInt32(pCfg, "supportVnodes", tsNumOfSupportVnodes, 0, 4096, CFG_SCOPE_SERVER, CFG_DYN_ENT_SERVER) != 0) return -1;
|
||||
if (cfgAddInt32(pCfg, "supportVnodes", tsNumOfSupportVnodes, 0, 4096, CFG_SCOPE_SERVER, CFG_DYN_ENT_SERVER) != 0)
|
||||
return -1;
|
||||
|
||||
if (cfgAddString(pCfg, "encryptAlgorithm", tsEncryptAlgorithm, CFG_SCOPE_SERVER, CFG_DYN_NONE) != 0) return -1;
|
||||
if (cfgAddString(pCfg, "encryptScope", tsEncryptScope, CFG_SCOPE_SERVER, CFG_DYN_NONE) != 0) return -1;
|
||||
//if (cfgAddString(pCfg, "authCode", tsAuthCode, CFG_SCOPE_SERVER, CFG_DYN_NONE) != 0) return -1;
|
||||
// if (cfgAddString(pCfg, "authCode", tsAuthCode, CFG_SCOPE_SERVER, CFG_DYN_NONE) != 0) return -1;
|
||||
|
||||
if (cfgAddInt32(pCfg, "statusInterval", tsStatusInterval, 1, 30, CFG_SCOPE_SERVER, CFG_DYN_NONE) != 0) return -1;
|
||||
if (cfgAddInt32(pCfg, "minSlidingTime", tsMinSlidingTime, 1, 1000000, CFG_SCOPE_CLIENT, CFG_DYN_CLIENT) != 0)
|
||||
|
@ -749,8 +756,7 @@ static int32_t taosAddServerCfg(SConfig *pCfg) {
|
|||
if (cfgAddInt32(pCfg, "tmqMaxTopicNum", tmqMaxTopicNum, 1, 10000, CFG_SCOPE_SERVER, CFG_DYN_ENT_SERVER) != 0)
|
||||
return -1;
|
||||
|
||||
if (cfgAddInt32(pCfg, "tmqRowSize", tmqRowSize, 1, 1000000, CFG_SCOPE_SERVER, CFG_DYN_ENT_SERVER) != 0)
|
||||
return -1;
|
||||
if (cfgAddInt32(pCfg, "tmqRowSize", tmqRowSize, 1, 1000000, CFG_SCOPE_SERVER, CFG_DYN_ENT_SERVER) != 0) return -1;
|
||||
|
||||
if (cfgAddInt32(pCfg, "maxTsmaNum", tsMaxTsmaNum, 0, 3, CFG_SCOPE_SERVER, CFG_DYN_SERVER) != 0) return -1;
|
||||
if (cfgAddInt32(pCfg, "transPullupInterval", tsTransPullupInterval, 1, 10000, CFG_SCOPE_SERVER, CFG_DYN_ENT_SERVER) !=
|
||||
|
@ -1181,7 +1187,7 @@ static int32_t taosSetServerCfg(SConfig *pCfg) {
|
|||
tsQueryBufferSize = cfgGetItem(pCfg, "queryBufferSize")->i32;
|
||||
tstrncpy(tsEncryptAlgorithm, cfgGetItem(pCfg, "encryptAlgorithm")->str, 16);
|
||||
tstrncpy(tsEncryptScope, cfgGetItem(pCfg, "encryptScope")->str, 100);
|
||||
//tstrncpy(tsAuthCode, cfgGetItem(pCfg, "authCode")->str, 100);
|
||||
// tstrncpy(tsAuthCode, cfgGetItem(pCfg, "authCode")->str, 100);
|
||||
|
||||
tsNumOfRpcThreads = cfgGetItem(pCfg, "numOfRpcThreads")->i32;
|
||||
tsNumOfRpcSessions = cfgGetItem(pCfg, "numOfRpcSessions")->i32;
|
||||
|
|
|
@ -534,6 +534,10 @@ static int32_t collectMetaKeyFromShowTables(SCollectMetaKeyCxt* pCxt, SShowStmt*
|
|||
static int32_t collectMetaKeyFromShowTags(SCollectMetaKeyCxt* pCxt, SShowStmt* pStmt) {
|
||||
int32_t code = reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_TAGS,
|
||||
pCxt->pMetaCache);
|
||||
if (TSDB_CODE_SUCCESS == code) {
|
||||
code = reserveTableMetaInCache(pCxt->pParseCxt->acctId, ((SValueNode*)pStmt->pDbName)->literal,
|
||||
((SValueNode*)pStmt->pTbName)->literal, pCxt->pMetaCache);
|
||||
}
|
||||
if (TSDB_CODE_SUCCESS == code) {
|
||||
code = reserveDbVgInfoInCache(pCxt->pParseCxt->acctId, ((SValueNode*)pStmt->pDbName)->literal, pCxt->pMetaCache);
|
||||
}
|
||||
|
|
|
@ -11867,6 +11867,30 @@ static int32_t rewriteShowVgroups(STranslateContext* pCxt, SQuery* pQuery) {
|
|||
return code;
|
||||
}
|
||||
|
||||
static int32_t checkShowTags(STranslateContext* pCxt, const SShowStmt* pShow) {
|
||||
int32_t code = 0;
|
||||
SName name;
|
||||
STableMeta* pTableMeta = NULL;
|
||||
code = getTargetMeta(pCxt,
|
||||
toName(pCxt->pParseCxt->acctId, ((SValueNode*)pShow->pDbName)->literal,
|
||||
((SValueNode*)pShow->pTbName)->literal, &name),
|
||||
&pTableMeta, true);
|
||||
taosMemoryFreeClear(pTableMeta);
|
||||
if (TSDB_CODE_SUCCESS != code) {
|
||||
return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_GET_META_ERROR, tstrerror(code));
|
||||
}
|
||||
|
||||
return code;
|
||||
}
|
||||
|
||||
static int32_t rewriteShowTags(STranslateContext* pCxt, SQuery* pQuery) {
|
||||
int32_t code = checkShowTags(pCxt, (SShowStmt*)pQuery->pRoot);
|
||||
if (TSDB_CODE_SUCCESS == code) {
|
||||
code = rewriteShow(pCxt, pQuery);
|
||||
}
|
||||
return code;
|
||||
}
|
||||
|
||||
static SNode* createTagsFunction() {
|
||||
SFunctionNode* pFunc = (SFunctionNode*)nodesMakeNode(QUERY_NODE_FUNCTION);
|
||||
if (NULL == pFunc) {
|
||||
|
@ -13170,7 +13194,6 @@ static int32_t rewriteQuery(STranslateContext* pCxt, SQuery* pQuery) {
|
|||
case QUERY_NODE_SHOW_APPS_STMT:
|
||||
case QUERY_NODE_SHOW_CONSUMERS_STMT:
|
||||
case QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT:
|
||||
case QUERY_NODE_SHOW_TAGS_STMT:
|
||||
case QUERY_NODE_SHOW_USER_PRIVILEGES_STMT:
|
||||
case QUERY_NODE_SHOW_VIEWS_STMT:
|
||||
case QUERY_NODE_SHOW_GRANTS_FULL_STMT:
|
||||
|
@ -13181,6 +13204,9 @@ static int32_t rewriteQuery(STranslateContext* pCxt, SQuery* pQuery) {
|
|||
case QUERY_NODE_SHOW_TSMAS_STMT:
|
||||
code = rewriteShow(pCxt, pQuery);
|
||||
break;
|
||||
case QUERY_NODE_SHOW_TAGS_STMT:
|
||||
code = rewriteShowTags(pCxt, pQuery);
|
||||
break;
|
||||
case QUERY_NODE_SHOW_VGROUPS_STMT:
|
||||
code = rewriteShowVgroups(pCxt, pQuery);
|
||||
break;
|
||||
|
|
|
@ -489,11 +489,11 @@
|
|||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/last+last_row.py -Q 2
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/last+last_row.py -Q 3
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/last+last_row.py -Q 4
|
||||
#,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/primary_ts_base_1.py
|
||||
#,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/primary_ts_base_1.py -R
|
||||
#,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/primary_ts_base_1.py -Q 2
|
||||
#,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/primary_ts_base_1.py -Q 3
|
||||
#,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/primary_ts_base_1.py -Q 4
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/primary_ts_base_1.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/primary_ts_base_1.py -R
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/primary_ts_base_1.py -Q 2
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/primary_ts_base_1.py -Q 3
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/primary_ts_base_1.py -Q 4
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/primary_ts_base_2.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/primary_ts_base_2.py -R
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/primary_ts_base_2.py -Q 2
|
||||
|
@ -509,6 +509,11 @@
|
|||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/primary_ts_base_4.py -Q 2
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/primary_ts_base_4.py -Q 3
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/primary_ts_base_4.py -Q 4
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/primary_ts_base_5.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/primary_ts_base_5.py -R
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/primary_ts_base_5.py -Q 2
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/primary_ts_base_5.py -Q 3
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/primary_ts_base_5.py -Q 4
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/leastsquares.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/leastsquares.py -R
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/length.py
|
||||
|
|
|
@ -113,6 +113,9 @@ class TDTestCase:
|
|||
tdSql.error(f'show tags from `db`.`stb` from db')
|
||||
tdSql.error(f'show tags from db.ctb1 from db')
|
||||
tdSql.error(f'show tags from `db`.`ctb1` from db')
|
||||
tdSql.error(f'show tags from tb_undef from db')
|
||||
tdSql.error(f'show tags from db.tb_undef')
|
||||
tdSql.error(f'show tags from tb_undef')
|
||||
|
||||
# show table tags
|
||||
tdSql.query(f'show table tags from stb')
|
||||
|
@ -145,6 +148,9 @@ class TDTestCase:
|
|||
tdSql.error(f'show table tags from `db`.`stb` from db')
|
||||
tdSql.error(f'show table tags from db.ctb1 from db')
|
||||
tdSql.error(f'show table tags from `db`.`ctb1` from db')
|
||||
tdSql.error(f'show table tags from tb_undef from db')
|
||||
tdSql.error(f'show table tags from db.tb_undef')
|
||||
tdSql.error(f'show table tags from tb_undef')
|
||||
|
||||
# show indexes
|
||||
tdSql.execute(f'create index idx1 on stb (t1)')
|
||||
|
|
|
@ -27,8 +27,8 @@ class TDTestCase(TDTestCase):
|
|||
self.fun_pk_twa(self.database,'derivative',',1s,0')
|
||||
self.fun_pk_twa(self.database,'derivative',',1s,1')
|
||||
self.fun_pk_unique(self.database,'unique','')
|
||||
# self.fun_pk_last_init(self.database,'last','')
|
||||
# self.fun_pk_last(self.database,'last','')
|
||||
self.fun_pk_last_init(self.database,'last','')
|
||||
self.fun_pk_last(self.database,'last','')
|
||||
# self.fun_pk_last(self.database,'last_row','')
|
||||
# self.fun_pk_first(self.database,'first','')
|
||||
|
||||
|
|
|
@ -27,14 +27,14 @@ class TDTestCase(TDTestCase):
|
|||
# self.fun_pk_twa(self.database,'derivative',',1s,0')
|
||||
# self.fun_pk_twa(self.database,'derivative',',1s,1')
|
||||
# self.fun_pk_unique(self.database,'unique','')
|
||||
self.fun_pk_last_init(self.database,'last','')
|
||||
self.fun_pk_last(self.database,'last','')
|
||||
# self.fun_pk_last_init(self.database,'last','')
|
||||
# self.fun_pk_last(self.database,'last','')
|
||||
self.fun_pk_last(self.database,'last_row','')
|
||||
self.fun_pk_first(self.database,'first','')
|
||||
|
||||
self.query_pk_fun(self.database,'')
|
||||
|
||||
# self.touying_pk_1(self.database,1)
|
||||
self.touying_pk_1(self.database,1)
|
||||
# self.touying_pk_where(self.database,'')
|
||||
# self.touying_pk_where(self.database,'tags')
|
||||
# self.touying_pk_where(self.database,'distinct')
|
||||
|
|
|
@ -34,7 +34,7 @@ class TDTestCase(TDTestCase):
|
|||
|
||||
# self.query_pk_fun(self.database,'')
|
||||
|
||||
self.touying_pk_1(self.database,1)
|
||||
# self.touying_pk_1(self.database,1)
|
||||
self.touying_pk_where(self.database,'')
|
||||
# self.touying_pk_where(self.database,'tags')
|
||||
# self.touying_pk_where(self.database,'distinct')
|
||||
|
|
|
@ -36,9 +36,9 @@ class TDTestCase(TDTestCase):
|
|||
|
||||
# self.touying_pk_1(self.database,1)
|
||||
# self.touying_pk_where(self.database,'')
|
||||
self.touying_pk_where(self.database,'tags')
|
||||
# self.touying_pk_where(self.database,'tags')
|
||||
self.touying_pk_where(self.database,'distinct')
|
||||
self.count_pk(self.database,1)
|
||||
# self.count_pk(self.database,1)
|
||||
|
||||
endTime = time.time()
|
||||
print("total time %ds" % (endTime - startTime))
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
###################################################################
|
||||
# Copyright (c) 2016 by TAOS Technologies, Inc.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This file is proprietary and confidential to TAOS Technologies.
|
||||
# No part of this file may be reproduced, stored, transmitted,
|
||||
# disclosed or used in any form or by any means other than as
|
||||
# expressly provided by the written permission from Jianhui Tao
|
||||
#
|
||||
###################################################################
|
||||
|
||||
# -*- coding: utf-8 -*-
|
||||
from util.cases import tdCases
|
||||
from .primary_ts_base import *
|
||||
from faker import Faker
|
||||
import random
|
||||
|
||||
class TDTestCase(TDTestCase):
|
||||
|
||||
def run(self):
|
||||
startTime = time.time()
|
||||
self.dropandcreateDB_primary_key(self.database, 1 , 1 ,'yes','yes','no')
|
||||
|
||||
# self.fun_pk_interp(self.database,'interp','')
|
||||
# self.multiple_agg_groupby(self.database,1)
|
||||
# self.fun_pk_diff(self.database,'diff','')
|
||||
# self.fun_pk_twa(self.database,'derivative',',1s,0')
|
||||
# self.fun_pk_twa(self.database,'derivative',',1s,1')
|
||||
# self.fun_pk_unique(self.database,'unique','')
|
||||
# self.fun_pk_last_init(self.database,'last','')
|
||||
# self.fun_pk_last(self.database,'last','')
|
||||
# self.fun_pk_last(self.database,'last_row','')
|
||||
# self.fun_pk_first(self.database,'first','')
|
||||
|
||||
# self.query_pk_fun(self.database,'')
|
||||
|
||||
# self.touying_pk_1(self.database,1)
|
||||
# self.touying_pk_where(self.database,'')
|
||||
self.touying_pk_where(self.database,'tags')
|
||||
# self.touying_pk_where(self.database,'distinct')
|
||||
self.count_pk(self.database,1)
|
||||
|
||||
endTime = time.time()
|
||||
print("total time %ds" % (endTime - startTime))
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success("%s successfully executed" % __file__)
|
||||
|
||||
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
Loading…
Reference in New Issue