From 77f2ed9b326775a7081dc4c285ebf88cd5e85152 Mon Sep 17 00:00:00 2001 From: Raphael Date: Tue, 3 Dec 2024 14:04:01 +0100 Subject: [PATCH] minor adjustments --- .../engine/core/model/query/basics/ComparisonOperator.kt | 2 +- .../engine/query/operators/transform/filter/LateFilter.kt | 2 +- .../query/operators/transform/filter/LateFilterFactory.kt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/model/query/basics/ComparisonOperator.kt b/vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/model/query/basics/ComparisonOperator.kt index 665de7d2..1fbed02f 100644 --- a/vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/model/query/basics/ComparisonOperator.kt +++ b/vitrivr-engine-core/src/main/kotlin/org/vitrivr/engine/core/model/query/basics/ComparisonOperator.kt @@ -127,7 +127,7 @@ enum class ComparisonOperator(val value: String) { * @param str The [String] which should be one of the [ComparisonOperator] * @throws IllegalArgumentException In case the given string is not one of the defined ones. */ - fun fromString(str: String): ComparisonOperator { + infix fun fromString(str: String): ComparisonOperator { return when (str.trim()) { EQ.value -> EQ NEQ.value -> NEQ diff --git a/vitrivr-engine-query/src/main/kotlin/org/vitrivr/engine/query/operators/transform/filter/LateFilter.kt b/vitrivr-engine-query/src/main/kotlin/org/vitrivr/engine/query/operators/transform/filter/LateFilter.kt index a4c64814..8daba77a 100644 --- a/vitrivr-engine-query/src/main/kotlin/org/vitrivr/engine/query/operators/transform/filter/LateFilter.kt +++ b/vitrivr-engine-query/src/main/kotlin/org/vitrivr/engine/query/operators/transform/filter/LateFilter.kt @@ -37,7 +37,7 @@ class LateFilter( /* appends late filter */ val limit: Int = Int.MAX_VALUE, /* on missing key skip */ - val skip: Skip = Skip.valueOf("ignore"), + val skip: Skip = Skip fromString "warn", override val name: String ) : Transformer { diff --git a/vitrivr-engine-query/src/main/kotlin/org/vitrivr/engine/query/operators/transform/filter/LateFilterFactory.kt b/vitrivr-engine-query/src/main/kotlin/org/vitrivr/engine/query/operators/transform/filter/LateFilterFactory.kt index 9f6a0b14..50245ae5 100644 --- a/vitrivr-engine-query/src/main/kotlin/org/vitrivr/engine/query/operators/transform/filter/LateFilterFactory.kt +++ b/vitrivr-engine-query/src/main/kotlin/org/vitrivr/engine/query/operators/transform/filter/LateFilterFactory.kt @@ -24,6 +24,6 @@ class LateFilterFactory() : TransformerFactory { } else { emptyList() } - return LateFilter(input, field, keys, ComparisonOperator.fromString(comparison), value, limit, Skip.fromString(skip), name) + return LateFilter(input, field, keys, ComparisonOperator fromString comparison, value, limit, Skip fromString skip, name) } }