From 545e204b52aa792a7b0d4eb471f23ceb49a3ab98 Mon Sep 17 00:00:00 2001 From: Arttu Voutilainen Date: Wed, 21 Aug 2024 13:36:54 +0200 Subject: [PATCH] fix spark --- .../expression/IgnoreNullableAndParameters.scala | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/spark/src/main/scala/io/substrait/spark/expression/IgnoreNullableAndParameters.scala b/spark/src/main/scala/io/substrait/spark/expression/IgnoreNullableAndParameters.scala index 962a98b16..00076ce63 100644 --- a/spark/src/main/scala/io/substrait/spark/expression/IgnoreNullableAndParameters.scala +++ b/spark/src/main/scala/io/substrait/spark/expression/IgnoreNullableAndParameters.scala @@ -55,7 +55,11 @@ class IgnoreNullableAndParameters(val typeToMatch: ParameterizedType) override def visit(`type`: Type.IntervalYear): Boolean = typeToMatch.isInstanceOf[Type.IntervalYear] - override def visit(`type`: Type.IntervalDay): Boolean = typeToMatch.isInstanceOf[Type.IntervalDay] + override def visit(`type`: Type.IntervalDay): Boolean = + typeToMatch.isInstanceOf[Type.IntervalDay] || typeToMatch.isInstanceOf[ParameterizedType.IntervalDay] + + override def visit(`type`: Type.IntervalCompound): Boolean = + typeToMatch.isInstanceOf[Type.IntervalCompound] || typeToMatch.isInstanceOf[ParameterizedType.IntervalCompound] override def visit(`type`: Type.UUID): Boolean = typeToMatch.isInstanceOf[Type.UUID] @@ -103,6 +107,14 @@ class IgnoreNullableAndParameters(val typeToMatch: ParameterizedType) override def visit(expr: ParameterizedType.Decimal): Boolean = typeToMatch.isInstanceOf[Type.Decimal] || typeToMatch.isInstanceOf[ParameterizedType.Decimal] + @throws[RuntimeException] + override def visit(expr: ParameterizedType.IntervalDay): Boolean = + typeToMatch.isInstanceOf[Type.IntervalDay] || typeToMatch.isInstanceOf[ParameterizedType.IntervalDay] + + @throws[RuntimeException] + override def visit(expr: ParameterizedType.IntervalCompound): Boolean = + typeToMatch.isInstanceOf[Type.IntervalCompound] || typeToMatch.isInstanceOf[ParameterizedType.IntervalCompound] + @throws[RuntimeException] override def visit(expr: ParameterizedType.Struct): Boolean = typeToMatch.isInstanceOf[Type.Struct] || typeToMatch.isInstanceOf[ParameterizedType.Struct]