Troubleshoot issues with the multi-stage query engine (v2)
Troubleshoot issues with the multi-stage query engine (v2).
Learn how to troubleshoot errors when using the multi-stage query engine (v2), and see multi-stage query engine limitations.
Find instructions on how to enable the multi-stage query engine, or see a high-level overview of how the multi-stage query engine works.
Limitations of the multi-stage query engine
We are continuously improving the multi-stage query engine. A few limitations to call out:
Support for multi-value columns is limited
Support for multi-value columns is limited to projections, and predicates must use the arrayToMv
function. For example, to successfully run the following query:
You must include arrayToMv
in the query as follows:
Schema and other prefixes are not supported
Schema and other prefixes are not supported in queries. For example, the following queries are not supported:
Queries without prefixes are supported:
Modifying query behavior based on the cluster config is not supported
Modifying query behavior based on the cluster configuration is not supported. distinctcounthll
, distinctcounthllmv
, distinctcountrawhll
, and distinctcountrawhllmv
will always use the default value for log2m
in the multi-stage engine unless the value is explicitly defined in the query itself. Therefore, the following query may produce different results in single-stage and multi-stage engine depending on your cluster configuration (default.hyperloglog.log2m
):
To ensure same results across both query engines, specify the log2m
param value explicitly in your query:
Ambiguous reference to a projected column in statement clauses
If a column is repeated more than once in SELECT statement, that column requires disambiguate aliasing. For example, in the following query, the reference to colA
is ambiguous whether it's to the first or second projected colA
:
The solution is to rewrite the query either use aliasing:
Or use index-based referencing:
Tightened restriction on function signature and type matching
Pinot single-stage query engine automatically do implicit type casts in many of the situations, for example when running the following:
it will automatically convert both values to long datatypes before comparison. This behavior however could cause issues and thus it is not so widely applied in the multi-stage engine where a stricter datatype conformance is enforced. the example above should be explicitly written as:
Default names for projections with function calls
Default names for projections with function calls are different between single and multi-stage.
For example, in multi-stage, the following query:
Returns the following result:
In single-stage, the following function:
Returns the following result:
Table names and column names are case sensitive
In multi-stage, table and column names and are case sensitive. In single-stage they were not. For example, the following two queries are not equivalent in multi-stage engine:
select * from myTable
select * from mytable
Note: Function names are not case sensitive in neither single nor multi-stage.
Arbitrary number of arguments isn't supported
An arbitrary number of arguments is no longer supported in multi-stage. For example, in single-stage, the following query worked:
In multi-stage, this query must be rewritten as follows:
Note: Remember that select 1 + 2 + 3 + 4 + 5 from table
is still valid in multi-stage
Return type for binary arithmetic operators (+, -, *, /)
In the single-stage engine, these operators would always result in a DOUBLE
value being returned, no matter the operand types. In the multi-stage engine, however, the result type depends on the input operand types - for instance, adding two LONG
values will result in a LONG
and so on.
Return type for aggregations like SUM, MIN, MAX
In the single-stage engine, these aggregations would always result in a DOUBLE
value being returned, no matter the operand types. In the multi-stage engine, however, the result type depends on the data type of the column being aggregated.
NULL function support
Null handling is not supported when tables use table based null storing. You have to use column based null storing instead. See null handling support.
Custom transform function support
In multi-stage:
The
histogram
function is not supported.The
timeConvert
function is not supported, seedateTimeConvert
for more details.The
dateTimeConvertWindowHop
function is not supported.Array & Map-related functions are not supported.
Custom aggregate function support
Aggregate functions that requires literal input (such as
percentile
,firstWithTime
) might result in a non-compilable query plan.
Different type names
The multi-stage engine uses different type names than the single-stage engine. Although the classical names must still be used in schemas and some SQL expressions, the new names must be used in CAST expressions.
The following table shows the differences in type names:
Single-stage engine | Multi-stage engine |
---|---|
NULL | NULL |
BOOLEAN | BOOLEAN |
INT | INT |
LONG | BIGINT |
BIG_DECIMAL | DECIMAL |
FLOAT | FLOAT/REAL |
DOUBLE | DOUBLE |
INTERVAL | INTERVAL |
TIMESTAMP | TIMESTAMP |
STRING | VARCHAR |
BYTES | VARBINARY |
- | ARRAY |
JSON | - |
Varbinary literals
VARBINARY literals in multi-stage engine must be prefixed with X
or x
. For example, the following query:
In single-stage engine the same query would be:
Troubleshoot errors
Troubleshoot semantic/runtime errors and timeout errors.
Semantic/runtime errors
Try downloading the latest docker image or building from the latest master commit.
We continuously push bug fixes for the multi-stage engine so bugs you encountered might have already been fixed in the latest master build.
Try rewriting your query.
Some functions previously supported in the single-stage query engine (v1) may have a new way to express in the multi-stage engine (v2). Check and see if you are using any non-standard SQL functions or semantics.
Timeout errors
Try reducing the size of the table(s) used.
Add higher selectivity filters to the tables.
Try executing part of the subquery or a simplified version of the query first.
This helps to determine the selectivity and scale of the query being executed.
Try adding more servers.
The new multi-stage engine runs distributed across the entire cluster, so adding more servers to partitioned queries such as GROUP BY aggregates, and equality JOINs help speed up the query runtime.
Last updated