Github user myui commented on a diff in the pull request:
https://github.com/apache/incubator-hivemall/pull/145#discussion_r184277838
--- Diff:
core/src/main/java/hivemall/ftvec/trans/QuantifiedFeaturesUDTF.java ---
@@ -87,32 +87,37 @@ public StructObjectInspector
initialize(ObjectInspector[] argOIs) throws UDFArgu
@Override
public void process(Object[] args) throws HiveException {
- if (forwardObjs == null) {
- this.forwardObjs = new Object[] {Arrays.asList(columnValues)};
- }
-
+ int outputSize = args.length - 1;
boolean outputRow = boolOI.get(args[0]);
if (outputRow) {
- final DoubleWritable[] values = this.columnValues;
- for (int i = 0, outputSize = args.length - 1; i < outputSize;
i++) {
+ if (forwardObjs == null) {
+ // forwardObjs internally references columnValues
+ List<DoubleWritable> column = new ArrayList<>(outputSize);
+ this.forwardObjs = new Object[] {column};
--- End diff --
why not just `new Object[] {Arrays.asList(columnValues)};` as old code.
---