Questions tagged [scala]
Scala is a general-purpose programming language principally targeting the Java Virtual Machine. Designed to express common programming patterns in a concise, elegant, and type-safe way, it fuses both imperative and functional programming styles. Its key features are: an advanced static type system with type inference; function types; pattern-matching; implicit parameters and conversions; operator overloading; full interoperability with Java; concurrency
scala
26
questions
-1
votes
0
answers
39
views
Using spark 3.4.1 lib in Java when extending StringRegexExpression to a java class
I am using spark 3.4.1 in maven project where I am configured scala (2.13.8) lang as well. I am trying to create a class Like.java in project by extending spark's StringRegexExpression
package com....
0
votes
0
answers
38
views
Scala project: sbt compile generates empty fs2-grpcs folder, missing proto-generated classes
I'm working on a Scala project that currently implements a simple REST API. I'm trying to add a new gRPC service to this project. However, I'm encountering an issue during compilation.
Issue:
When I ...
0
votes
1
answer
29
views
How to resolve: java.lang.NoSuchMethodError: 'scala.collection.Seq org.apache.spark.sql.types.StructType.toAttributes()'
Running a simple ETL PySpark job on Dataproc 2.2 with job property spark.jars.packages set to io.delta:delta-core_2.12:2.4.0 . Other settings are set to default. I have the following config:
conf = (
...
1
vote
1
answer
53
views
Scala Fs2: Aggregate computation on infinite streams
I cant seem to understand how to perform aggregate computations on infinite streams. Taking an infinite stream of elements and performing a computation on each one individually is easy, but collecting ...
0
votes
1
answer
64
views
Azure Synapse Analytics - output not displayed
Following Scala code in Azure Synapse should print: Hello, World!. But instead, it prints: defined object Geeks.
Question: What could be the issue and how can we fix it?
object Geeks {
// Main ...
1
vote
1
answer
39
views
Scala failed to install on Windows 10
I used this site to install Scala on latest version of Windows 10 Pro. The installer started and successfully completed the following steps (shown at the end below). At the end, command window asked: ...
2
votes
1
answer
43
views
Scala f interpolator formatting for Java LocalDate
I'd like to be able to format strings based on Java.LocalDate using the f interpolator, i.e. something like:
val = LocalDate.of(2024,7,28)
f"$dt:YYYY-MM-dd"
But this will give a compile ...
1
vote
0
answers
37
views
Casting to a Member Type in Scala
I'm using the Apache POI library 5.2.3 in Scala to create a line chart in a PowerPoint presentation.
// createData returns XDDFChartData
var chartData = chart.createData(
ChartTypes.LINE,
...
0
votes
0
answers
24
views
Scalatest 3.0.8 PrivateMethodTester can't find private method named X
I have a base class that has a protected method called "validateOptPwd". This gets inherited in a test and then called via PrivateMethodTester.
val validateOptPwdMethod: PrivateMethod[Future[...
1
vote
1
answer
36
views
uPickle ReadWriter for joda DateTime fails
For a project, i need JSON representation for a org.joda.time.DateTime. For JSON, i use uPickle. As there is no implicit ReaderWriter[DateTime], i have to write it myself. After googleing around, i ...
-1
votes
0
answers
41
views
How can I find if the current fiber is running in the primary or blocking thread pool [duplicate]
My app runs thousands of small tasks in parallel using foreachPar(){}.withParallelism(85). The app runs on a machine with 100 CPUs. Some tasks finish in a few milliseconds, while the others finish in ...