use of org.apache.pig.impl.logicalLayer.FrontendException in project sketches-pig by DataSketches.
the class SketchToEstimateAndErrorBounds method outputSchema.
/**
* The output is a Sketch Result Tuple Schema.
*/
@Override
public Schema outputSchema(final Schema input) {
if (input == null) {
return null;
}
try {
final Schema tupleSchema = new Schema();
tupleSchema.add(new Schema.FieldSchema("Estimate", DataType.DOUBLE));
tupleSchema.add(new Schema.FieldSchema("LowerBound", DataType.DOUBLE));
tupleSchema.add(new Schema.FieldSchema("UpperBound", DataType.DOUBLE));
return new Schema(new Schema.FieldSchema(getSchemaName(this.getClass().getName().toLowerCase(), input), tupleSchema, DataType.TUPLE));
} catch (final FrontendException e) {
throw new RuntimeException(e);
}
}
use of org.apache.pig.impl.logicalLayer.FrontendException in project sketches-pig by DataSketches.
the class DataToDoublesSketch method outputSchema.
@Override
public Schema outputSchema(final Schema input) {
if (input == null) {
return null;
}
try {
final Schema tupleSchema = new Schema();
tupleSchema.add(new Schema.FieldSchema("Sketch", DataType.BYTEARRAY));
return new Schema(new Schema.FieldSchema(getSchemaName(this.getClass().getName().toLowerCase(), input), tupleSchema, DataType.TUPLE));
} catch (final FrontendException e) {
throw new RuntimeException(e);
}
}
use of org.apache.pig.impl.logicalLayer.FrontendException in project sketches-pig by DataSketches.
the class MurmurHash3 method outputSchema.
/**
* The output consists of two longs, or 128 bits, plus the result of the modulo division if
* specified.
*/
@Override
public Schema outputSchema(final Schema input) {
if (input != null) {
try {
final Schema tupleSchema = new Schema();
tupleSchema.add(new Schema.FieldSchema("Hash0", DataType.LONG));
tupleSchema.add(new Schema.FieldSchema("Hash1", DataType.LONG));
tupleSchema.add(new Schema.FieldSchema("ModuloResult", DataType.INTEGER));
return new Schema(new Schema.FieldSchema(getSchemaName(this.getClass().getName().toLowerCase(), input), tupleSchema, DataType.TUPLE));
} catch (final FrontendException e) {
// fall through
}
}
return null;
}
use of org.apache.pig.impl.logicalLayer.FrontendException in project sketches-pig by DataSketches.
the class AexcludeB method outputSchema.
@Override
public Schema outputSchema(final Schema input) {
if (input != null) {
try {
final Schema tupleSchema = new Schema();
tupleSchema.add(new Schema.FieldSchema("Sketch", DataType.BYTEARRAY));
return new Schema(new Schema.FieldSchema(getSchemaName(this.getClass().getName().toLowerCase(), input), tupleSchema, DataType.TUPLE));
} catch (final FrontendException e) {
// fall through
}
}
return null;
}
use of org.apache.pig.impl.logicalLayer.FrontendException in project sketches-pig by DataSketches.
the class Intersect method outputSchema.
@Override
public Schema outputSchema(final Schema input) {
if (input != null) {
try {
final Schema tupleSchema = new Schema();
tupleSchema.add(new Schema.FieldSchema("Sketch", DataType.BYTEARRAY));
return new Schema(new Schema.FieldSchema(getSchemaName(this.getClass().getName().toLowerCase(), input), tupleSchema, DataType.TUPLE));
} catch (final FrontendException e) {
// fall through
}
}
return null;
}
Aggregations