fudianchn commented on PR #39613:
URL: https://github.com/apache/shardingsphere/pull/39613#issuecomment-5697211597

   Both blocking issues and the six findings are addressed; pushed as 
`87b1d4e4`, squashed back into the single commit.
   
   **In-place stand-ins vs appended derived columns.** The stripping predicate 
in `isCountMismatchExplainedByDerivedColumns` and in the label-index map is now 
`DerivedColumn.isDerivedColumn()`, which excludes 
`AGGREGATION_DISTINCT_DERIVED`, so an in-place stand-in like `user_id AS 
AGGREGATION_DISTINCT_DERIVED_0` keeps the position of its client column instead 
of being removed as an appended internal column. The remaining returned labels 
are compared to the expanded projections position by position, 
case-insensitively for lower-case-folding backends; an `AggregationProjection` 
whose alias is a derived name is matched by that alias, and a count mismatch 
after stripping short-circuits to drift. The sorting is gone, so reordered 
backend columns are no longer accepted as equivalent.
   
   **Integrated regression.** 
`assertGetColumnCountAndLabelUseExpandedProjectionsWhenAggregationDistinctProjectionRewritten`
 builds a real binder context for a multi-route `COUNT(DISTINCT user_id)` with 
a derived group-by column and returns `[AGGREGATION_DISTINCT_DERIVED_0, 
GROUP_BY_DERIVED_0]`: on `f7f0e647` `getColumnCount()` returned 0; it now 
returns 1 with label `COUNT(DISTINCT user_id)`. 
`assertCreateColumnLabelAndIndexMapFallsBackToResultSetMetaDataWhenDerivedColumnAppendedWithReorderedColumns`
 pins reordered backend columns as drift; it fails when the positional match is 
mutated to ignore order.
   
   **Comments.** The 40 ordinary `//` comments are removed. Javadoc remains 
only on `useExpandedProjections` for the reconciliation contract and on the 
layout for the cache and passthrough contract; the pre-existing `// TODO` in 
`MySQLComStmtPrepareExecutor` is untouched.
   
   **Findings.** `ClientVisibleColumnLayout` is now a private static nested 
class of `ShardingSphereResultSetMetaData`, its only production owner, and the 
top-level file is deleted; its Javadoc states that concurrent first accesses 
may compute the layout more than once, which is benign because it is derived 
state. `useExpandedProjections` is package-private. The two tests modeling a 
mid-position appended derived column are dropped. The header-read budget test 
asserts bounded linear work — count reads ≤ column count, label reads ≤ 4 × 
column count — which the per-accessor form (64 count reads for 6 columns on 
`bd23a77d`) still exceeds.
   
   Gates: jdbc 1244/0, proxy/backend/core 583/0, proxy/frontend/dialect/mysql 
200/0, spotless:check + checkstyle:check on all three modules.
   


-- 
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]

Reply via email to