Professional Documents
Culture Documents
STORED AS TEXTFILE
LOCATION '/user/maria_dev;
Step3 : Loading a data from file to table is the next step.We use
following query
LOAD DATA INPATH '/User/maria_dev/worldSalesData.csv' overwrite INTO
TABLE worldSalesData_external
Scrolling right
All the records present in csv file are now stored in external hive table
From results, it is vivid that Amazon has sold more products through
online mode.
Printing schema:
Creating dataframe for customers.csv
Printing schema
Data:
Customers data:
Creating temp view:
Now we can work with views using spark2.sql
Checking views data:
Customers who have placed orders:
Total revenue group by region:
Scatter chart:
Itemtypes with unit cost less than 100
How many customers like offline and online sales channel
Online-2378
Offline-2950
Customers records who have placed orders
Customers data as per the unit cost of the order placed and
filtering by order date