diff --git a/backends-velox/pom.xml b/backends-velox/pom.xml index baa2011c904ff..ecb9db0535e29 100755 --- a/backends-velox/pom.xml +++ b/backends-velox/pom.xml @@ -57,7 +57,7 @@ org.apache.spark - spark-hivethriftserver_${scala.binary.version} + spark-hive-thriftserver_${scala.binary.version} provided diff --git a/pom.xml b/pom.xml index 7f56239d370d9..902b4bf2791af 100644 --- a/pom.xml +++ b/pom.xml @@ -307,7 +307,7 @@ org.apache.spark - spark-hivethriftserver_${scala.binary.version} + spark-hive-thriftserver_${scala.binary.version} ${spark.version} provided diff --git a/substrait/substrait-spark/src/main/scala/io/substrait/utils/Util.scala b/substrait/substrait-spark/src/main/scala/io/substrait/utils/Util.scala index 51464c140a2b0..4b367ed6a8af9 100644 --- a/substrait/substrait-spark/src/main/scala/io/substrait/utils/Util.scala +++ b/substrait/substrait-spark/src/main/scala/io/substrait/utils/Util.scala @@ -32,19 +32,19 @@ object Util { def crossProduct[T](lists: Seq[Seq[T]]): Seq[Seq[T]] = { /** list [a, b], element 1 => list + element => [a, b, 1] */ - val appendElementToList: (ArrayBuffer[T], T) => ArrayBuffer[T] = + val appendElementToList: (Seq[T], T) => Seq[T] = (list, element) => list :+ element /** ([a, b], [1, 2]) ==> [a, b, 1], [a, b, 2] */ - val appendAndGen: (ArrayBuffer[T], Seq[T]) => Seq[ArrayBuffer[T]] = + val appendAndGen: (Seq[T], Seq[T]) => Seq[Seq[T]] = (list, elemsToAppend) => elemsToAppend.map(e => appendElementToList(list, e)) val firstListToJoin = lists.head - val startProduct = appendAndGen(new ArrayBuffer[T], firstListToJoin) + val startProduct = appendAndGen(new ArrayBuffer[T].toSeq, firstListToJoin) /** ([ [a, b], [c, d] ], [1, 2]) -> [a, b, 1], [a, b, 2], [c, d, 1], [c, d, 2] */ - val appendAndGenLists: (Seq[ArrayBuffer[T]], Seq[T]) => Seq[Seq[T]] = - (products, toJoin) => products.flatMap(product => appendAndGen(product, toJoin).toSeq) + val appendAndGenLists: (Seq[Seq[T]], Seq[T]) => Seq[Seq[T]] = + (products, toJoin) => products.flatMap(product => appendAndGen(product, toJoin).toSeq).toSeq lists.tail.foldLeft(startProduct)(appendAndGenLists).map(_.toSeq) } diff --git a/substrait/substrait-spark/src/main/scala/org/apache/spark/substrait/ToSubstraitType.scala b/substrait/substrait-spark/src/main/scala/org/apache/spark/substrait/ToSubstraitType.scala index 6ef041b343322..05d785cd51bb4 100644 --- a/substrait/substrait-spark/src/main/scala/org/apache/spark/substrait/ToSubstraitType.scala +++ b/substrait/substrait-spark/src/main/scala/org/apache/spark/substrait/ToSubstraitType.scala @@ -119,7 +119,7 @@ class ToSubstraitType { .zip(namedStruct.names().asScala) .map { case ((t, d), name) => StructField(name, d, t.nullable()) } .map(f => AttributeReference(f.name, f.dataType, f.nullable, f.metadata)()) - .toSeq() + .toSeq } }