目前Spark有两个Row实现:
import org.apache.spark.sql.Row
import org.apache.spark.sql.catalyst.InternalRow
两者兼而有之有什么必要?它们是否表示相同的编码实体,但一个在内部使用(内部 API),另一个与外部 API 一起使用?
Row 是 (well..) 的稳定版本实现。排。。。但是,顾名思义,InternalRow将在Spark SQL内部使用。我在下面引用了InternalRow的文档:
/**
* An abstract class for row used internally in Spark SQL, which only contains the columns as
* internal types.
*/
abstract class InternalRow extends SpecializedGetters with Serializable {