Zouxxyy opened a new pull request, #4729: URL: https://github.com/apache/paimon/pull/4729
<!-- Please specify the module before the PR name: [core] ... or [flink] ... --> ### Purpose Variant was born from Apache Spark, and the encoding rules have been incorporated into Parquet https://github.com/apache/parquet-format/blob/master/VariantEncoding.md This PR add the basic interface of Variant and ported the latest implementation of Spark. ```java public interface Variant { /** Returns the variant metadata. */ byte[] metadata(); /** Returns the variant value. */ byte[] value(); /** Parses the variant to json. */ String toJson(); /** * Extracts a sub-variant value according to a path which start with a `$`. */ Object variantGet(String path); } ``` Usage ```java String json = "{\"age\":35,\"city\":\"Hangzhou\"}"; Variant v = GenericVariant.fromJson(json); assertThat(v.variantGet("$.age")).isEqualTo(35L); assertThat(v.variantGet("$.city")).isEqualTo("Hangzhou"); ``` ### Tests <!-- List UT and IT cases to verify this change --> ### API and Format <!-- Does this change affect API or storage format --> ### Documentation <!-- Does this change introduce a new feature --> -- 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]
