!CJoUbovqKaCGrFkbrY:matrix.org

Spark with Scala

400 Members
A place to discuss and ask questions about using Scala for Spark programming.3 Servers

Load older messages


SenderMessageTime
5 Dec 2023
@_discord_818401984230981642:t2bot.iocheapsolutionarchitect Try spark-sql-api instead of spark-sql. 08:12:30
7 Dec 2023
@_discord_818401984230981642:t2bot.iocheapsolutionarchitect Sorry for the late answer, you will get the same behavior in Scala 2.13.x. The case class is probably defined within a method. I do not know enough about the internals of Scala, but it looks like the type tag can not be estimated. However, if you pull the case class in into the outer class, it works. So do this instead of the commented line
class Spark1() {
  case class A(b: String, c: String)

  private def execute() : Unit = {
    val spark = SparkSession.builder().getOrCreate()
    import spark.implicits._

    //case class A(b: String, c: String)
    val as = Seq(
      A("b", "c"),
    ).toDS()

    as.show()
  }
}
05:03:43
@_discord_818401984230981642:t2bot.iocheapsolutionarchitect * Sorry for the late answer, you will get the same behavior in Scala 2.13.x. The case class is probably defined within a method. I do not know enough about the internals of Scala, but it looks like the type tag can not be estimated. However, if you pull the case class into the outer class, it works. So do this instead of the commented line
class Spark1() {
  case class A(b: String, c: String)

  private def execute() : Unit = {
    val spark = SparkSession.builder().getOrCreate()
    import spark.implicits._

    //case class A(b: String, c: String)
    val as = Seq(
      A("b", "c"),
    ).toDS()

    as.show()
  }
}
05:04:54
9 Dec 2023
@softinio:matrix.orgSalar Rahmanian (softinio) changed their profile picture.05:18:53
@_discord_316549337167560706:t2bot.iounarist 07:17:18
@_discord_818401984230981642:t2bot.iocheapsolutionarchitect Not really, just the last to digits of a year are ambiguous. Spark decided on 2000 for the base value see https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html. Perhaps you could write your own udf making use of a certain feature of SimpleDateFormat, where you set a date and two digit years are interpreted 20 years into the past and 60 years into the future. https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/text/SimpleDateFormat.html 12:22:53
@_discord_818401984230981642:t2bot.iocheapsolutionarchitect * Not really, just the last to digits of a year are ambiguous. Spark decided on 2000 for the base value, see YEAR in https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html. Perhaps you could write your own udf making use of a certain feature of SimpleDateFormat, where you set a date and two digit years are interpreted 20 years into the past and 60 years into the future. https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/text/SimpleDateFormat.html 12:23:18
@_discord_818401984230981642:t2bot.iocheapsolutionarchitect * Not really, just the last two digits of a year are ambiguous. Spark decided on 2000 for the base value, see YEAR in https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html. Perhaps you could write your own udf making use of a certain feature of SimpleDateFormat, where you set a date and two digit years are interpreted 20 years into the past and 60 years into the future. https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/text/SimpleDateFormat.html 12:24:04
@_discord_818401984230981642:t2bot.iocheapsolutionarchitect * Not really, just the last two digits of a year are ambiguous. Spark decided on 2000 for the base value, see YEAR in https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html. Perhaps you could write your own udf making use of a certain feature of SimpleDateFormat, where you set a date on the calender and a a result two digit years are interpreted 20 years into the past and 60 years into the future. https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/text/SimpleDateFormat.html 12:24:51
@_discord_818401984230981642:t2bot.iocheapsolutionarchitect * Not really, just the last two digits of a year are ambiguous. Spark decided on 2000 for the base value, see YEAR in https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html. Perhaps you could write your own udf making use of a certain feature of SimpleDateFormat, where you set a date on the calender and as a result two digit years are interpreted 20 years into the past and 60 years into the future. https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/text/SimpleDateFormat.html 12:27:53
11 Dec 2023
@_discord_818401984230981642:t2bot.iocheapsolutionarchitect Looks like the same kind of problem as this https://discord.com/channels/632150470000902164/839723072239566878/1182330580646506548 13:20:32
@_discord_818401984230981642:t2bot.iocheapsolutionarchitect * Looks like the same kind of problem as this https://discord.com/channels/632150470000902164/839723072239566878/1182330580646506548. In Scala 2 this works, maybe someone in #scala-users can help to shed some light onto the situation why this does not work in Scala 3. Or it is just an artifact of Spark not supporting Scala 3 directly at the current time. 13:22:22
@_discord_387435475142705152:t2bot.iojungle_hacker69 changed their display name from jungle_hacker69#0 to jungle_hacker69.16:30:37
@_discord_818401984230981642:t2bot.iocheapsolutionarchitect I don't know, perhaps write a ticket to the spark project 🙂 16:59:39
16 Dec 2023
@_discord_510415959480336393:t2bot.iopotatoef changed their profile picture.10:55:25
19 Dec 2023
@_discord_305362010374406144:t2bot.iosteadhaven changed their display name from marouan28 to steadhaven.14:38:12
22 Dec 2023
@_discord_423419801134694401:t2bot.iomglvl changed their display name from miguelvilag to mglvl.16:28:53
24 Dec 2023
@_discord_397996873354444810:t2bot.ioufodivebomb I'll be thrilled once 2.13 is default on emr and databricks 14:58:19
9 Jan 2024
@_discord_632729825647525922:t2bot.ioekrich All the rows in one array or an array per row? 16:31:03
10 Jan 2024
@_discord_510415959480336393:t2bot.iopotatoef changed their profile picture.11:33:01
@_discord_397996873354444810:t2bot.ioufodivebomb I don't use databricks anymore but I recall being able to use spark UI and another per-query history interface with useful stats 20:55:08
12 Jan 2024
@_discord_945331330294624276:t2bot.iozhao_nan changed their display name from Zhao Nan to zhao_nan.17:01:58
@_discord_231350810565410817:t2bot.ioragnar changed their display name from ragnar#4252 to ragnar.21:32:24
13 Jan 2024
@_discord_632729825647525922:t2bot.ioekrich I am a little confused about auto trim and extra padded spaces in the same context. Can you explain in a little more detail? 00:14:28
@_discord_967195426275065976:t2bot.ioose_369 changed their display name from OSE to ose_369.00:42:10
14 Feb 2024
@nrktkt:matrix.orgnrktkt!discord bridge 632150470000902164 83972307223956687817:34:35
@_discord_bot:t2bot.ioDiscord BridgeI'm asking permission from the guild administrators to make this bridge.17:34:37
@nrktkt:matrix.orgnrktktchanged room power levels.17:34:45
@_discord_bot:t2bot.ioDiscord Bridge

Timed out waiting for a response from the Discord owners.

17:39:38
28 Mar 2024
@m:matrix.mahfoudh.orgDr. Dude changed their profile picture.11:18:03

There are no newer messages yet.


Back to Room ListRoom Version: 9