Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ lazy val rootProjectName = settingKey[String]("Name of the root project")

lazy val commonMetaInformationSettings = Seq(
organization := "de.frosner",
version := "4.0.0-gamma-SNAPSHOT",
scalaVersion := "2.10.6",
version := "5.0.0-gamma-SNAPSHOT",
scalaVersion := "2.11.8",
rootProjectName := "spawncamping-dds"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import de.frosner.dds.servables._
import org.apache.spark.sql.Row
import org.apache.spark.sql.catalyst.ScalaReflection.Schema
import org.apache.spark.sql.catalyst.{CatalystTypeConverters, CatalystTypeConvertersAdapter, ScalaReflection}
import org.apache.spark.sql.catalyst.expressions.GenericMutableRow
import org.apache.spark.sql.types.{StringType, StructField, StructType}
import org.apache.spark.unsafe.types.UTF8String

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import scala.collection.mutable
import scala.collection.mutable.ArrayBuffer
import scala.reflect.ClassTag

import org.apache.spark.sql.types.StructType

import de.frosner.dds.util.DataFrameUtils._

object SparkSqlFunctions {
Expand Down Expand Up @@ -323,7 +325,9 @@ object SparkSqlFunctions {
val nominalColumnStatistics = columnStatistics.nominalColumns
val nominalFields = getNominalFields(dataFrame)
val nominalServables = for ((index, field) <- nominalFields) yield {
val groupCounts = dataFrame.groupBy(new Column(field.name)).count.map(row =>
//The Spark 2.0 does not support implicit encoding of structure fields other than for
//basic types. The only other way is using a predefined case class.
val groupCounts = dataFrame.groupBy(new Column(field.name)).count().rdd.map(row =>
(if (row.isNullAt(0)) "NULL" else row.get(0).toString, row.getLong(1))
)
val cardinality = groupCounts.count
Expand Down
6 changes: 3 additions & 3 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import sbt._
object Dependencies {

// Versions
lazy val sparkVersion = "1.5.0"
lazy val sprayVersion = "1.3.2"
lazy val sparkVersion = "2.1.0"
lazy val sprayVersion = "1.3.3"
lazy val replHelperVersion = "2.0.0"

// Dependencies
Expand All @@ -26,7 +26,7 @@ object Dependencies {
val datasetsDependencies = sparkDependencies ++ scalaTestDependencies
val webUiDependencies = scalaTestDependencies ++ sparkDependencies ++ Seq(
"io.spray" %% "spray-can" % sprayVersion,
"io.spray" %% "spray-routing" % sprayVersion,
"io.spray" %% "spray-routing-shapeless2" % sprayVersion,
"io.spray" %% "spray-caching" % sprayVersion,
"io.spray" %% "spray-json" % "1.3.1",
"com.typesafe.akka" %% "akka-actor" % "2.3.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ class ServableJsonProtocolTest extends FlatSpec with Matchers {
StructField("9", FloatType, true),
StructField("10", DoubleType, false),
StructField("11", DoubleType, true),
StructField("12", DecimalType.Unlimited, true),
//https://github.com/apache/spark/pull/7605/files#diff-89643554d9757dd3e91abff1cc6096c7L134
StructField("12", DecimalType.SYSTEM_DEFAULT, true),
StructField("13", StringType, true),
StructField("15", BooleanType, false),
StructField("16", BooleanType, true),
Expand Down