github-actions[bot] commented on code in PR #66677:
URL: https://github.com/apache/doris/pull/66677#discussion_r3764847092
##########
fe/be-java-extensions/jdbc-scanner/src/main/java/org/apache/doris/jdbc/JdbcJniScanner.java:
##########
@@ -380,4 +386,94 @@ private String createCacheKey() {
jdbcDriverUrl, jdbcDriverClass, connectionPoolMinSize,
connectionPoolMaxSize,
connectionPoolMaxLifeTime, connectionPoolMaxWaitTime,
connectionPoolKeepAlive);
}
+
+ /**
+ * Refuse the scan when the driver reports a wider column than the plan
was built with.
+ *
+ * <p>The plan's types come from the catalog's cached view of the remote
schema. If the remote
+ * DDL widened a column since then, the planner never inserted a narrowing
cast, and the extra
+ * digits would land in a column whose declared type cannot hold them.
+ *
+ * <p>Checked once per scan, so the error can name the column and both
precisions. Only the
+ * widening direction, and only when the driver answers: they vary in how
faithfully they fill
+ * in ResultSetMetaData, and one with nothing to say must not fail every
scan.
+ */
+ private void checkSourcePrecisionAgainstPlan() throws SQLException {
+ for (int i = 0; i < types.length; i++) {
Review Comment:
[P1] Include nullability widening in this stale-schema guard. A cached
PostgreSQL `INT NOT NULL` produces a non-nullable scan slot; after remote `DROP
NOT NULL` and an inserted `NULL`, live metadata reports `columnNullable`, but
this loop has no planned nullability to compare. The handler returns null and
`VectorColumn` writes a null map plus zero payload; `JniDataBridge` ignores
that map for the stale non-nullable slot and silently returns `0`. Carry
planned nullability and reject definite `NOT NULL -> nullable` drift, with a
NULL regression.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]