presto-raptor-legacy/src/main/java/io/prestosql/plugin/raptor/legacy/storage/OrcFileWriter.java/OrcFileWriter/OrcFileWriter
class OrcFileWriter:    @VisibleForTesting
    OrcFileWriter(List<Long> columnIds, List<Type> columnTypes, File target, boolean writeMetadata)
    {
        this.columnTypes = ImmutableList.copyOf(requireNonNull(columnTypes, "columnTypes is null"));
        checkArgument(columnIds.size() == columnTypes.size(), "ids and types mismatch");
        checkArgument(isUnique(columnIds), "ids must be unique");

        List<StorageType> storageTypes = ImmutableList.copyOf(toStorageTypes(columnTypes));
        Iterable<String> hiveTypeNames = storageTypes.stream().map(StorageType::getHiveTypeName).collect(toList());
        List<String> columnNames = columnIds.stream()
                .map(Objects::toString)
                .collect(toImmutableList());

        Properties properties = new Properties();
        properties.setProperty(IOConstants.COLUMNS, Joiner.on(',').join(columnNames));
        properties.setProperty(IOConstants.COLUMNS_TYPES, Joiner.on(':').join(hiveTypeNames));

        serializer = createSerializer(properties);
        recordWriter = createRecordWriter(new Path(target.toURI()), columnIds, columnTypes, writeMetadata);

        tableInspector = getStandardStructObjectInspector(columnNames, getJavaObjectInspectors(storageTypes));
        structFields = ImmutableList.copyOf(tableInspector.getAllStructFieldRefs());
        orcRow = tableInspector.create();
    }