You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Avro code generator maps the schema namespace as the Java package name, and the schema object name as the Java class name. For the ZFT schema this means it tries to create the following four classes:
ztf.alert
ztf.alert.cutout
ztf.alert.candidate
ztf.alert.prv_candidate
For the top level alert, the package name is ztf and the class name is alert. For the other three classes, the package name is ztf.alert and the class names are cutout, candidate and prv_candidate. This means that the full name of the ztf.alert class conflicts with the package name of the other three classes.
We solved the problem locally by manually tweaking the schema before we generate the Java classes, but it would be good to avoid this in the future. Next time we generate a new schema version can we change the schema namespaces to avoid this conflict. Suggested fix would be to make all four classes have the same namespace e.g.
ztf.alert
ztf.cutout
ztf.candidate
ztf.prv_candidate
The text was updated successfully, but these errors were encountered:
The current schema namespaces are not compatible with the Java class generators from the Apache Avro project.
The Avro code generator creates Java classes for each top level object in the Avro schema, along with all of the serializing and deserializing code needed read and write them. See Serializing and deserializing with code generation and Using Avro's code generation from Maven.
The Avro code generator maps the schema namespace as the Java package name, and the schema object name as the Java class name. For the ZFT schema this means it tries to create the following four classes:
ztf.alert
ztf.alert.cutout
ztf.alert.candidate
ztf.alert.prv_candidate
For the top level alert, the package name is
ztf
and the class name isalert
. For the other three classes, the package name isztf.alert
and the class names arecutout
,candidate
andprv_candidate
. This means that the full name of theztf.alert
class conflicts with the package name of the other three classes.We solved the problem locally by manually tweaking the schema before we generate the Java classes, but it would be good to avoid this in the future. Next time we generate a new schema version can we change the schema namespaces to avoid this conflict. Suggested fix would be to make all four classes have the same namespace e.g.
ztf.alert
ztf.cutout
ztf.candidate
ztf.prv_candidate
The text was updated successfully, but these errors were encountered: