XiaoHongbo-Hope commented on code in PR #10336:
URL: https://github.com/apache/paimon/pull/10336#discussion_r4178140129
##########
docs/docs/pypaimon/data-types.md:
##########
@@ -233,6 +233,29 @@ Field names are literal (`state.x` is not a nested path).
Missing fields are
omitted; VARIANT NULL is `None`. Values use natural Python types, even when
types differ between rows. This does not reduce Parquet I/O.
+To return selected numeric VARIANT fields instead of the full value, use native
+projection:
+
+```python
+import pyarrow as pa
+
+read_builder = table.new_read_builder().with_projection(
+ ['payload'],
+ variant_fields={
+ 'payload': {
+ 'paths': ["$['state.x']", "$['action.y']"],
+ 'target_type': pa.float32(),
+ },
+ },
Review Comment:
@JingsongLi Do you have any suggestion about the user API in pypaimon side?
--
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]