summaryrefslogtreecommitdiff
path: root/opendc-trace/opendc-trace-wfformat
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2022-05-02 14:17:55 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2022-05-02 15:37:04 +0200
commit670cd279ea7789e07b6d778a21fdec68347ab305 (patch)
treedf91a7fd81a5d1afc51a0380fd938adf701bc43b /opendc-trace/opendc-trace-wfformat
parent9411845b3f26536a1e6ea40504e396f19d25a09a (diff)
feat(trace/api): Add support for projecting tables
This change adds support for projecting certain columns of a table. This enables faster reading for tables with high number of columns. Currently, we support projection in the Parquet-based workload formats. Other formats are text-based and will probably not benefit much from projection.
Diffstat (limited to 'opendc-trace/opendc-trace-wfformat')
-rw-r--r--opendc-trace/opendc-trace-wfformat/src/main/kotlin/org/opendc/trace/wfformat/WfFormatTraceFormat.kt2
-rw-r--r--opendc-trace/opendc-trace-wfformat/src/test/kotlin/org/opendc/trace/wfformat/WfFormatTraceFormatTest.kt4
2 files changed, 3 insertions, 3 deletions
diff --git a/opendc-trace/opendc-trace-wfformat/src/main/kotlin/org/opendc/trace/wfformat/WfFormatTraceFormat.kt b/opendc-trace/opendc-trace-wfformat/src/main/kotlin/org/opendc/trace/wfformat/WfFormatTraceFormat.kt
index bc175b58..8db4c169 100644
--- a/opendc-trace/opendc-trace-wfformat/src/main/kotlin/org/opendc/trace/wfformat/WfFormatTraceFormat.kt
+++ b/opendc-trace/opendc-trace-wfformat/src/main/kotlin/org/opendc/trace/wfformat/WfFormatTraceFormat.kt
@@ -63,7 +63,7 @@ public class WfFormatTraceFormat : TraceFormat {
}
}
- override fun newReader(path: Path, table: String): TableReader {
+ override fun newReader(path: Path, table: String, projection: List<TableColumn<*>>?): TableReader {
return when (table) {
TABLE_TASKS -> WfFormatTaskTableReader(factory.createParser(path.toFile()))
else -> throw IllegalArgumentException("Table $table not supported")
diff --git a/opendc-trace/opendc-trace-wfformat/src/test/kotlin/org/opendc/trace/wfformat/WfFormatTraceFormatTest.kt b/opendc-trace/opendc-trace-wfformat/src/test/kotlin/org/opendc/trace/wfformat/WfFormatTraceFormatTest.kt
index 710de88e..4a8b2792 100644
--- a/opendc-trace/opendc-trace-wfformat/src/test/kotlin/org/opendc/trace/wfformat/WfFormatTraceFormatTest.kt
+++ b/opendc-trace/opendc-trace-wfformat/src/test/kotlin/org/opendc/trace/wfformat/WfFormatTraceFormatTest.kt
@@ -62,7 +62,7 @@ class WfFormatTraceFormatTest {
@Test
fun testTableReader() {
val path = Paths.get("src/test/resources/trace.json")
- val reader = format.newReader(path, TABLE_TASKS)
+ val reader = format.newReader(path, TABLE_TASKS, null)
assertAll(
{ assertTrue(reader.nextRow()) },
@@ -89,7 +89,7 @@ class WfFormatTraceFormatTest {
@Test
fun testTableReaderFull() {
val path = Paths.get("src/test/resources/trace.json")
- val reader = format.newReader(path, TABLE_TASKS)
+ val reader = format.newReader(path, TABLE_TASKS, null)
assertDoesNotThrow {
while (reader.nextRow()) {