@Override public RelWriter explainTerms(final RelWriter pw) { return super.explainTerms(pw).item("fields", Primitive.asList(fields)); }
@Override public RelWriter explainTerms(RelWriter pw) { return super.explainTerms(pw) .item("ctx", context == null ? "" : String.valueOf(context.id) + "@" + context.realization) .item("fields", Primitive.asList(fields)); }
/** * Adapts an array of {@code long} into a {@link List} of * {@link Long}. */ public static List<Long> asList(long[] elements) { //noinspection unchecked return (List<Long>) asList((Object) elements); }
/** * Adapts an array of {@code boolean} into a {@link List} of * {@link Boolean}. */ public static List<Boolean> asList(boolean[] elements) { //noinspection unchecked return (List<Boolean>) asList((Object) elements); }
/** * Adapts an array of {@code byte} into a {@link List} of * {@link Byte}. */ public static List<Byte> asList(byte[] elements) { //noinspection unchecked return (List<Byte>) asList((Object) elements); }
/** * Adapts an array of {@code float} into a {@link List} of * {@link Float}. */ public static List<Float> asList(float[] elements) { //noinspection unchecked return (List<Float>) asList((Object) elements); }
/** * Adapts an array of {@code double} into a {@link List} of * {@link Double}. */ public static List<Double> asList(double[] elements) { //noinspection unchecked return (List<Double>) asList((Object) elements); }
/** * Adapts an array of {@code char} into a {@link List} of * {@link Character}. */ public static List<Character> asList(char[] elements) { //noinspection unchecked return (List<Character>) asList((Object) elements); }
/** * Adapts an array of {@code short} into a {@link List} of * {@link Short}. */ public static List<Short> asList(short[] elements) { //noinspection unchecked return (List<Short>) asList((Object) elements); }
/** * Adapts an array of {@code int} into a {@link List} of * {@link Integer}. */ public static List<Integer> asList(int[] elements) { //noinspection unchecked return (List<Integer>) asList((Object) elements); }
/** Converts a JDBC array to a list. */ public static List arrayToList(final java.sql.Array a) { if (a == null) { return null; } try { return Primitive.asList(a.getArray()); } catch (SQLException e) { throw new RuntimeException(e); } }
/** Converts a JDBC array to a list. */ public static List arrayToList(final java.sql.Array a) { if (a == null) { return null; } try { return Primitive.asList(a.getArray()); } catch (SQLException e) { throw new RuntimeException(e); } }
/** Returns an estimate of the number of rows in the tile with the given * dimensions. */ public static double getRowCount(double factCount, List<Double> columnCounts) { // The expected number of distinct values when choosing p values // with replacement from n integers is n . (1 - ((n - 1) / n) ^ p). // // If we have several uniformly distributed attributes A1 ... Am // with N1 ... Nm distinct values, they behave as one uniformly // distributed attribute with N1 * ... * Nm distinct values. double n = 1d; for (Double columnCount : columnCounts) { if (columnCount > 1d) { n *= columnCount; } } final double a = (n - 1d) / n; if (a == 1d) { // A under-flows if nn is large. return factCount; } final double v = n * (1d - Math.pow(a, factCount)); // Cap at fact-row-count, because numerical artifacts can cause it // to go a few % over. return Math.min(v, factCount); }
private static Enumerable toEnumerable(final Object o) { if (o.getClass().isArray()) { if (o instanceof Object[]) { return Linq4j.asEnumerable((Object[]) o); } else { return Linq4j.asEnumerable(Primitive.asList(o)); } } if (o instanceof Iterable) { return Linq4j.asEnumerable((Iterable) o); } throw new RuntimeException( "Cannot convert " + o.getClass() + " into a Enumerable"); }
private static Enumerable toEnumerable(final Object o) { if (o.getClass().isArray()) { if (o instanceof Object[]) { return Linq4j.asEnumerable((Object[]) o); } else { return Linq4j.asEnumerable(Primitive.asList(o)); } } if (o instanceof Iterable) { return Linq4j.asEnumerable((Iterable) o); } throw new RuntimeException( "Cannot convert " + o.getClass() + " into a Enumerable"); }
@Override public RelWriter explainTerms(RelWriter pw) { return super.explainTerms(pw) .item("fields", Primitive.asList(fields)); }
/** Converts a JDBC array to a list. */ public static List arrayToList(final java.sql.Array a) { if (a == null) { return null; } try { return Primitive.asList(a.getArray()); } catch (SQLException e) { throw toUnchecked(e); } }
@Override public RelWriter explainTerms(final RelWriter pw) { return super.explainTerms(pw).item("fields", Primitive.asList(fields)); }
@Override public RelWriter explainTerms(RelWriter pw) { return super.explainTerms(pw) .item("fields", Primitive.asList(fields)); }
@Override public RelWriter explainTerms(RelWriter pw) { return super.explainTerms(pw) .item("ctx", context == null ? "" : String.valueOf(context.id) + "@" + context.realization) .item("fields", Primitive.asList(fields)); }