This file contains 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
#!/usr/bin/env bash | |
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/ | |
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c | |
# http://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver | |
# http://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception | |
# http://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal | |
# http://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04 | |
# Versions | |
CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE` |
This file contains 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
# load the "orders" table from Hive into a DataFrame | |
orders_df=sqlCtx.sql("select * from orders") | |
orders_df.printSchema() | |
# 1) calculate number of orders in SUSPECTED_FRAUD status | |
sqlCtx.select("select count(order_id) from orders where order_status='SUSPECTED_FRAUD'").show(5) | |
# load the "order_items" table from Hive into a DataFrame | |
order_items_df=sqlCtx.sql("select * from order_items") | |
order_items_df.printSchema() |
This file contains 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
#initialize | |
library(datasets) | |
library(ggplot2) | |
#helper function (convert vector to named list) | |
namel<-function (vec){ | |
tmp<-as.list(vec) | |
names(tmp)<-as.character(unlist(vec)) | |
tmp | |
} |