Skip to content

Commit

Permalink
use Trial for reads
Browse files Browse the repository at this point in the history
  • Loading branch information
clairemcginty committed Sep 19, 2024
1 parent 89695a7 commit a0b4fe2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
8 changes: 2 additions & 6 deletions jmh/src/test/scala/magnolify/jmh/MagnolifyBench.scala
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ object ParquetStates {

var reader: RecordReader[T] = null

@Setup(Level.Iteration)
@Setup(Level.Trial)
def setup(): Unit = {
// Write page
val columnIO = new ColumnIOFactory(true).getColumnIO(schema)
Expand Down Expand Up @@ -254,11 +254,7 @@ object ParquetStates {
new ColumnWriteStoreV1(
schema,
new ParquetInMemoryPageStore(Long.MaxValue, writeOnly = true),
ParquetProperties.builder
.withPageSize(10 * 1024 * 1024)
.withPageRowCountLimit(Int.MaxValue)
.withDictionaryEncoding(false)
.build
ParquetProperties.builder.withDictionaryEncoding(false).build
)
)
writeSupport.init(new PlainParquetConfiguration())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ class ParquetInMemoryWriter(writeOnly: Boolean) extends PageWriter {
dlEncoding: Encoding,
valuesEncoding: Encoding
): Unit = {
// If we don't need to read the values later, don't waste mem storing them
if (!writeOnly) {
pages.addOne(
new DataPageV1(
Expand All @@ -115,10 +116,10 @@ class ParquetInMemoryWriter(writeOnly: Boolean) extends PageWriter {
valuesEncoding
)
)
memSize += bytesInput.size()
numRows += rowCount
numValues += valueCount
}
memSize += bytesInput.size()
numRows += rowCount
numValues += valueCount
}

override def writePageV2(
Expand Down

0 comments on commit a0b4fe2

Please sign in to comment.