APISonar


org.apache.pinot.spi.data.readers.FileFormat.JSON

> org > apache > pinot > spi > data > readers > FileFormat > JSON
org APIs apache APIs pinot APIs spi APIs data APIs readers APIs FileFormat APIs JSON APIs

Example 1
protected FileFormat getFileFormat(String fileName) {
    if (fileName.endsWith(".avro")) {
      return FileFormat.AVRO;
    }
    if (fileName.endsWith(".csv")) {
      return FileFormat.CSV;
    }
    if (fileName.endsWith(".json")) {
      return FileFormat.JSON;
    }
    if (fileName.endsWith(".thrift")) {
      return FileFormat.THRIFT;
    }
    throw new IllegalArgumentException("Unsupported file format: {}" + fileName);
  }
Example 2
private void initSegmentConfig(JobContext context)
      throws IOException {
    _segmentConfig.setFormat(FileFormat.JSON);
    _segmentConfig.setOutDir(PinotOutputFormat.getTempSegmentDir(context) + "/segmentDir");
    _segmentConfig.setOverwrite(true);
    _segmentConfig.setTableName(PinotOutputFormat.getTableName(context));
    _segmentConfig.setSegmentName(PinotOutputFormat.getSegmentName(context));
    _segmentConfig.setSchema(Schema.fromString(PinotOutputFormat.getSchema(context)));
    _segmentConfig.setReaderConfigFile(PinotOutputFormat.getReaderConfig(context));
    initStarTreeIndex(context);
    initHllConfig(context);
  }