{"record":{"id":"d9bc3767ddf83699","repo":"apache/iceberg","slug":"database-warning-d9bc37","errorCode":null,"errorMessage":"Database warning","messagePattern":"Database warning","errorType":"exception","errorClass":"UncheckedSQLException","httpStatus":null,"severity":"warning","filePath":"core/src/main/java/org/apache/iceberg/jdbc/JdbcViewOperations.java","lineNumber":121,"sourceCode":"        validateMetadataLocation(view, base);\n        String oldMetadataLocation = base.metadataFileLocation();\n        // Start atomic update\n        LOG.debug(\"Committing existing view: {}\", viewName());\n        updateView(newMetadataLocation, oldMetadataLocation);\n      } else {\n        // view does not exist, create it\n        LOG.debug(\"Committing new view: {}\", viewName());\n        createView(newMetadataLocation);\n      }\n\n    } catch (SQLTimeoutException e) {\n      throw new UncheckedSQLException(e, \"Database Connection timeout\");\n    } catch (SQLTransientConnectionException | SQLNonTransientConnectionException e) {\n      throw new UncheckedSQLException(e, \"Database Connection failed\");\n    } catch (DataTruncation e) {\n      throw new UncheckedSQLException(e, \"Database data truncation error\");\n    } catch (SQLWarning e) {\n      throw new UncheckedSQLException(e, \"Database warning\");\n    } catch (SQLException e) {\n      if (JdbcUtil.isConstraintViolation(e)) {\n        if (currentMetadataLocation() == null) {\n          throw new AlreadyExistsException(e, \"View already exists: %s\", viewIdentifier);\n        } else {\n          throw new UncheckedSQLException(e, \"View already exists: %s\", viewIdentifier);\n        }\n      }\n\n      throw new UncheckedSQLException(e, \"Unknown failure\");\n    } catch (InterruptedException e) {\n      Thread.currentThread().interrupt();\n      throw new UncheckedInterruptedException(e, \"Interrupted during commit\");\n    }\n  }\n\n  @Override\n  protected String viewName() {","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/jdbc/JdbcViewOperations.java#L103-L139","documentation":"Thrown by JdbcViewOperations.doCommit when the driver raises a SQLWarning during a view commit. Wrapped in UncheckedSQLException. SQLWarning is rarely fatal; surfacing it as an exception means the driver reported a warning condition the code treats as a failed commit (driver-specific behavior).","triggerScenarios":"Committing a view while the driver emits a SQLWarning (e.g. implicit conversion, feature deprecation warnings escalated to exceptions by some drivers, or session-level warnings during DDL/DML).","commonSituations":"Unusual JDBC drivers or strict driver configurations that convert warnings into thrown SQLWarning subclasses; database version mismatches producing escalation warnings.","solutions":["Inspect the wrapped SQLWarning cause for the driver-specific message","Check driver version compatibility with your database and update the JDBC driver","Look for driver settings that escalate warnings to exceptions and adjust them","Retry the commit if the warning was spurious and the database state is unchanged"],"exampleFix":"// before\n// driver X throws SQLWarning on schema drift\n// after\n// upgrade driver and pin compatible version in build\n// e.g. postgresql 42.7.x for PostgreSQL 15+","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  view.updateSchema(apply);\n} catch (UncheckedSQLException e) {\n  if (e.getCause() instanceof SQLWarning) {\n    LOG.warn(\"SQL warning during commit: {}\", e.getCause().getMessage());\n  } else throw e;\n}","preventionTips":["Pin a JDBC driver version compatible with your database","Avoid driver settings that escalate warnings into exceptions","Review wrapped cause messages when warnings appear"],"tags":["jdbc","sql","warning"],"backgroundTag":"database-write-failed","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}