| /* |
| * Copyright 2016, Yahoo! Inc. |
| * Licensed under the terms of the Apache License 2.0. See LICENSE file at the project root for terms. |
| */ |
| |
| package com.yahoo.sketches.pig.quantiles; |
| |
| import org.apache.pig.backend.executionengine.ExecException; |
| import org.apache.pig.data.Tuple; |
| import org.apache.pig.data.TupleFactory; |
| |
| class Util { |
| |
| static Tuple doubleArrayToTuple(final double[] array) throws ExecException { |
| final Tuple tuple = TupleFactory.getInstance().newTuple(array.length); |
| for (int i = 0; i < array.length; i++) { |
| tuple.set(i, array[i]); |
| } |
| return tuple; |
| } |
| |
| } |