In [1]:
%%classpath add mvn
org.apache.spark spark-core_2.11 2.3.1
org.apache.spark spark-sql_2.11 2.3.1
In [2]:
import org.apache.spark.sql.SparkSession
import org.apache.spark.sql.functions._
val spark = SparkSession.builder()
.master("local[2]")
.appName("Spark Column Example")
.config("spark.some.config.option", "some-value")
.getOrCreate()
import spark.implicits._
Out[2]:
In [21]:
spark.read.parquet(
"file:///workdir/archives/projects/rilb/src/test/resources/abc_item_1.parquet"
)
Out[21]:
In [11]:
spark.read.parquet(
"/workdir/archives/projects/rilb/src/test/resources/abc_item_[1-2].parquet"
)
Out[11]:
In [10]:
spark.read.parquet(
"/workdir/archives/projects/rilb/src/test/resources/abc_item_*.parquet"
)
Out[10]:
In [6]:
spark.read.parquet(
"/workdir/archives/projects/rilb/src/test/resources/abc_item_{1,2}.parquet"
)
Out[6]:
In [13]:
spark.read.parquet(
"/workdir/archives/projects/rilb/src/test/resources/{abc_item_1.parquet,abc_item_2.parquet}"
)
Out[13]:
In [14]:
spark.read.parquet(
"/workdir/{archives/projects/rilb/src/test/resources/abc_item_1.parquet,archives/projects/rilb/src/test/resources/abc_item_2.parquet}"
)
Out[14]:
In [15]:
spark.read.parquet(
"/{workdir/archives/projects/rilb/src/test/resources/abc_item_1.parquet,workdir/archives/projects/rilb/src/test/resources/abc_item_2.parquet}"
)
Out[15]:
In [5]:
spark.read.parquet(
"/workdir/archives/projects/rilb/src/test/resources/abc_item_1.parquet,/workdir/archives/projects/rilb/src/test/resources/abc_item_2.parquet"
)
In [24]:
spark.read.parquet(
"file:///workdir/archives/projects/rilb/src/test/resources/abc_item_1.parquet,file:///workdir/archives/projects/rilb/src/test/resources/abc_item_2.parquet"
)
In [20]:
spark.read.parquet(
"file://{/workdir/archives/projects/rilb/src/test/resources/abc_item_1.parquet,/workdir/archives/projects/rilb/src/test/resources/abc_item_2.parquet}"
)
In [9]:
spark.read.parquet(
"{file:///workdir/archives/projects/rilb/src/test/resources/abc_item_1.parquet,file:///workdir/archives/projects/rilb/src/test/resources/abc_item_2.parquet}"
)
In [ ]: