hudi-agent commented on code in PR #18539:
URL: https://github.com/apache/hudi/pull/18539#discussion_r3262466506
##########
hudi-flink-datasource/hudi-flink1.20.x/src/main/java/org/apache/hudi/adapter/DataTypeAdapter.java:
##########
@@ -22,32 +22,42 @@
import org.apache.flink.table.types.DataType;
import org.apache.flink.table.types.logical.LogicalType;
import org.apache.flink.types.variant.Variant;
+import org.apache.hudi.common.util.Option;
+import org.apache.parquet.schema.LogicalTypeAnnotation;
/**
* Adapter utils to provide {@code DataType} utilities.
*/
public class DataTypeAdapter {
+ private static final String VARIANT_UNSUPPORTED_MSG =
+ "VARIANT type is only supported in Flink 2.1+. "
+ + "Please upgrade your Flink version to use Variant columns.";
+
+ public static Option<LogicalTypeAnnotation> variantParquetAnnotation() {
Review Comment:
🤖 nit: the `Option<LogicalTypeAnnotation>` return type suggests
present/empty semantics, but this implementation always throws — a future
reader calling it expecting Option-style handling could be surprised. Consider
returning `Option.empty()` here (and letting the caller's `orElseThrow` produce
the error) so the signature reflects actual behavior across versions.
<sub><i>- AI-generated; verify before applying. React 👍/👎 to flag
quality.</i></sub>
--
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]