Skip to content

Commit

Permalink
[FLINK-7998][examples] Fix TPCHQuery3 examples
Browse files Browse the repository at this point in the history
This closes apache#4959.
  • Loading branch information
Vetriselvan1187 authored and zentol committed Nov 14, 2017
1 parent ed90379 commit 408e186
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ public static void main(String[] args) throws Exception {

// get input data
DataSet<Lineitem> lineitems = getLineitemDataSet(env, params.get("lineitem"));
DataSet<Order> orders = getOrdersDataSet(env, params.get("customer"));
DataSet<Customer> customers = getCustomerDataSet(env, params.get("orders"));
DataSet<Customer> customers = getCustomerDataSet(env, params.get("customer"));
DataSet<Order> orders = getOrdersDataSet(env, params.get("orders"));

// Filter market segment "AUTOMOBILE"
customers = customers.filter(
Expand Down Expand Up @@ -180,7 +180,10 @@ public ShippingPriorityItem join(ShippingPriorityItem i, Lineitem l) {
// DATA TYPES
// *************************************************************************

private static class Lineitem extends Tuple4<Long, Double, Double, String> {
/**
* Lineitem.
*/
public static class Lineitem extends Tuple4<Long, Double, Double, String> {

public Long getOrderkey() {
return this.f0;
Expand All @@ -199,7 +202,10 @@ public String getShipdate() {
}
}

private static class Customer extends Tuple2<Long, String> {
/**
* Customer.
*/
public static class Customer extends Tuple2<Long, String> {

public Long getCustKey() {
return this.f0;
Expand All @@ -210,7 +216,10 @@ public String getMktsegment() {
}
}

private static class Order extends Tuple4<Long, Long, String, Long> {
/**
* Order.
*/
public static class Order extends Tuple4<Long, Long, String, Long> {

public Long getOrderKey() {
return this.f0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ object TPCHQuery3 {
getCustomerDataSet(env, params.get("customer")).
filter( c => c.mktSegment.equals("AUTOMOBILE"))
// read orders
val orders = getOrdersDataSet(env, params.get("order"))
val orders = getOrdersDataSet(env, params.get("orders"))

// filter orders by order date
val items = orders.filter( o => dateFormat.parse(o.orderDate).before(date) )
Expand Down

0 comments on commit 408e186

Please sign in to comment.