Skip to content

Commit

Permalink
Full flat map writer
Browse files Browse the repository at this point in the history
  • Loading branch information
sdruzkin authored and ARUNACHALAM THIRUPATHI committed Jun 1, 2022
1 parent 8b6a71d commit aa7dd4b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Supplier;

import static com.facebook.presto.common.block.ColumnarMap.toColumnarMap;
import static com.facebook.presto.orc.metadata.ColumnEncoding.ColumnEncodingKind.DWRF_MAP_FLAT;
Expand All @@ -47,15 +48,22 @@ public class MapFlatColumnWriter
private final boolean compressed;
private final ColumnEncoding columnEncoding;
private final CompressedMetadataWriter metadataWriter;
private final Supplier<ColumnWriter> valueWriterFactory;

private boolean closed;

public MapFlatColumnWriter(int column, ColumnWriterOptions columnWriterOptions, Optional<DwrfDataEncryptor> dwrfEncryptor, MetadataWriter metadataWriter)
public MapFlatColumnWriter(int column,
ColumnWriterOptions columnWriterOptions,
Supplier<ColumnWriter> valueWriterFactory,
Optional<DwrfDataEncryptor> dwrfEncryptor,
MetadataWriter metadataWriter)
{
// TODO: Flat map needs to get factories for key and value writers, instead of already initialized writers
checkArgument(column >= 0, "column is negative");
requireNonNull(columnWriterOptions, "columnWriterOptions is null");

this.column = column;
this.valueWriterFactory = requireNonNull(valueWriterFactory, "valueWriterFactory is null");
this.compressed = columnWriterOptions.getCompressionKind() != NONE;
this.columnEncoding = new ColumnEncoding(DWRF_MAP_FLAT, 0); // TODO Use c'tor with additionalSequenceEncodings
this.metadataWriter = new CompressedMetadataWriter(metadataWriter, columnWriterOptions, dwrfEncryptor);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.facebook.presto.orc.writer;

public class MapFlatKeyWriter
{
}

0 comments on commit aa7dd4b

Please sign in to comment.