From 3542350909b1213240e5097a1793a7c0733f6196 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Tue, 13 Dec 2022 23:59:47 +0000 Subject: fix(trace/wtf): Disable Parquet strict typing This change fixes an issue where some of the traces from the Workflow Trace Archive would fail to load with the trace format in OpenDC. This was caused by one of the fields being stored as a double, while the formats expects it to be a long. Parquet does not support unioning primitive types. Therefore, we have to disable strict type checking when reading the file. Furthermore, we need to support double entries for storing the workflow ids. --- .../kotlin/org/opendc/trace/util/parquet/LocalParquetReader.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'opendc-trace/opendc-trace-parquet/src') diff --git a/opendc-trace/opendc-trace-parquet/src/main/kotlin/org/opendc/trace/util/parquet/LocalParquetReader.kt b/opendc-trace/opendc-trace-parquet/src/main/kotlin/org/opendc/trace/util/parquet/LocalParquetReader.kt index 031bad60..de8a56d0 100644 --- a/opendc-trace/opendc-trace-parquet/src/main/kotlin/org/opendc/trace/util/parquet/LocalParquetReader.kt +++ b/opendc-trace/opendc-trace-parquet/src/main/kotlin/org/opendc/trace/util/parquet/LocalParquetReader.kt @@ -38,10 +38,12 @@ import kotlin.io.path.isDirectory * * @param path The path to the Parquet file or directory to read. * @param readSupport Helper class to perform conversion from Parquet to [T]. + * @param strictTyping A flag to disable strict typing of primitive types. */ public class LocalParquetReader( path: Path, - private val readSupport: ReadSupport + private val readSupport: ReadSupport, + private val strictTyping: Boolean = true ) : AutoCloseable { /** * The input files to process. @@ -119,6 +121,8 @@ public class LocalParquetReader( private fun createReader(input: InputFile): ParquetReader { return object : ParquetReader.Builder(input) { override fun getReadSupport(): ReadSupport<@UnsafeVariance T> = this@LocalParquetReader.readSupport - }.build() + } + .set("parquet.strict.typing", strictTyping.toString()) + .build() } } -- cgit v1.2.3