@Override public BatchTableSink<BaseRow> createBatchTableSink(Map<String, String> props) { TableProperties tableProperties = new TableProperties(); tableProperties.putProperties(props); String filePath = tableProperties.getString(ParquetOptions.FILE_PATH); if (StringUtils.isNullOrWhitespaceOnly(filePath)) { throw new RuntimeException(ParquetOptions.PARAMS_HELP_MSG); } Option<WriteMode> writeModeOption = null; String writeMode = tableProperties.getString(ParquetOptions.WRITE_MODE); if (!DEFAULT_WRITE_MODE.equals(writeMode)) { writeModeOption = new Some(WriteMode.valueOf( tableProperties.getString(ParquetOptions.WRITE_MODE))); } CompressionCodecName compressionCodecName = CompressionCodecName.valueOf(tableProperties .getString(ParquetOptions.COMPRESSION_CODEC_NAME)); return new ParquetTableSink(filePath, writeModeOption, compressionCodecName); }
@Override public BatchTableSink<BaseRow> createBatchTableSink(Map<String, String> props) { TableProperties properties = new TableProperties(); properties.putProperties(props); String filePath = properties.getString(ORCOptions.FILE_PATH); if (StringUtils.isNullOrWhitespaceOnly(filePath)) { throw new RuntimeException(ORCOptions.PARAMS_HELP_MSG); } Option<FileSystem.WriteMode> writeModeOption = null; String writeMode = properties.getString(ORCOptions.WRITE_MODE); if (!DEFAULT_WRITE_MODE.equals(writeMode)) { writeModeOption = new Some(FileSystem.WriteMode.valueOf( properties.getString(ORCOptions.WRITE_MODE))); } CompressionKind compressionKind = CompressionKind.valueOf( properties.getString(ORCOptions.COMPRESSION_CODEC_NAME)); return new OrcTableSink(filePath, writeModeOption, compressionKind); }