Skip to content

Instantly share code, notes, and snippets.

View amoghmargoor's full-sized avatar

Amogh Margoor amoghmargoor

View GitHub Profile
extern crate rand;
use rand::Rng;
use std::io::BufWriter;
use std::io::Write;
use std::fs::OpenOptions;
use std::fs::File;
use std::str::FromStr;
use std::io::BufReader;
use std::io::BufRead;
import scala.io.Source
object IteratorTest {
def main(args:Array[String]) {
val s1 = Source.fromFile("/Users/amoghm/src/rand.txt").mkString //returns the file data as String
//splitting String data with white space and calculating the number of occurrence of each word in the file
var buf = s1.split("\\s+").map(s => s.trim.toInt)
@amoghmargoor
amoghmargoor / iterator.rs
Last active November 9, 2019 06:27
Rust program for checking performance of Iterators
extern crate rand;
use rand::Rng;
use std::io::BufWriter;
use std::io::Write;
use std::fs::OpenOptions;
use std::fs::File;
use std::str::FromStr;
use std::io::BufReader;
use std::io::BufRead;
@amoghmargoor
amoghmargoor / q91.sql
Created February 1, 2018 05:13
Tpcds query q91
select
cc_call_center_id Call_Center, cc_name Call_Center_Name, cc_manager Manager,
sum(cr_net_loss) Returns_Loss
from
call_center, catalog_returns, date_dim, customer, customer_address,
customer_demographics, household_demographics
where
cr_call_center_sk = cc_call_center_sk
and cr_returned_date_sk = d_date_sk
and cr_returning_customer_sk = c_customer_sk