3xf45s2dp 

   
   

Output:

HelloWorld.scala:1: error: object amazonaws is not a member of package com
import com.amazonaws.services.glue.ChoiceOption
           ^
HelloWorld.scala:2: error: object amazonaws is not a member of package com
import com.amazonaws.services.glue.GlueContext
           ^
HelloWorld.scala:3: error: object amazonaws is not a member of package com
import com.amazonaws.services.glue.MappingSpec
           ^
HelloWorld.scala:4: error: object amazonaws is not a member of package com
import com.amazonaws.services.glue.ResolveSpec
           ^
HelloWorld.scala:5: error: object amazonaws is not a member of package com
import com.amazonaws.services.glue.errors.CallSite
           ^
HelloWorld.scala:6: error: object amazonaws is not a member of package com
import com.amazonaws.services.glue.util.GlueArgParser
           ^
HelloWorld.scala:7: error: object amazonaws is not a member of package com
import com.amazonaws.services.glue.util.Job
           ^
HelloWorld.scala:8: error: object amazonaws is not a member of package com
import com.amazonaws.services.glue.util.JsonOptions
           ^
HelloWorld.scala:9: error: object apache is not a member of package org
import org.apache.spark.SparkContext
           ^
HelloWorld.scala:11: error: object apache is not a member of package org
import org.apache.spark.sql.SparkSession
           ^
HelloWorld.scala:15: error: not found: type SparkContext
    val spark: SparkContext = new SparkContext()
               ^
HelloWorld.scala:15: error: not found: type SparkContext
    val spark: SparkContext = new SparkContext()
                                  ^
HelloWorld.scala:16: error: not found: type GlueContext
    val glueContext: GlueContext = new GlueContext(spark)
                     ^
HelloWorld.scala:16: error: not found: type GlueContext
    val glueContext: GlueContext = new GlueContext(spark)
                                       ^
HelloWorld.scala:18: error: not found: value GlueArgParser
    val args = GlueArgParser.getResolvedOptions(sysArgs, Seq("JOB_NAME").toArray)
               ^
HelloWorld.scala:19: error: not found: value Job
    Job.init(args("JOB_NAME"), glueContext, args.asJava)
    ^
HelloWorld.scala:26: error: not found: value Job
    Job.commit()
    ^

Scala Online Compiler

Write, Run & Share Scala code online using OneCompiler's Scala online compiler for free. It's one of the robust, feature-rich online compilers for Scala language, running on the latest version 2.13.8. Getting started with the OneCompiler's Scala compiler is simple and pretty fast. The editor shows sample boilerplate code when you choose language as Scala and start coding.

Read input from STDIN in Scala

OneCompiler's Scala online editor supports stdin and users can give inputs to programs using the STDIN textbox under the I/O tab. Following is a sample Scala program which takes name as input and prints hello message with your name.


About Scala

Scala is both object-oriented and functional programming language by Martin Odersky in the year 2003.

Syntax help

Variables

Variable is a name given to the storage area in order to identify them in our programs.


Loops and conditional statements

1. If family:

If, If-else, Nested-Ifs are used when you want to perform a certain set of operations based on conditional expressions.

If


If-else


Nested-If-else


2. For:

For loop is used to iterate a set of statements based on a criteria.


3. While:

While is also used to iterate a set of statements based on a condition. Usually while is preferred when number of iterations are not known in advance.


4. Do-While:

Do-while is also used to iterate a set of statements based on a condition. It is mostly used when you need to execute the statements atleast once.


Functions

Function is a sub-routine which contains set of statements. Usually functions are written when multiple calls are required to same set of statements which increases re-usuability and modularity.


Note:

You can either use = or not in the function definition. If = is not present, function will not return any value.



© Copyright 2025 One Compiler Pvt. Ltd. | Privacy Policy | Terms & Conditions