In [2]:
import $exec.`init_spark`


Compiling init_spark.sc
Out[2]:
import $exec.$           

In [3]:
import sparkSession.implicits._


Out[3]:
import sparkSession.implicits._

In [4]:
val df = sparkSession.read.load("../../data/EG.USE.PCAP.KG.OE.parquet")


SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Out[4]:
df: DataFrame = [country: string, date: string ... 1 more field]

In [6]:
df.printSchema()


root
 |-- country: string (nullable = true)
 |-- date: string (nullable = true)
 |-- EnergyUse: double (nullable = true)


In [7]:
df.show()


+----------+----+----------------+
|   country|date|       EnergyUse|
+----------+----+----------------+
|Arab World|2016|            null|
|Arab World|2015|            null|
|Arab World|2014| 1953.2866799885|
|Arab World|2013|1796.94395608284|
|Arab World|2012|1840.17607419993|
|Arab World|2011|1730.34335715862|
|Arab World|2010|1764.52842919642|
|Arab World|2009|1704.61229143762|
|Arab World|2008|1658.96497157755|
|Arab World|2007| 1575.1605340115|
|Arab World|2006|1543.81365388741|
|Arab World|2005| 1477.4704053085|
|Arab World|2004|1422.61468479476|
|Arab World|2003|1373.74580899676|
|Arab World|2002|1381.53204529262|
|Arab World|2001|1345.56258698601|
|Arab World|2000|1278.84081270366|
|Arab World|1999|1276.01316793182|
|Arab World|1998|1290.76730243426|
|Arab World|1997|1299.80898008518|
+----------+----+----------------+
only showing top 20 rows


In [ ]: