summaryrefslogtreecommitdiff
path: root/opendc-trace/opendc-trace-azure
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-azure
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-azure')
-rw-r--r--opendc-trace/opendc-trace-azure/src/main/kotlin/org/opendc/trace/azure/AzureTraceFormat.kt2
-rw-r--r--opendc-trace/opendc-trace-azure/src/test/kotlin/org/opendc/trace/azure/AzureTraceFormatTest.kt4
2 files changed, 3 insertions, 3 deletions
diff --git a/opendc-trace/opendc-trace-azure/src/main/kotlin/org/opendc/trace/azure/AzureTraceFormat.kt b/opendc-trace/opendc-trace-azure/src/main/kotlin/org/opendc/trace/azure/AzureTraceFormat.kt
index 8e3e60cc..73978990 100644
--- a/opendc-trace/opendc-trace-azure/src/main/kotlin/org/opendc/trace/azure/AzureTraceFormat.kt
+++ b/opendc-trace/opendc-trace-azure/src/main/kotlin/org/opendc/trace/azure/AzureTraceFormat.kt
@@ -81,7 +81,7 @@ public class AzureTraceFormat : TraceFormat {
}
}
- override fun newReader(path: Path, table: String): TableReader {
+ override fun newReader(path: Path, table: String, projection: List<TableColumn<*>>?): TableReader {
return when (table) {
TABLE_RESOURCES -> {
val stream = GZIPInputStream(path.resolve("vmtable/vmtable.csv.gz").inputStream())
diff --git a/opendc-trace/opendc-trace-azure/src/test/kotlin/org/opendc/trace/azure/AzureTraceFormatTest.kt b/opendc-trace/opendc-trace-azure/src/test/kotlin/org/opendc/trace/azure/AzureTraceFormatTest.kt
index 56f9a940..263d26ce 100644
--- a/opendc-trace/opendc-trace-azure/src/test/kotlin/org/opendc/trace/azure/AzureTraceFormatTest.kt
+++ b/opendc-trace/opendc-trace-azure/src/test/kotlin/org/opendc/trace/azure/AzureTraceFormatTest.kt
@@ -57,7 +57,7 @@ class AzureTraceFormatTest {
@Test
fun testResources() {
val path = Paths.get("src/test/resources/trace")
- val reader = format.newReader(path, TABLE_RESOURCES)
+ val reader = format.newReader(path, TABLE_RESOURCES, null)
assertAll(
{ assertTrue(reader.nextRow()) },
{ assertEquals("x/XsOfHO4ocsV99i4NluqKDuxctW2MMVmwqOPAlg4wp8mqbBOe3wxBlQo0+Qx+uf", reader.get(RESOURCE_ID)) },
@@ -71,7 +71,7 @@ class AzureTraceFormatTest {
@Test
fun testSmoke() {
val path = Paths.get("src/test/resources/trace")
- val reader = format.newReader(path, TABLE_RESOURCE_STATES)
+ val reader = format.newReader(path, TABLE_RESOURCE_STATES, null)
assertAll(
{ assertTrue(reader.nextRow()) },