All Products
Search
Document Center

OpenSearch:kvpair clause

Last Updated:Feb 28, 2024

Description

You can include a kvpair clause in a query statement to customize various applications. A kvpair clause specifies key-value pairs.

Syntax

kvpair={key}:{value};{key}:{value};....

Example

query=SELECT brand, COUNT(*) FROM phone &&kvpair=trace:INFO;formatType:full_json

Parameters supported in a 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 generated in the frontend.

formatType/format

string, json, full_json, flatbuffers

string

The format of the returned result.

For more information, see Interpret query 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

The default value is determined based on the configuration of the SQL statement.

The timeout period for a query. Unit: milliseconds.

searchInfo

true, false

false

Specifies whether to return the search information.

sqlPlan

true, false

false

Specifies whether to return information about the SQL plan.

forbitMergeSearchInfo

true, false

false

Specifies whether Query Result Searcher (QRS) merges search information that is returned by column searches. If you want to query the details of each column, set this parameter to true.

resultReadable

true, false

false

Specifies whether to add some line breaks to the returned results in JSON format to increase readability if the format parameter is set to json or full_json.

parallel (

applicable to OpenSearch Retrieval Engine Edition of versions earlier than V3.8.0

)

1-16

1

Enables parallel optimization on the Searcher.

If the version of OpenSearch Retrieval Engine Edition is V3.8.0 or later, use the new implementation. For more information, see Hint.

Note: The new implementation and the old implementation are incompatible. Do not use them at the same time.

parallelTables (

applicable to OpenSearch Retrieval Engine Edition 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 and is used in joins.

databaseName

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.

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.

iquan.optimizer.sort.limit.use.together

true/false

true

Specifies whether to forcibly specify a LIMIT clause after the ORDER BY clause if the ORDER BY clause is used.

iquan.optimizer.force.limit.num

ulimit

100

If you set the iquan.optimizer.force.limit.enable parameter to true, the value of the iquan.optimizer.force.limit.num parameter is used as the value of the LIMIT clause by iquan.

iquan.optimizer.join.condition.check

true/false

true

Specifies whether the fields that need to be joined 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.type

json

json

The format of the execution plan that is generated by iquan. Only JSON is supported.

iquan.plan.prepare.level

rel.post.optimize

jni.post.optimize

jni.post.optimize

Used together with the iquan.plan.cache.enable and dynamic_params parameters. We recommend that you set this parameter to jni.post.optimize.

If you set the iquan.plan.cache.enable parameter to true, iquan stores the results of the specified phase in 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 C++ 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

""

The 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

""

The source of the business party. Enter the source in the specified format.

Recommendation scenarios in The Personalization Platform (TPP): tpp-appid-abid-solutionid-ip

Other scenarios: Product name-System name-IP address

dynamic_params

Two-dimensional array

No default value.

Dynamic parameters

urlencode_data

true / false

false

If the value of the dynamic_params parameter is URL encoded, set this parameter to true.

Note:

  1. If the name of a configuration item is the same as a parameter name in a kvpair clause, the parameter in the kvpair clause takes precedence.

  2. Separate multiple key-value pairs with semicolons (;). Do not specify spaces before semicolons (;) or after semicolons (;).