jackylee-ch opened a new pull request, #786:
URL: https://github.com/apache/paimon-rust/pull/786
`PyDataField.field_type()` returns Rust `Debug` output — a column declared
`VARCHAR(10)` reads back as `Varchar(VarCharType { length: 10, nullable:
true })`.
The in-place `TODO(#284 follow-up)` names the cause: `DataType` has no
enum-level
`Display`, so there was nothing to call.
Only 10 of the 23 variants carried a leaf `Display`. This adds the other nine
scalars and the four constructed types, then the dispatch. The constructed
formats
fill Java's `FORMAT` with the children's own SQL strings (`ARRAY<%s>`,
`MAP<%s, %s>`, `MULTISET<%s>`, `ROW<%s>`), so a child's `NOT NULL` sits
inside the
brackets and the outer one after them; `ROW` renders fields like
`DataField.asSQLString` — escaped name, type, then `COMMENT '...'`. Every
keyword
and format string was checked against the Java class rather than inferred.
The dispatch also retires `VectorType::element_sql_name`, a private table of
seven
primitive names with `unreachable!()` for the rest, which existed only
because this
dispatch did not.
`cargo test -p pypaimon_rust` cannot link libpython here, so the binding is
compile-checked locally and its behaviour left to `integration (python)`.
The rendering is covered by unit tests in `paimon`.
--
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]