【发布时间】:2020-06-24 01:28:23
【问题描述】:
我想在我的 PCollection 中使用我的 AutoValue 数据类作为对象类型,但是我在使用自动编码器时遇到了问题:
@AutoValue
public abstract class MyPersonClass {
public abstract String getName();
public abstract Integer getAge();
public abstract Float getHeight();
public static MyPersonClass create(String name, Integer age, Float height) {
return new AutoValue_MyPersonClass(name, age, height);
}
}
每当我使用它时,我都会从 Beam 尝试选择编码器时收到错误消息。我不想为它定义自己的编码器。
如何使用编码器来推断我的 AutoValue 类的架构?或者可以自动推断出不同的编码器吗?
【问题讨论】:
标签: java google-cloud-dataflow apache-beam