This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package retail | |
/** | |
* Created by itversity on 20/03/17. | |
*/ | |
/* build.sbt | |
name := "retail" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use dgadiraju_oozie; | |
drop table orders; | |
drop table order_items; | |
create external table orders ( | |
order_id int, | |
order_date string, | |
order_customer_id int, | |
order_status string | |
) row format delimited fields terminated by ',' | |
location '/user/dgadiraju/daily_revenue/orders'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package retail | |
import com.typesafe.config.ConfigFactory | |
import org.apache.hadoop.fs.{FileSystem, Path} | |
import org.apache.spark.{SparkConf, SparkContext} | |
/** | |
* Created by itversity on 27/03/17. | |
*/ | |
object DailyRevenuePerDayPerDepartment { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package nyse | |
import com.typesafe.config.ConfigFactory | |
import org.apache.hadoop.fs.{FileSystem, Path} | |
import org.apache.spark.{SparkConf, SparkContext} | |
/** | |
* Created by itversity on 28/03/17. | |
*/ | |
object TopNStocksByVolume { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package nyse | |
import com.typesafe.config.ConfigFactory | |
import org.apache.hadoop.fs.{FileSystem, Path} | |
import org.apache.spark.{SparkConf, SparkContext} | |
/** | |
* Created by itversity on 28/03/17. | |
*/ | |
object TopNStocksByVolumeWithName { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- first create database using this command | |
-- create database <database_name>; | |
-- Switch to database | |
-- use <database_name>; | |
-- create tables and load data using below commands | |
-- Run show tables to list the tables | |
create table departments ( | |
department_id int, | |
department_name string | |
) row format delimited fields terminated by ','; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package retail | |
import com.typesafe.config.ConfigFactory | |
import org.apache.hadoop.fs.{FileSystem, Path} | |
import org.apache.spark.{SparkConf, SparkContext} | |
import org.apache.spark.sql.hive.HiveContext | |
/** | |
* Created by itversity on 27/03/17. | |
* build.sbt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package retail | |
import com.typesafe.config.ConfigFactory | |
import org.apache.hadoop.fs.{FileSystem, Path} | |
import org.apache.spark.{SparkConf, SparkContext} | |
/** | |
* Created by itversity on 01/04/17. | |
* problem statement: | |
* Get the total revenue per day for all completed and closed orders |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package nyse | |
import com.typesafe.config.ConfigFactory | |
import org.apache.hadoop.fs.{FileSystem, Path} | |
import org.apache.spark.sql.SQLContext | |
import org.apache.spark.{SparkConf, SparkContext} | |
/** | |
* Created by itversity on 30/03/17. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# fmp.conf: a multiplex agent to save one copy of data in HDFS and | |
# other copy streamed to Kafka so that data can be processed by | |
# streaming technologies such as Spark Streaming | |
# Name the components on this agent | |
fmp.sources = logsource | |
fmp.sinks = kafkasink hdfssink | |
fmp.channels = kafkachannel hdfschannel | |
# Describe/configure the source |