112,839 questions
2 votes
1 answer
55 views
backslash count in raw string interpolation in scala
I am using Scala 3.3.7. When I do val str1 = raw"\\\" // compile error: unclosed string literal It is considering the \" as a single character. But when I do val str1 = raw"\\\\&...
0 votes
1 answer
61 views
sbt-native-packager not found when compiling [closed]
I'm currently getting the error below when trying to compile my SBT project. The artifact does exists here (https://repo1.maven.org/maven2/com/github/sbt/sbt-native-packager_2.12_1.0/1.11.4/), but the ...
Tooling
0 votes
1 replies
36 views
Create a integrated test with ZIO and Quill
Hello I'm trying to create a integrated database test using testcontainer, my testcotainer is running with liquibase, my problem is about create quill connection, follow my code: container config: ...
1 vote
0 answers
67 views
trying to read bigquery array colum and passing it as columns to fetch from spark dataframe
I have a bigquery table with array column named as "column_list " ALTER TABLE `test-project.TEST_DATASET.TEST_TABLE` ADD COLUMN column_list ARRAY<STRING>; update `test-project....
0 votes
1 answer
88 views
col function error type mismatch: found string required Int
I am attempting to programmatically remove specific columns/fields from a dataframe (anything that starts with _), whether the field is in the root or in a struct, using the dropFields method. For ...
1 vote
0 answers
84 views
Lucene Boolean Operator Problems
Using Lucene, certain queries parse and execute in a completely unexpected way. Here's the code for testing it (written in Scala, but can be easily translated to Java too): import org.apache.lucene....
0 votes
1 answer
71 views
How to reference a CSV column with parentheses and a decimal point in Spark SQL or COALESCE expression?
I’m working on a data ingestion pipeline using Apache Spark (triggered via a Cloud Function on Dataproc). The input CSV contains column names that include special characters such as parentheses and a ...
1 vote
0 answers
73 views
How to run sbt offline (downloading all the dependecies and moving)
I wanted to use riscv-torture project to create tests in a server that has no access to the internet. I firstly run it in my ubuntu 22.04 then copy .sbt .ivy2 .cache/coursier .cache/JPN folders to the ...
2 votes
1 answer
105 views
Determine the variance of a class/type parameter by reflection without using `TypeTag`
I can get the formal type parameters (type variables) of any Java class/interface, including those defined in Scala, through java.lang.reflect API. In addition, Scala allows to define type parameters ...
-1 votes
2 answers
136 views
When to use conditionals vs pattern matching, is there a performance trade off? [closed]
I have two possibilities to implement a simple list drop method. A: def drop[A](l: List[A], n: Int): List[A] = (n, l) match case (n, l) if n <= 0 => l case (_, Cons(_, t)) => drop(t, n - ...
1 vote
0 answers
84 views
scala-maven-plugin cannot compile Java15+ feature text block
mixed compilation project of Scala and Java, and now upgrade jdk8->jdk21, use Java15+ feature text block before: String sql = "update hinsight.homeco_user_task set \n" + "...
0 votes
0 answers
81 views
Json matcher stop matching after migration to specs2 4.22
I have a small specification that uses json matcher import org.specs2.matcher.JsonMatchers import org.specs2.mutable.Specification class Test extends Specification with JsonMatchers { "test&...
1 vote
0 answers
45 views
Get list of settings from another setting in SBT
I'm new to Scala and I'm having trouble wrapping my head around the following scenario - I want to have a centralized spot in build.sbt where we log the current profile and set certain values based on ...
1 vote
3 answers
115 views
How to transform a Right to a Left
I was just reading some Scala code that, due to the structure of the program (and its use of for comprehensions), conditionally transformed a Right into a Left using flatMap: // someMethod() returns ...
4 votes
1 answer
214 views
In a gradle project that contains both Kotlin and Scala code, what's the easiest way to make Kotlin compilation to depend on Scala bytecode?
In gradle, both Kotlin and Scala compiler plugins have limitations: they can both compile Java code in mixed-order, but they cannot compile each other. The only option is to: compile Scala code first ...