Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
clairemcginty committed Sep 18, 2024
1 parent 8053d38 commit 6a50da6
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions jmh/src/test/scala/magnolify/jmh/MagnolifyBench.scala
Original file line number Diff line number Diff line change
Expand Up @@ -222,23 +222,23 @@ object ParquetStates {
def setup(): Unit = {
// Write page
val columnIO = new ColumnIOFactory(true).getColumnIO(schema)
val memPageStore = new ParquetInMemoryPageStore(1)
val columns = new ColumnWriteStoreV1(
val pageStore = new ParquetInMemoryPageStore(1)
val columnWriteStore = new ColumnWriteStoreV1(
schema,
memPageStore,
pageStore,
ParquetProperties.builder.withPageSize(800).withDictionaryEncoding(false).build
)
val recordWriter = columnIO.getRecordWriter(columns)
val recordConsumer = columnIO.getRecordWriter(columnWriteStore)
writeSupport.init(new PlainParquetConfiguration())
writeSupport.prepareForWrite(recordWriter)
writeSupport.prepareForWrite(recordConsumer)
writeSupport.write(record)
recordWriter.flush()
columns.flush()
recordConsumer.flush()
columnWriteStore.flush()

// Read and convert page
// Set up reader
val conf = new Configuration()
reader = columnIO.getRecordReader(
memPageStore,
pageStore,
readSupport.prepareForRead(
conf,
new java.util.HashMap,
Expand All @@ -255,16 +255,17 @@ object ParquetStates {

@Setup(Level.Invocation)
def setup(): Unit = {
val columnIO = new ColumnIOFactory(true).getColumnIO(schema)
val memPageStore = new ParquetInMemoryPageStore(1)
val columns = new ColumnWriteStoreV1(
schema,
memPageStore,
ParquetProperties.builder.withPageSize(800).withDictionaryEncoding(false).build
)
val recordWriter = columnIO.getRecordWriter(columns)
val recordConsumer = new ColumnIOFactory(true)
.getColumnIO(schema)
.getRecordWriter(
new ColumnWriteStoreV1(
schema,
new ParquetInMemoryPageStore(1),
ParquetProperties.builder.withPageSize(800).withDictionaryEncoding(false).build
)
)
writeSupport.init(new PlainParquetConfiguration())
writeSupport.prepareForWrite(recordWriter)
writeSupport.prepareForWrite(recordConsumer)
this.writer = writeSupport
}
}
Expand Down

0 comments on commit 6a50da6

Please sign in to comment.