Urban Hlastec
05/06/2026, 2:21 PMbiying gao
05/07/2026, 10:43 PMRocky
05/07/2026, 10:43 PMsql
SHOW VARIABLES LIKE 'parse_tokens_limit';
If it still shows the default value (usually 3500000), your SET GLOBAL command might not have applied to the active connection, or your client is overriding it.
2. Correct Way to Set the Variable
parse_tokens_limit is a system variable, not a configuration file (fe.conf) parameter. Setting it in fe.conf and restarting will have no effect. You must set it via SQL.
If you are using a very large SQL statement, try setting it at the session level immediately before running your query to ensure it applies:
sql
-- Increase to a much larger value, e.g., 10 million or more
SET parse_tokens_limit = 20000000;
-- Then run your query
SELECT ...;
3. Check for Related Limits
Even if you increase the token limit, extremely large SQL statements (like those with massive IN clauses or thousands of OR conditions) often hit secondary limits in the analyzer or the network layer:
* expr_children_limit (FE Configuration): This limits the number of elements in a single expression (e.g., items inside IN (...)). The default is 10000. If your query is large enough to hit the token limit, it is almost certainly hitting this too. This is an FE config, set it like this:
sql
ADMIN SET FRONTEND CONFIG ("expr_children_limit" = "1000000");
* max_allowed_packet (Session Variable): This limits the total size (in bytes) of the SQL text sent from the client to the server. The default is 33554432 (32MB). If your SQL string is larger than 32MB, increase this:
sql
SET GLOBAL max_allowed_packet = 1073741824; -- 1GB
4. Why "Restarting" didn't work
In StarRocks, SET GLOBAL variables are persisted in the FE's internal metadata. Restarting the FE/BE is usually not necessary for these changes to take effect, but it also won't "fix" a variable that wasn't set correctly in the metadata. If you added parse_tokens_limit to fe.conf, the FE ignored it because it's not a valid boot-time config parameter.
Recommended Troubleshooting Steps:
1. Check current session values: SHOW VARIABLES LIKE 'parse_tokens_limit';
2. Apply at session level: Run SET parse_tokens_limit = 20000000; in your current window before the query.
3. Increase expression limit: Run ADMIN SET FRONTEND CONFIG ("expr_children_limit" = "1000000");.
4. Simplify if possible: If the query still fails, consider breaking it into smaller chunks, using a temporary table, or using a JOIN with a CTE instead of a massive IN list.
References
• administration/management/FE_configuration.md