class行不同长度的对象

Object of the class Row with different length

我可以将 class 行的对象创建为:

Row row = RowFactory.create(1,2,3);

此 Row 对象的长度为 3。 如何在不手动键入每个值(例如填充随机数)的情况下创建长度为 10000 的行对象?

你可以试试

Row row = RowFactory.create((1 to 10000).toList);

随机值:

Row row = RowFactory.create((1 to 10000).map ( Random.nextInt).toList);