nevzheng opened a new pull request, #11964:
URL: https://github.com/apache/gravitino/pull/11964

   ### What changes were proposed in this pull request?
   
   Adds a `variant` case to the CLI's `TypeConverter.convert(String)` so a user 
can specify a `variant` column from the terminal via the type string (e.g. 
`--datatype variant`). Previously this threw `IllegalArgumentException: Unknown 
or unsupported type: variant`, even though `Types.VariantType` exists in the 
type system.
   
   - `TypeConverter.java`: map `"variant"` → `Types.VariantType.get()`.
   - Added unit tests in `TestTypeConverter` and `TestParseType` covering both 
the direct converter and the full `ParseType.toType("variant")` entry point.
   
   ### Why are the changes needed?
   
   The native `variant` type (#11932) was wired into the type system but not 
into the CLI's string→type parsing. As a result the CLI could not create or 
alter a column of type `variant`, leaving a gap in the "specify a column by 
typing its type string" flow. `variant` is a parameterless primitive, so 
parsing is lossless.
   
   Fix: #11963
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. The CLI now accepts `variant` as a column datatype (case-insensitive), 
e.g.:
   
   ```
   gravitino table create ... --columns col --datatype variant
   ```
   
   ### How was this patch tested?
   
   Added and ran unit tests:
   
   ```
   ./gradlew :clients:cli:test --tests 
'org.apache.gravitino.cli.TestTypeConverter' \
                               --tests 'org.apache.gravitino.cli.TestParseType' 
-PskipITs
   ```
   
   Both pass. Tests assert `TypeConverter.convert("variant")` and 
`ParseType.toType("variant")` return `Types.VariantType`.


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