{"record":{"id":"7883be1767228809","repo":"apache/seatunnel","slug":"sql-operation-failed-7883be","errorCode":"SQL_OPERATION_FAILED","errorMessage":"Failed to apply schema change: {e.getMessage()}","messagePattern":"Failed to apply schema change: (.+?)","errorType":"error_code","errorClass":"DatabendConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-databend/src/main/java/org/apache/seatunnel/connectors/seatunnel/databend/schema/SchemaChangeManager.java","lineNumber":85,"sourceCode":"                                \"%s/%s\", databendSinkConfig.getUrl(), tablePath.getDatabaseName()),\n                        databendSinkConfig.toProperties())) {\n            if (event instanceof AlterTableCommentEvent\n                    || event instanceof AlterColumnCommentEvent) {\n                // Comment-only changes are not supported by Databend sink, safely ignore\n                log.info(\n                        \"Ignoring comment change event for table {} - Databend sink does not support comment sync: {}\",\n                        tablePath.getFullName(),\n                        event.getClass().getSimpleName());\n            } else if (event instanceof AlterTableColumnsEvent) {\n                applySchemaChange(connection, tablePath, (AlterTableColumnsEvent) event);\n            } else if (event instanceof AlterTableColumnEvent) {\n                applySchemaChange(connection, tablePath, (AlterTableColumnEvent) event);\n            } else {\n                throw new SeaTunnelException(\n                        \"Unsupported schemaChangeEvent: \" + event.getClass().getName());\n            }\n        } catch (SQLException e) {\n            throw new DatabendConnectorException(\n                    DatabendConnectorErrorCode.SQL_OPERATION_FAILED,\n                    \"Failed to apply schema change: \" + e.getMessage(),\n                    e);\n        }\n    }\n\n    private void applySchemaChange(\n            Connection connection, TablePath tablePath, AlterTableColumnEvent event)\n            throws SQLException, IOException {\n        if (event instanceof AlterColumnCommentEvent) {\n            // Databend does not support comment synchronization, including nested column events.\n            log.info(\n                    \"Ignoring comment change event for table {} - Databend sink does not support comment sync: {}\",\n                    tablePath.getFullName(),\n                    event.getClass().getSimpleName());\n        } else if (event instanceof AlterTableChangeColumnEvent) {\n            AlterTableChangeColumnEvent changeColumnEvent = (AlterTableChangeColumnEvent) event;\n            if (!changeColumnEvent.getOldColumn().equals(changeColumnEvent.getColumn().getName())) {","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-databend/src/main/java/org/apache/seatunnel/connectors/seatunnel/databend/schema/SchemaChangeManager.java#L67-L103","documentation":"Wrapper for SQLExceptions thrown while executing DDL for a schema change against Databend. The original SQL exception is preserved as the cause. It means the ALTER/CREATE COLUMN SQL sent to Databend failed at the server.","triggerScenarios":"applySchemaChange executing generated DDL (add/alter/drop column) and the JDBC driver returning a SQLException — bad SQL syntax, column conflicts, permission issues, or connection drops.","commonSituations":"Adding a column with a type Databend rejects; altering a column in ways Databend does not support; network/auth failure mid-session; table locked or concurrently modified.","solutions":["Inspect the cause's message for the underlying Databend server error","Manually run the generated ALTER statement against Databend to see the exact failure","Verify Databend user has ALTER privileges on the target table","Check network connectivity and credentials to the Databend server"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    schemaChangeManager.applySchemaChange(event);\n} catch (DatabendConnectorException e) {\n    if (e.getErrorCode() == DatabendConnectorErrorCode.SQL_OPERATION_FAILED) {\n        log.error(\"DDL failed, cause: \" + e.getCause(), e);\n    } else { throw e; }\n}","preventionTips":["Validate generated DDL against Databend's SQL dialect","Grant ALTER privileges to the sink user","Test schema evolution against a staging Databend instance"],"tags":["databend","sql","schema-change","ddl"],"backgroundTag":"sql-query-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}