This tutorial will show you how to use sqlContext in Spark SQL to create and drop tables. Please review the previous sessions on “Spark” to gain a better understanding of “Spark SQL” and “sqlContext.”
“CREATE TABLE emp(
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ‘,’
LINES TERMINATED BY ‘\n’
If you want to create in the traditional SQL approach, use the following command.
“CREATE TABLE emptest(
“drop table emp”)
To avoid each line being executed, please type the above command in a single line as shown in the image.
Hope you find this article helpful.
Subscribing to this site will allow you to receive quick updates on future articles.