Source:
<code>public Optional<HiveFileWriter> createFileWriter(Path path, List<String> inputColumnNames, StorageFormat storageFormat, Properties schema, JobConf conf, ConnectorSession session) { if (!HiveSessionProperties.isParquetOptimizedWriterEnabled(session)) { return Optional.empty(); } if (!MapredParquetOutputFormat.class.getName().equals(storageFormat.getOutputFormat())) { return Optional.empty(); } ParquetWriterOptions parquetWriterOptions = ParquetWriterOptions.builder() <START> .setMaxPageSize(HiveSessionProperties.getParquetWriterPageSize(session)) <END> .setMaxBlockSize(HiveSessionProperties.getParquetWriterBlockSize(session)) .build(); CompressionCodecName compressionCodecName = getCompression(conf); List<String> fileColumnNames = Splitter.on(',').trimResults().omitEmptyStrings().splitToList(schema.getProperty(META_TABLE_COLUMNS, "")); List<Type> fileColumnTypes = toHiveTypes(schema.getProperty(META_TABLE_COLUMN_TYPES, "")).stream() .map(hiveType -> hiveType.getType(typeManager)) .collect(toList()); int[] fileInputColumnIndexes = fileColumnNames.stream() .mapToInt(inputColumnNames::indexOf) .toArray(); try { FileSystem fileSystem = hdfsEnvironment.getFileSystem(session.getUser(), path, conf); Callable<Void> rollbackAction = () -> { fileSystem.delete(path, false); return null; }; return Optional.of(new ParquetFileWriter( fileSystem.create(path), rollbackAction, fileColumnNames, fileColumnTypes, parquetWriterOptions, fileInputColumnIndexes, compressionCodecName)); } catch (IOException e) { throw new PrestoException(HIVE_WRITER_OPEN_ERROR, "Error creating Parquet file", e); } }</code><technical_language>static import HiveSessionProperties.getParquetWriterPageSize HiveSessionProperties.getParquetWriterBlockSize</technical_language>

Target:
public Optional<HiveFileWriter> createFileWriter(Path path, List<String> inputColumnNames, StorageFormat storageFormat, Properties schema, JobConf conf, ConnectorSession session) { if (!isParquetOptimizedWriterEnabled(session)) { return Optional.empty(); } if (!MapredParquetOutputFormat.class.getName().equals(storageFormat.getOutputFormat())) { return Optional.empty(); } ParquetWriterOptions parquetWriterOptions = ParquetWriterOptions.builder() .setMaxPageSize(getParquetWriterPageSize(session)) .setMaxBlockSize(getParquetWriterBlockSize(session)) .build(); CompressionCodecName compressionCodecName = getCompression(conf); List<String> fileColumnNames = Splitter.on(',').trimResults().omitEmptyStrings().splitToList(schema.getProperty(META_TABLE_COLUMNS, "")); List<Type> fileColumnTypes = toHiveTypes(schema.getProperty(META_TABLE_COLUMN_TYPES, "")).stream() .map(hiveType -> hiveType.getType(typeManager)) .collect(toList()); int[] fileInputColumnIndexes = fileColumnNames.stream() .mapToInt(inputColumnNames::indexOf) .toArray(); try { FileSystem fileSystem = hdfsEnvironment.getFileSystem(session.getUser(), path, conf); Callable<Void> rollbackAction = () -> { fileSystem.delete(path, false); return null; }; return Optional.of(new ParquetFileWriter( fileSystem.create(path), rollbackAction, fileColumnNames, fileColumnTypes, parquetWriterOptions, fileInputColumnIndexes, compressionCodecName)); } catch (IOException e) { throw new PrestoException(HIVE_WRITER_OPEN_ERROR, "Error creating Parquet file", e); } }