wgzhao opened a new pull request, #12742:
URL: https://github.com/apache/seatunnel/pull/12742

   Follow-up to #12333, closing out the five leftover review points raised 
there. All five are behaviour-neutral and #12333 itself goes in unchanged.
   
   **Stacked on #12333's head** (`wgzhao:fix_10451_unsigned_detection`), so 
until #12333 merges this PR also carries that PR's commits. Once #12333 lands 
on `dev` the merge base moves and the diff reduces to the single commit here.
   
   ### 1 + 5 — the guard moves next to the constants and derives from them
   
   `isNumericUnsignedColumnType` moves from `JdbcCatalogUtils` into 
`MySqlTypeConverter`, next to the `MYSQL_*_UNSIGNED` constants, and the set of 
numeric base types it accepts is now derived from those constants (stripping 
`UNSIGNED_SUFFIX`) instead of being re-typed. `MySqlCatalog` and 
`OceanBaseMySqlCatalog` both call the same method, and `convert` reuses 
`UNSIGNED_SUFFIX` so the suffix has one definition.
   
   `MySqlTypeConverterTest#testGuardAcceptsEveryUnsignedTypeNameOfTheConverter` 
reflects over the constants and asserts every `MYSQL_*_UNSIGNED` base name is 
accepted, so a hand-written list that drops a type fails CI.
   
   ### 2 — the guard takes `DATA_TYPE` as well
   
   The signature is now `isNumericUnsignedColumnType(String dataType, String 
columnType)`. Both catalogs already read the server-normalised `DATA_TYPE`; the 
raw `COLUMN_TYPE` is only searched for the attribute, and only when the base 
type is one that can carry `UNSIGNED`.
   
   ### 3 — OceanBase E2E coverage
   
   `JdbcOceanBaseMysqlIT#testEnumColumnWithUnsignedWordInValueList` mirrors the 
MySQL case: `enum('unsigned','other')` is discovered as `STRING`, `int 
unsigned` as `LONG`, and plain `int` as `INT`, with the table dropped again 
inside the test so it cannot leak into the pattern/multi-table cases.
   
   One deviation from "mirror the four assertions": the SET column is not 
mirrored. `OceanBaseMySqlTypeConverter` has no `MYSQL_SET` case at all, so a 
SET column fails discovery on OceanBase with or without this guard — the guard 
is not what decides it there. The ENUM shape reproduces the #10451 failure 
exactly (`ENUM UNSIGNED` before the guard, `ENUM` after) and is the reachable 
half.
   
   ### 4 — javadoc
   
   The set's javadoc no longer claims it mirrors the converters. It now states 
that membership comes from the `MYSQL_*_UNSIGNED` constants — which include 
`BIT` and `YEAR` for parity with MySQL's type list even though MySQL does not 
accept `UNSIGNED` on them — and why keeping the superset is deliberate.
   
   ## Verification
   
   - `./mvnw -pl seatunnel-connectors-v2/connector-jdbc test 
-Dtest=MySqlTypeConverterTest,MySqlCatalogUnsignedDetectionTest,JdbcCatalogUtilsTest`
 — 58 tests, 0 failures.
   - `connector-jdbc` main and test sources compile; 
`connector-jdbc-e2e-part-2` test sources compile, including the new IT.
   - `spotless:apply` / `spotless:check` clean.
   
   Not run here: the E2E IT itself needs Docker, which this environment does 
not have; it will run on the `connector-jdbc-e2e-part-2` shard in CI. The 
Mockito-based unit tests need a JDK below 21 (the pinned Byte Buddy supports up 
to Java 20) and were run on JDK 17.
   


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