diff --git a/prometheus/src/main/scala/filodb/prometheus/ast/Expressions.scala b/prometheus/src/main/scala/filodb/prometheus/ast/Expressions.scala index fa42879de2..1d0e963f98 100644 --- a/prometheus/src/main/scala/filodb/prometheus/ast/Expressions.scala +++ b/prometheus/src/main/scala/filodb/prometheus/ast/Expressions.scala @@ -61,7 +61,7 @@ case class BinaryExpression(lhs: Expression, if (hasScalarResult(lhsWithPrecedence) && hasScalarResult(rhsWithPrecedence)) { val rangeParams = RangeParams(timeParams.start, timeParams.step, timeParams.end) - (lhsWithPrecedence, rhsWithPrecedence) match { + ((lhsWithPrecedence, rhsWithPrecedence): @unchecked) match { // 3 + 4 case (lh: ScalarExpression, rh: ScalarExpression) => ScalarBinaryOperation(operator.getPlanOperator, Left(lh.toScalar), Left(rh.toScalar), rangeParams) diff --git a/prometheus/src/main/scala/filodb/prometheus/parse/LegacyParser.scala b/prometheus/src/main/scala/filodb/prometheus/parse/LegacyParser.scala index fa05215bb6..592ff3ec30 100644 --- a/prometheus/src/main/scala/filodb/prometheus/parse/LegacyParser.scala +++ b/prometheus/src/main/scala/filodb/prometheus/parse/LegacyParser.scala @@ -356,6 +356,7 @@ trait ExpressionParser extends AggregatesParser with SelectorParser with Numeric "(" ~ expression ~ ")" ^^ { case "(" ~ ep ~ ")" => PrecedenceExpression(ep) + case _ => ??? } } diff --git a/query/src/test/scala/filodb/query/exec/MetadataExecSpec.scala b/query/src/test/scala/filodb/query/exec/MetadataExecSpec.scala index 2d68a4d073..6f5c5920b9 100644 --- a/query/src/test/scala/filodb/query/exec/MetadataExecSpec.scala +++ b/query/src/test/scala/filodb/query/exec/MetadataExecSpec.scala @@ -94,7 +94,7 @@ class MetadataExecSpec extends AnyFunSpec with Matchers with ScalaFutures with B timeseriesDataset.ref, 0, filters, Seq("job", "unicode_tag"), now-5000, now) val resp = execPlan.execute(memStore, querySession).runAsync.futureValue - val result = resp match { + val result = (resp: @unchecked) match { case QueryResult(id, _, response, _, _) => { val rv = response(0) rv.rows.size shouldEqual 1 @@ -114,7 +114,7 @@ class MetadataExecSpec extends AnyFunSpec with Matchers with ScalaFutures with B timeseriesDataset.ref, 0, filters, false, now-5000, now) val resp = execPlan.execute(memStore, querySession).runAsync.futureValue - resp match { + (resp: @unchecked) match { case QueryResult(_, _, results, _, _) => results.size shouldEqual 1 results(0).rows.size shouldEqual 0 } @@ -128,7 +128,7 @@ class MetadataExecSpec extends AnyFunSpec with Matchers with ScalaFutures with B timeseriesDataset.ref, 0, filters, false, now-5000, now) val resp = execPlan.execute(memStore, querySession).runAsync.futureValue - val result = resp match { + val result = (resp: @unchecked) match { case QueryResult(id, _, response, _, _) => response.size shouldEqual 1 response(0).rows.map { row => @@ -149,7 +149,7 @@ class MetadataExecSpec extends AnyFunSpec with Matchers with ScalaFutures with B timeseriesDataset.ref, 0, filters, false, now-5000, now) val resp = execPlan.execute(memStore, querySession).runAsync.futureValue - val result = resp match { + val result = (resp: @unchecked) match { case QueryResult(id, _, response, _, _) => { response.size shouldEqual 1 response(0).rows.map { row => @@ -168,7 +168,7 @@ class MetadataExecSpec extends AnyFunSpec with Matchers with ScalaFutures with B timeseriesDataset.ref, 0, filters, Seq("job", "unicode_tag"), now-5000, now) val resp = execPlan.execute(memStore, querySession).runAsync.futureValue - val result = resp match { + val result = (resp: @unchecked) match { case QueryResult(id, _, response, _, _) => { val rv = response(0) rv.rows.size shouldEqual 1 diff --git a/query/src/test/scala/filodb/query/exec/rangefn/ScalarFunctionSpec.scala b/query/src/test/scala/filodb/query/exec/rangefn/ScalarFunctionSpec.scala index 62576a1acf..aabc1b5f1e 100644 --- a/query/src/test/scala/filodb/query/exec/rangefn/ScalarFunctionSpec.scala +++ b/query/src/test/scala/filodb/query/exec/rangefn/ScalarFunctionSpec.scala @@ -141,7 +141,7 @@ class ScalarFunctionSpec extends AnyFunSpec with Matchers with ScalaFutures { implicit val timeout: FiniteDuration = FiniteDuration(5, TimeUnit.SECONDS) import monix.execution.Scheduler.Implicits.global val resp = execPlan.execute(memStore, querySession).runAsync.futureValue - val result = resp match { + val result = (resp: @unchecked) match { case QueryResult(id, _, response, _, _) => { val rv = response(0) rv.isInstanceOf[TimeScalar] shouldEqual(true) @@ -156,7 +156,7 @@ class ScalarFunctionSpec extends AnyFunSpec with Matchers with ScalaFutures { implicit val timeout: FiniteDuration = FiniteDuration(5, TimeUnit.SECONDS) import monix.execution.Scheduler.Implicits.global val resp = execPlan.execute(memStore, querySession).runAsync.futureValue - val result = resp match { + val result = (resp: @unchecked) match { case QueryResult(id, _, response, _, _) => { val rv = response(0) rv.isInstanceOf[HourScalar] shouldEqual(true) @@ -172,7 +172,7 @@ class ScalarFunctionSpec extends AnyFunSpec with Matchers with ScalaFutures { implicit val timeout: FiniteDuration = FiniteDuration(5, TimeUnit.SECONDS) import monix.execution.Scheduler.Implicits.global val resp = execPlan.execute(memStore, querySession).runAsync.futureValue - val result = resp match { + val result = (resp: @unchecked) match { case QueryResult(id, _, response, _, _) => { val rv = response(0) rv.isInstanceOf[DayOfWeekScalar] shouldEqual(true)