0

I am a spark scala newbie and I am trying to import a csv file from git repo into scala 3. I have tried using the panda example but, I am getting a few errors.

Errors:

Cannot resolve symbol url_github
; or new line expected (this is on the fd_df = fd.read_csv(url_github)
Cannot resolve symbol fd_df
Cannot resolve symbol read_csv
Cannot resolve symbol spark
Cannot resolve symbol spark_df

This is the code that I tried and I was expecting to see the file written to the console in scala, but, I got 9 errors instead.

import _root_.{flightData => fd}

url_github = Symbol("https")://github.com/abcde/Work/blob/main/flightData.csv'

fd_df = fd.read_csv(url_github)
spark_df = spark.createDataFrame(fd_df)

spark_df.limit(100000).show()
4
  • import root.{flightData => fd} object ReadCSVOne extends App { url_github = Symbol("https"): //github.com/abcde/Work/blob/main/flightData.csv' fd_df;fd.read_csv() spark_df = spark.createDataFrame() spark_df.limit().show() case class fd_df() } Commented Dec 5, 2022 at 3:11
  • I updated my code. When I run it, I get this error now. object flightData is not a member of package <root> import root.{flightData => fd} Commented Dec 5, 2022 at 3:12
  • 1
    This isn't a valid Scala code, haven't you mixed up some Jupyter examples for Scala and Python with some definitions missing? Commented Dec 5, 2022 at 18:47
  • probably so @MateuszKubuszok Commented Dec 7, 2022 at 17:58

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.