Overview
You can include a kvpair clause in a query statement to meet your business requirements. The kvpair clause specifies key-value pairs.
Syntax
kvpair={key}:{value};{key}:{value};....Examples
query=SELECT brand, COUNT(*) FROM phone &&kvpair=trace:INFO;formatType:full_jsonParameters supported in the kvpair clause
Parameter | Valid value | Default value | Description |
trace | DISABLE, FATAL, ERROR, WARN, INFO, DEBUG, TRACE1, TRACE2, TRACE3, SCHEDULE, NOTSET | DISABLE | The query process information that is displayed in the frontend. |
formatType/format | string, json, full_json, and flatbuffers | string | The format of the returned results. We recommend that you use full_json if your query is in the JSON format and use flatbuffers if you want to accelerate the query. |
timeout | ulimit | Determined by the SQL configuration. | The timeout period for a query. Unit: milliseconds. |
searchInfo | true, false | false | Specifies whether to return search information. |
sqlPlan | true, false | false | Specifies whether to return information about the SQL execution plan. |
forbitMergeSearchInfo | true, false | false | Specifies that the Query Result Searcher (QRS) does not merge search information that is returned by column searches. If you want to query the details of each column, set this parameter. |
resultReadable | true, false | false | Adds some line breaks to the returned results in JSON format to improve readability if the format parameter is set to json or full_json. |
parallel ( Applicable to Havenask of versions earlier than V3.8.0 ) | 1-16 | 1 | Enables parallel optimization on the Searcher. If the version of Havenask is 3.8.0 or later, use the new implementation. Note: The new implementation and the old implementation are incompatible. Do not use them at the same time. |
parallelTables ( Applicable to Havenask of versions earlier than V3.8.0 ) | Separates multiple tables with vertical bars (|). This parameter is used together with the parallel parameter. The parallelTables parameter specifies the tables that support splitting and parallel processing and is used for join operations. | ||
databaseName | Specifies the default database name that is used by the QRS to access the corresponding Searcher. The QRS can also access multiple Searchers at the same time if you specify the database name before the table name in the dbName.tableName format in the query statement. | ||
catalogName | default | Specifies the catalog name. The catalog name can be the same as the table name. | |
lackResultEnable | true, false | false | Specifies whether to allow missing columns in the result. For example, the RPC timeout column can be missing in the result. |
iquan.optimizer.debug.enable | true/false | false | Specifies whether to enable debugging in the optimization phase of iquan. |
iquan.optimizer.cte.enable | true/false | false | Specifies whether to enable operator merging by using common table expressions (CTEs) for optimization. After you enable operator merging, same operators are automatically merged. |
iquan.optimizer.sort.limit.use.together | true/false | true | Specifies whether to require a LIMIT clause after the ORDER BY clause. |
iquan.optimizer.force.limit.enable | true/false | true | Specifies whether to forcibly add a LIMIT clause for iquan. |
iquan.optimizer.force.limit.num | ulimit | 100 | Specifies the value of the iquan.optimizer.force.limit.num parameter as the value of the LIMIT clause if you set the iquan.optimizer.force.limit.enable parameter to true. |
iquan.optimizer.join.condition.check | true/false | true | Specifies whether the fields that you want to join must be hash fields. |
iquan.optimizer.force.hash.join | true/false | false | Specifies whether to forcibly convert all join nodes to hash join nodes. |
iquan.plan.format.version | string | "" | Specifies the format version of the execution plan that is generated by iquan. The value of this parameter is plan_version_0.0.1. You do not need to specify this parameter. |
iquan.plan.format.type | json | json | Specifies the format of the execution plan that is generated by iquan. Currently, only JSON is supported. |
iquan.plan.prepare.level | rel.post.optimize jni.post.optimize | jni.post.optimize | This parameter is used together with the iquan.plan.cache.enable parameter or the dynamic_params parameter. We recommend that you use the jni.post.optimize value. If you enable the cache, iquan stores the results of the specified phase to the cache. If you specify the dynamic_params parameter, iquan dynamically replaces parameters in the results of the specified phase. rel.post.optimize: returns the optimized results in Java code. jni.post.optimize: returns the results in CPP code after the Java Native Interface (JNI) call is performed. |
iquan.plan.cache.enable | true / false | false | Specifies whether to store the current results in the cache. |
exec.source.id | "" | Specifies a specific row that is accessed by the query statement. This parameter is useful when multiple exchanges exist. The values of this parameter are generated in chronological order by default. | |
exec.source.spec | "" | Specifies the source of the service in the specified format. Scenarios of recommendations from the Personalization Platform (TPP): tpp-appid-abid-solutionid-ip. Other scenarios: Product name-System name-IP address. | |
dynamic_params | Two-dimensional arrays | N/A | Specifies the parameter values with which you want to replace placeholders in the SQL statements. Note: When you want to use dynamic parameters to replace a field whose value is a placeholder in the SQL statements, make sure that the data type of the dynamic parameters must be the same as that of the field.. Note: The values that you specify for dynamic parameters are two-dimensional arrays. Each one-dimensional array in the specified value of a dynamic parameter corresponds to a SQL statement. |
urlencode_data | true / false | false | If the value of the dynamic_params parameter is URL encoded, set this parameter to true. |
If a parameter is specified in the kvpair clause and the query statement, the settings of the parameter in the kvpair clause take precedence.
Separate multiple key-value pairs with semicolons (;). Do not specify spaces before semicolons (;) or after semicolons (;).