public Schema outputSchema()

in src/main/java/org/apache/datasketches/pig/sampling/GetVarOptSamples.java [63:80]


  public Schema outputSchema(final Schema input) {
    try {
      if (input == null || input.size() == 0
              || input.getField(0).type != DataType.BYTEARRAY) {
        throw new IllegalArgumentException("Input to GetVarOptSamples must be a DataByteArray: "
                + (input == null ? "null" : input.toString()));
      }

      final Schema weightedSampleSchema = new Schema();
      weightedSampleSchema.add(new Schema.FieldSchema(WEIGHT_ALIAS, DataType.DOUBLE));
      weightedSampleSchema.add(new Schema.FieldSchema(RECORD_ALIAS, DataType.TUPLE));

      return new Schema(new Schema.FieldSchema(getSchemaName(this
              .getClass().getName().toLowerCase(), input), weightedSampleSchema, DataType.BAG));
    } catch (final FrontendException e) {
      throw new RuntimeException(e);
    }
  }