All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.yahoo.sketches.pig.cpc.UnionSketchAlgebraicIntermediate Maven / Gradle / Ivy

The newest version!
/*
 * Copyright 2019, Verizon Media.
 * Licensed under the terms of the Apache License 2.0. See LICENSE file at the project root for terms.
 */

package com.yahoo.sketches.pig.cpc;

import static com.yahoo.sketches.Util.DEFAULT_UPDATE_SEED;

import com.yahoo.sketches.cpc.CpcSketch;

public class UnionSketchAlgebraicIntermediate extends AlgebraicIntermediate {

  /**
   * Default constructor of the intermediate pass of an Algebraic function.
   * Assumes default lgK and seed.
   */
  public UnionSketchAlgebraicIntermediate() {
    super(CpcSketch.DEFAULT_LG_K, DEFAULT_UPDATE_SEED);
  }

  /**
   * Constructor for the intermediate pass of an Algebraic function. Pig will call
   * this and pass the same constructor arguments as the base UDF.
   * Assumes default seed.
   *
   * @param lgK in a form of a String
   */
  public UnionSketchAlgebraicIntermediate(final String lgK) {
    super(Integer.parseInt(lgK), DEFAULT_UPDATE_SEED);
  }

  /**
   * Constructor for the intermediate pass of an Algebraic function. Pig will call
   * this and pass the same constructor arguments as the base UDF.
   * 
   * @param lgK parameter controlling the sketch size and accuracy
   * @param seed for the hash function
   */
  public UnionSketchAlgebraicIntermediate(final String lgK, final String seed) {
    super(Integer.parseInt(lgK), Long.parseLong(seed));
  }

  @Override
  boolean isInputRaw() {
    return false;
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy