kvpair clause

更新时间:
复制 MD 格式

Use the kvpair clause in a query statement to pass key-value pairs that control query behavior, output format, and optimizer settings.

Syntax

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

Separate multiple key-value pairs with semicolons (;). Do not add spaces before or after a semicolon.

If a configuration item name matches a parameter name in the kvpair clause, the kvpair parameter takes precedence.

Example

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

Parameters

Output and format

ParameterValid valuesDefaultDescription
formatType / formatstring, json, full_json, flatbuffersstringThe format of the returned result. Use full_json for JSON-format queries. Use flatbuffers to improve query performance. For details, see Interpret query results.
resultReadabletrue, falsefalseSpecifies whether to add line breaks to results in JSON format for readability. Applies only when format is set to json or full_json.
searchInfotrue, falsefalseSpecifies whether to return search information.
sqlPlantrue, falsefalseSpecifies whether to return SQL plan information.
forbitMergeSearchInfotrue, falsefalseSpecifies whether Query Result Searcher (QRS) merges the search information returned by column searches. Set to true to get the details of each column separately.

Query execution

ParameterValid valuesDefaultDescription
traceDISABLE, FATAL, ERROR, WARN, INFO, DEBUG, TRACE1, TRACE2, TRACE3, SCHEDULE, NOTSETDISABLEThe verbosity level of query process information generated in the frontend.
timeoutulimitDetermined by the SQL statement configurationThe query timeout period, in milliseconds.
lackResultEnabletrue, falsefalseSpecifies whether missing columns are allowed in the result. For example, allows a column to be missing if an RPC timeout occurs.
databaseNameStringThe default database name that QRS uses to access the corresponding Searcher. To access multiple Searchers at the same time, specify the database name before the table name using the dbName.tableName format in the query statement.

Parallel execution (versions earlier than V3.8.0)

The parallel and parallelTables parameters apply to OpenSearch Retrieval Engine Edition versions earlier than V3.8.0. For V3.8.0 and later, use the new parallel implementation described in Hint. The two implementations are incompatible — do not use them at the same time.
ParameterValid valuesDefaultDescription
parallel1161Enables parallel optimization on the Searcher.
parallelTablesStringThe tables that support splitting and parallel execution in joins. Separate multiple table names with vertical bars (|). Use together with parallel.

Query source tracking

ParameterValid valuesDefaultDescription
exec.source.idString""The specific row accessed by the query. Values are generated in chronological order by default. Useful when multiple exchanges exist.
exec.source.specString""The source identifier of the business party. Format: tpp-appid-abid-solutionid-ip for The Personalization Platform (TPP) scenarios; Product name-System name-IP address for other scenarios.

Dynamic parameters

ParameterValid valuesDefaultDescription
dynamic_paramsTwo-dimensional arrayDynamic query parameters. For details, see Dynamic parameters.
urlencode_datatrue, falsefalseSpecifies whether the dynamic_params value is URL encoded. Set to true if the value is URL encoded.

Optimizer settings (iquan)

ParameterValid valuesDefaultDescription
iquan.optimizer.debug.enabletrue, falsefalseSpecifies whether to enable debugging in the optimization phase.
iquan.optimizer.sort.limit.use.togethertrue, falsetrueSpecifies whether a LIMIT clause is required after every ORDER BY clause.
iquan.optimizer.force.limit.numulimit100The value used as the LIMIT clause when iquan.optimizer.force.limit.enable is set to true.
iquan.optimizer.join.condition.checktrue, falsetrueSpecifies whether the fields used in a join must be hash fields.
iquan.optimizer.force.hash.jointrue, falsefalseSpecifies whether to convert all join nodes to hash join nodes.
iquan.plan.format.typejsonjsonThe format of the execution plan generated by iquan. Only JSON is supported.
iquan.plan.prepare.levelrel.post.optimize, jni.post.optimizejni.post.optimizeThe phase at which iquan caches or substitutes query plan results. Use together with iquan.plan.cache.enable and dynamic_params. Valid values: rel.post.optimize returns results from the Java optimization phase; jni.post.optimize returns results from the C++ phase after the Java Native Interface (JNI) call. Set to jni.post.optimize for best performance.
iquan.plan.cache.enabletrue, falsefalseSpecifies whether to cache the current query plan results.