<@U0A71G31CDV> do we have anything similar to try ...
# questions-and-troubleshooting
s
@Rocky do we have anything similar to try catch in starrocks? if i want to do implement, any recommendations?
r
StarRocks does not currently have a native
TRY...CATCH
statement or a
DECLARE ... HANDLER
mechanism (common in MySQL/Oracle) for error handling within its SQL or procedural language. As of early 2026, procedural support (like stored procedures) is an area of active development, but standard exception handling blocks are not yet available in the SQL layer. Recommendations for Implementation Since you cannot use a native
TRY...CATCH
block, you should consider these alternative strategies: 1. Application-Level Error Handling: Handle database errors in your application code (Python, Java, Go, etc.). Wrap your SQL execution calls in a
try-except
or
try-catch
block. This is the most reliable way to implement complex retry logic or fallback procedures. 2. External Orchestration (Airflow/DolphinScheduler): If your logic is part of an ETL/ELT pipeline, use an orchestrator like Apache Airflow. You can use Airflow's built-in
retries
,
retry_delay
, and
on_failure_callback
features to manage task failures and recovery. 3. StarRocks Tasks (for basic automation): While StarRocks Tasks can schedule SQL execution, they currently support only single SQL statements. If you need multi-step logic with error handling, you may need to decompose your logic into multiple tasks or use an external script. 4. Data Loading Error Tolerance: If your "try-catch" requirement is related to skipping bad data during ingestion, use the following properties in your
ROUTINE LOAD
or `STREAM LOAD`: *
max_filter_ratio
: Allows the job to continue even if a certain percentage of rows fail to load. *
max_error_number
: Specifies the maximum number of error rows allowed before the job pauses. 5. Validation Before Action: Instead of catching an error after it occurs, use conditional logic to prevent it. For example, check for the existence of a table or partition before running a
DROP
or
INSERT
by querying the
information_schema
. For updates on procedural SQL features, keep an eye on the StarRocks GitHub repository or the official release notes. Referencesusing_starrocks/SQL_plan_manager.mdsql-reference/sql-statements/cluster-management/nodes_processes/SHOW_PROC.mdsql-reference/sql-statements/prepared_statement.md
s
@Rocky do we have a rough timeline when the stored procedures support will be added in starrocks?
r
As of early 2026, there is no official release date or firm version number committed for native stored procedure support in StarRocks. While it is one of the most frequently requested features for enterprise migrations (especially for those moving from legacy systems like Oracle or MySQL), it remains in the proposal and discussion phase. Current Status * Active Discussions: There are ongoing community discussions and feature requests (e.g., GitHub issue #67805 and #49439) where users and maintainers are defining the scope, including support for variables, loops, and error handling. * Roadmap: While "Enhanced Functionality" is a core pillar of the 2025–2026 roadmaps, stored procedures have not yet been assigned to a specific minor release (like 3.4 or 3.5). * Infrastructure: The
information_schema.routines
table exists in the system but currently carries a note stating it "does not apply to the available features in StarRocks," indicating the metadata structure is prepared but the engine logic is not. Recommendation If you need a timeline for a specific project, the best way to get the most current "insider" update is to: 1. Monitor GitHub: Watch Issue #67805 for progress. 2. Ask in Slack: Check the
#general
or
#product
channels in the StarRocks Community Slack. Maintainers often share more granular progress there before it hits the official docs. Until this is released, the recommended approach remains using external orchestration (like Airflow or dbt) or application-side logic to handle multi-step SQL execution and error handling. Referencesdeployment/shared_data/feature-support-shared-data.mdusing_starrocks/SQL_plan_manager.mdrelease_notes/release-3.2.mdrelease_notes/release-3.3.mdrelease_notes/release-2.5.mdrelease_notes/release-3.4.mdsql-reference/information_schema/routines.md