This is an automated email from the ASF dual-hosted git repository. chaokunyang pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/fory-site.git
The following commit(s) were added to refs/heads/main by this push: new ea37f2ae 🔄 synced local 'docs/guide/' with remote 'docs/guide/' ea37f2ae is described below commit ea37f2ae1bdd435e7be5ac0cada8f4c1b719659b Author: chaokunyang <shawn.ck.y...@gmail.com> AuthorDate: Wed Jun 18 12:24:11 2025 +0000 🔄 synced local 'docs/guide/' with remote 'docs/guide/' --- docs/guide/row_format_guide.md | 53 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/docs/guide/row_format_guide.md b/docs/guide/row_format_guide.md index 5d739e80..f48ee5c2 100644 --- a/docs/guide/row_format_guide.md +++ b/docs/guide/row_format_guide.md @@ -116,6 +116,59 @@ for (int i = 0; i < 10; i++) { return arrowWriter.finishAsRecordBatch(); ``` +### Support for Interface and Extension Types + +Fury now supports row format mapping for Java `interface` types and subclassed (`extends`) types, enabling more dynamic and flexible data schemas. + +These enhancements were introduced in [#2243](https://github.com/apache/fury/pull/2243), [#2250](https://github.com/apache/fury/pull/2250), and [#2256](https://github.com/apache/fury/pull/2256). + +#### Example: Interface Mapping with RowEncoder + +```java +public interface Animal { + String speak(); +} + +public class Dog implements Animal { + public String name; + + @Override + public String speak() { + return "Woof"; + } +} + +// Encode and decode using RowEncoder with interface type +RowEncoder<Animal> encoder = Encoders.bean(Animal.class); +Dog dog = new Dog(); +dog.name = "Bingo"; +BinaryRow row = encoder.toRow(dog); +Animal decoded = encoder.fromRow(row); +System.out.println(decoded.speak()); // Woof + +``` + +#### Example: Extension Type with RowEncoder + +```java +public class Parent { + public String parentField; +} + +public class Child extends Parent { + public String childField; +} + +// Encode and decode using RowEncoder with parent class type +RowEncoder<Parent> encoder = Encoders.bean(Parent.class); +Child child = new Child(); +child.parentField = "Hello"; +child.childField = "World"; +BinaryRow row = encoder.toRow(child); +Parent decoded = encoder.fromRow(row); + +``` + Python: ```python --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@fory.apache.org For additional commands, e-mail: commits-h...@fory.apache.org