Skip to content

Commit

Permalink
formatted code
Browse files Browse the repository at this point in the history
  • Loading branch information
ajprabhu09 committed Jul 5, 2020
1 parent 0b69aab commit ee43939
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 33 deletions.
6 changes: 2 additions & 4 deletions examples/subtract.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use vega::*;
use std::sync::Arc;
use vega::*;

fn main() -> Result<()> {
let sc = Context::new()?;
Expand All @@ -12,10 +12,8 @@ fn main() -> Result<()> {
let ans = first.subtract(Arc::new(second));

for elem in ans.collect().iter() {
println!("{:?}",elem);
println!("{:?}", elem);
}

Ok(())


}
25 changes: 1 addition & 24 deletions src/rdd/rdd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,51 +26,29 @@ use serde_derive::{Deserialize, Serialize};
use serde_traitobject::{Deserialize, Serialize};

mod parallel_collection_rdd;

pub use parallel_collection_rdd::*;

mod cartesian_rdd;

pub use cartesian_rdd::*;

mod co_grouped_rdd;

pub use co_grouped_rdd::*;

mod coalesced_rdd;

pub use coalesced_rdd::*;

mod flatmapper_rdd;
mod mapper_rdd;

pub use flatmapper_rdd::*;
pub use mapper_rdd::*;

mod pair_rdd;

pub use pair_rdd::*;

mod partitionwise_sampled_rdd;

pub use partitionwise_sampled_rdd::*;

mod shuffled_rdd;

pub use shuffled_rdd::*;

mod map_partitions_rdd;

pub use map_partitions_rdd::*;

mod zip_rdd;

pub use zip_rdd::*;

mod union_rdd;

pub use union_rdd::*;

// Values which are needed for all RDDs
#[derive(Serialize, Deserialize)]
pub(crate) struct RddVals {
Expand Down Expand Up @@ -889,8 +867,7 @@ pub trait Rdd: RddBase + 'static {
})))
.cogroup(
other,
Box::new(HashPartitioner::<Self::Item>::new(num_splits))
as Box<dyn Partitioner>,
Box::new(HashPartitioner::<Self::Item>::new(num_splits)) as Box<dyn Partitioner>,
)
.map(Box::new(Fn!(|(x, (v1, v2)): (
Self::Item,
Expand Down
Binary file removed tests/.test_async.rs.swp
Binary file not shown.
8 changes: 3 additions & 5 deletions tests/test_rdd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ fn test_take_ordered() {
}

#[test]
fn test_subtract(){
fn test_subtract() {
let sc = CONTEXT.clone();
let col1 = vec![1, 2, 3, 4, 5, 10, 12, 13, 19, 0];

Expand All @@ -681,7 +681,5 @@ fn test_subtract(){
let first = sc.parallelize(col1, 4);
let second = sc.parallelize(col2, 4);
let ans = first.subtract(Arc::new(second));
assert_eq!(ans.collect().unwrap(),vec![19, 12, 10, 1, 0, 2])


}
assert_eq!(ans.collect().unwrap(), vec![19, 12, 10, 1, 0, 2])
}

0 comments on commit ee43939

Please sign in to comment.