Questions tagged as 'scala'

1
answer

Scala - Import error

Good evening. When I import a singleton object from a class within the same folder, I get this error, look. In this class called Summer.scala, is where I try to import the Singleton Object from the ChecksumAccumulator class import Checks...
asked by 23.01.2017 / 03:16
0
answers

Load csv spark file 2.3.0 to analyze it with k-means

I am new using Apache Spark, version 2.3.0. I am based on the sample code that comes in the Spark page to be able to use the k-means algorithm. I make the example shown below and run it perfectly, but when trying to use it with csv file the erro...
asked by 03.10.2018 / 06:07
1
answer

Should I change the structure of my Akka project to integrate Play?

I am developing an Akka project, taking advantage of the actor model. Now I would like to expose some of the business logic as REST services and I am considering using Play Framework (it seems easier) or Akka Http (more low level). Input woul...
asked by 30.11.2016 / 19:03
3
answers

Recursive function to obtain vowels of a word (Scala)

I am trying to do an exercise in which we have to define a recursive function that is able to return a string with all the vowels of a string using another function that indicates whether a Char is vowel or not: object ej8 { def esVocal(letr...
asked by 18.10.2018 / 04:01
1
answer

Generics in Scala

Good morning I was trying to apply a function on a figure to return a new figure but with the position in x and y changed for this I define the figure as: * To use pattern matching: case class Circulo(x:Int, y: Int, radio: Double) ex...
asked by 10.12.2017 / 02:40
0
answers

I can not start commands in spark-shell with scala

Use cmd of win 10, I call spark-shell, spark is executed and I'm on the command line under scala. Then, when trying to execute any command whatsoever, this appears to me: Exception in thread "main" java.io.FileNotFoundException: C:\Users\histe...
asked by 25.11.2018 / 01:17
0
answers

Using spark scala Is there an efficient way to take all the columns of a DF and add N more columns?

I am working with a script in which there is a join of two dataframes with many columns each, the first is given an alias "A" and the second "B", the same for the columns of each one. Additional columns are created for the result of the join tha...
asked by 06.11.2018 / 19:39
1
answer

Why do I load the whole table in null when loading a dataframe in spark?

I'm using Apache Spark 2.3.0 but when I want to load the csv and then show its data with df.show the whole table appears in null and I do not understand why if the file does contain the data val schema = StructType(Array(StructField("Rank",Str...
asked by 11.10.2018 / 16:44
0
answers

Why does not sbt download play-slick dependencies?

scalaVersion := "2.12.6" sbt.version=1.2.1 addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.6.18") These are the dependencies I want to download: libraryDependencies += "com.typesafe.play" %% "play-slick" % "3.0.0" libraryDependencies...
asked by 14.09.2018 / 15:10
0
answers

java.lang.NoClassDefFoundError: Could not initialize class mainPrincipal $ in Apace Spark

Hi, first of all, thank you. I present problems when executing the following code in a cluster with Spark, if I execute it as master ("local [*]") it does not give problems everything perfect, but once I execute it in the following way   ...
asked by 18.05.2018 / 03:22