Код: Выделить всё
public class MyDataToCatalyst extends UnaryExpression implements NonSQLExpression, ExpectsInputTypes, Serializable {
//...
}
< /code>
However, I cannot get this to compile, because the class definition of UnaryExpressionКод: Выделить всё
public abstract class UnaryExpression extends Expression implements UnaryLike {
public final TreeNode mapChildren(Function1);
public final TreeNode withNewChildrenInternal(IndexedSeq);
//...
}
< /code>
UnaryExpressionКомпилятор не выполняет эти ошибки соответственно:
'mapChildren(Function1)' in 'org.apache.spark.sql.catalyst.expressions.UnaryExpression' clashes with 'mapChildren(Function1)' in 'org.apache.spark.sql.catalyst.trees.TreeNode'; incompatible return type
'withNewChildrenInternal(IndexedSeq)' in 'org.apache.spark.sql.catalyst.expressions.UnaryExpression' clashes with 'withNewChildrenInternal(IndexedSeq)' in 'org.apache.spark.sql.catalyst.trees.TreeNode'; incompatible return type
< /code>
This actually looks like a bug in the Scala compiler to me, generating a bad class file.
If the methods were not final, I could have probably just overridden them in my subclass to fix the issue, but this way, I'm stuck.
Подробнее здесь: https://stackoverflow.com/questions/797 ... on-in-java