scala Questions

6

Solved

I'm using official JDBC driver for PostgreSQL, but I'm stuck with the following issues: No support for PostgreSQL-ish data structures such as UUIDs. Common JDBC weirdness, such as: No function t...
Taxis asked 4/2, 2011 at 16:13

4

Solved

I have a json file: { "a": { "b": 1 } } I am trying to read it: val path = "D:/playground/input.json" val df = spark.read.json(path) df.show() But getting an erro...
Aldredge asked 11/8, 2019 at 16:27

9

Solved

I have a List of Map[String, Double], and I'd like to merge their contents into a single Map[String, Double]. How should I do this in an idiomatic way? I imagine that I should be able to do this wi...
Cupola asked 11/8, 2009 at 20:30

4

Solved

Suppose I have an array column group_ids +-------+----------+ |user_id|group_ids | +-------+----------+ |1 |[5, 8] | |3 |[1, 2, 3] | |2 |[1, 4] | +-------+----------+ Schema: root |-- user_id: in...

2

In the spark-shell (scala), we import, org.apache.spark.sql.hive.thriftserver._ for starting Hive Thrift server programatically for a particular hive context as HiveThriftServer2.startWithContext(h...
Sweptwing asked 14/4, 2016 at 16:32

4

Solved

I have a array of tuple like this: val a = Array((1,2,3), (2,3,4)) I want to write a generic method for a method like below: def sum2nd(aa: Array[(Int, Int, Int)]) = { aa.map { a => a._2 }....
Depicture asked 29/1, 2016 at 18:17

4

I've already read the question and answers to What design decisions would favour Scala's Actors instead of JMS?. Usually, we use messaging solutions which have existed for years already: either a ...
Breannabreanne asked 17/4, 2011 at 11:51

4

I want to use an external BOM to manage dependency versions for my project in SBT. For example, the AWS Java SDK publishes a bill-of-materials artifact to their maven repository: https://mvnrepos...
Watercool asked 3/2, 2017 at 20:12

2

Solved

I have a project that I host on GitHub and I use scala-steward to keep my plugins and dependencies up to date. This worked for a while and now it is turning out to be a nightmare to use such auto u...
Russophobe asked 6/11, 2022 at 11:19

15

Solved

What's the easiest way to debug Scala code managed by sbt using IntelliJ's built-in debugger? The documentation from "RunningSbt" from sbt's google code site lists commands for running the main cla...
Gerome asked 11/11, 2010 at 1:48

6

Assuming I have a (what I assume is mutable by default) Array[String] How in Scala can I simply remove the nth element? No simple method seems to be available. Want Something like (I made this u...
Sydneysydnor asked 11/1, 2014 at 0:47

2

Solved

Assuming you have case classes like the following case class Test1(a:String,b:Int,c:Char) case class Test2(a:String,b:Int) And you instantiate the classes with the following variables val test...
Petrolatum asked 21/4, 2014 at 7:17

1

This simplified case is where my question happen at... object Main extends IOApp{ def run(args:Seq[String]): IO[ExitCode]={ Task{...} .to[IO] .as(ExitCode.Success) } } Another option is Await...

2

My sbt project takes more than 15 minutes when I do sbt clean compile I am on a beefy machine on AWS. I am fairly certain its not a resource issue on cpu or internet bandwidth. Also, I have run...
Atrip asked 12/8, 2015 at 5:51

5

Solved

I am using Slick 1.0.0 with play framework 2.1.0. I am getting the following error when I query my Users table. The value of LOGIN_ID is null in DB. The query I am executing is: val user = { for...
Nesta asked 31/3, 2013 at 16:58

5

Solved

For example: scala> val l:List[String] = List("one", "two") l: List[String] = List(one, two) scala> l.contains(1) //wish this didn't compile res11: Boolean = false The various explanatio...
Prestigious asked 16/1, 2010 at 17:18

3

Solved

In my project, my external library is spark-assembly-1.3.1-hadoop2.6.0, if I press '.', the IDE inform me toDF(), but it inform me that can't resolve symbol toDF() when I code it in. I'm sorry I ca...
Bloat asked 30/6, 2015 at 16:42

2

Hi I try to run spark on my local laptop. I created a mvn project in intelijidea and in my main class I have one line like bellow and when I try to run a project I got the error like below val spa...
Maxim asked 2/11, 2021 at 17:8

2

Error Message - job failed with error message The output of the notebook is too large. Cause: rpc response (of 20972488 bytes) exceeds limit of 20971520 bytes Details: We are using databricks noteb...
Tippet asked 3/12, 2021 at 9:53

2

Solved

I have a Scala Spark application and want to invoke pySpark/python (pyspark_script.py) for further processing. There are multiple resources to use Java/Scala code in Python but I am looking for sca...
Empale asked 12/8, 2021 at 19:27

21

I'm evaluating IntelliJ (13.0.2 133.696) and cannot get jUnit tests to run from within the IDE. My project is a multi module gradle project and uses scala. Test class is located under src/test/s...
Ardin asked 28/2, 2014 at 20:33

4

Solved

In Scala, suppose I have a case class like this: case class Sample(myInt: Int, myString: String) Is there a way for me to obtain a Seq[(String, Class[_])], or better yet, Seq[(String, Manifest)]...
Randa asked 8/6, 2011 at 17:0

12

Solved

Given the following Scala List: val l = List(List("a1", "b1", "c1"), List("a2", "b2", "c2"), List("a3", "b3", "c3")) How can I get: List(("a1", "a2", "a3"), ("b1", "b2", "b3"), ("c1", "c2", "c3...
Redeem asked 2/11, 2009 at 23:49

1

Solved

I am getting the issue below: java.lang.reflect.InaccessibleObjectException: Unable to make field protected transient int java.util.AbstractList.modCount accessible: module java.base does not &quot...
Sabadell asked 27/4, 2023 at 14:57

4

Solved

How can I set target JVM version in SBT? In Maven (with maven-scala-plugin) it can be done as follows: <plugin> ... <configuration> <scalaVersion>${scala.version}</scalaVers...
Andrus asked 30/9, 2010 at 13:35

© 2022 - 2024 — McMap. All rights reserved.