/** * Shallow tuple copy. * @return A new Tuple with the same fields as this. */ @Override @SuppressWarnings("unchecked") public Tuple7<T0, T1, T2, T3, T4, T5, T6> copy() { return new Tuple7<>(this.f0, this.f1, this.f2, this.f3, this.f4, this.f5, this.f6); }
@Override public boolean filter(Tuple7<String, String, String, String, String, String, String> tuple) throws Exception { return tuple.getField(4).equals("view"); } }
@Override public boolean filter(Tuple7<String, String, String, String, String, String, String> tuple) throws Exception { return tuple.getField(4).equals("view"); } }
/** * Creates a new tuple and assigns the given values to the tuple's fields. * This is more convenient than using the constructor, because the compiler can * infer the generic type arguments implicitly. For example: * {@code Tuple3.of(n, x, s)} * instead of * {@code new Tuple3<Integer, Double, String>(n, x, s)} */ public static <T0, T1, T2, T3, T4, T5, T6> Tuple7<T0, T1, T2, T3, T4, T5, T6> of(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6) { return new Tuple7<>(value0, value1, value2, value3, value4, value5, value6); } }
public Tuple7Builder<T0, T1, T2, T3, T4, T5, T6> add(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6){ tuples.add(new Tuple7<>(value0, value1, value2, value3, value4, value5, value6)); return this; }
public static DataSet<Tuple7<Long, Integer, Integer, Long, String, Integer, String>> getSmallTuplebasedDataSetMatchingPojo(ExecutionEnvironment env) { List<Tuple7<Long, Integer, Integer, Long, String, Integer, String>> data = new ArrayList<>(); data.add(new Tuple7<>(10000L, 10, 100, 1000L, "One", 1, "First")); data.add(new Tuple7<>(20000L, 20, 200, 2000L, "Two", 2, "Second")); data.add(new Tuple7<>(30000L, 30, 300, 3000L, "Three", 3, "Third")); return env.fromCollection(data); }
public static DataSet<Tuple7<Integer, String, Integer, Integer, Long, String, Long>> getSmallTuplebasedDataSet(ExecutionEnvironment env) { List<Tuple7<Integer, String, Integer, Integer, Long, String, Long>> data = new ArrayList<>(); data.add(new Tuple7<>(1, "First", 10, 100, 1000L, "One", 10000L)); data.add(new Tuple7<>(2, "Second", 20, 200, 2000L, "Two", 20000L)); data.add(new Tuple7<>(3, "Third", 30, 300, 3000L, "Three", 30000L)); return env.fromCollection(data); }
private static DataSet<Tuple7<LongValue, IntValue, IntValue, LongValue, StringValue, IntValue, StringValue>> getSmallTuplebasedDataSetMatchingPojo(ExecutionEnvironment env) { List<Tuple7<LongValue, IntValue, IntValue, LongValue, StringValue, IntValue, StringValue>> data = new ArrayList<>(); data.add(new Tuple7<>(new LongValue(10000L), new IntValue(10), new IntValue(100), new LongValue(1000L), new StringValue("One"), new IntValue(1), new StringValue("First"))); data.add(new Tuple7<>(new LongValue(20000L), new IntValue(20), new IntValue(200), new LongValue(2000L), new StringValue("Two"), new IntValue(2), new StringValue("Second"))); data.add(new Tuple7<>(new LongValue(30000L), new IntValue(30), new IntValue(300), new LongValue(3000L), new StringValue("Three"), new IntValue(3), new StringValue("Third"))); return env.fromCollection(data); }
private static DataSet<Tuple7<IntValue, StringValue, IntValue, IntValue, LongValue, StringValue, LongValue>> getSmallTuplebasedDataSet(ExecutionEnvironment env) { List<Tuple7<IntValue, StringValue, IntValue, IntValue, LongValue, StringValue, LongValue>> data = new ArrayList<>(); data.add(new Tuple7<>(new IntValue(1), new StringValue("First"), new IntValue(10), new IntValue(100), new LongValue(1000L), new StringValue("One"), new LongValue(10000L))); data.add(new Tuple7<>(new IntValue(2), new StringValue("Second"), new IntValue(20), new IntValue(200), new LongValue(2000L), new StringValue("Two"), new LongValue(20000L))); data.add(new Tuple7<>(new IntValue(3), new StringValue("Third"), new IntValue(30), new IntValue(300), new LongValue(3000L), new StringValue("Three"), new LongValue(30000L))); return env.fromCollection(data); }
case 5: return new Tuple5(); case 6: return new Tuple6(); case 7: return new Tuple7(); case 8: return new Tuple8(); case 9: return new Tuple9();
/** * Shallow tuple copy. * @return A new Tuple with the same fields as this. */ @Override @SuppressWarnings("unchecked") public Tuple7<T0, T1, T2, T3, T4, T5, T6> copy() { return new Tuple7<>(this.f0, this.f1, this.f2, this.f3, this.f4, this.f5, this.f6); }
/** * Shallow tuple copy. * @return A new Tuple with the same fields as this. */ @Override @SuppressWarnings("unchecked") public Tuple7<T0, T1, T2, T3, T4, T5, T6> copy() { return new Tuple7<>(this.f0, this.f1, this.f2, this.f3, this.f4, this.f5, this.f6); }
/** * Creates a new tuple and assigns the given values to the tuple's fields. * This is more convenient than using the constructor, because the compiler can * infer the generic type arguments implicitly. For example: * {@code Tuple3.of(n, x, s)} * instead of * {@code new Tuple3<Integer, Double, String>(n, x, s)} */ public static <T0, T1, T2, T3, T4, T5, T6> Tuple7<T0, T1, T2, T3, T4, T5, T6> of(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6) { return new Tuple7<>(value0, value1, value2, value3, value4, value5, value6); } }
/** * Creates a new tuple and assigns the given values to the tuple's fields. * This is more convenient than using the constructor, because the compiler can * infer the generic type arguments implicitly. For example: * {@code Tuple3.of(n, x, s)} * instead of * {@code new Tuple3<Integer, Double, String>(n, x, s)} */ public static <T0, T1, T2, T3, T4, T5, T6> Tuple7<T0, T1, T2, T3, T4, T5, T6> of(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6) { return new Tuple7<>(value0, value1, value2, value3, value4, value5, value6); } }
public Tuple7Builder<T0, T1, T2, T3, T4, T5, T6> add(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6){ tuples.add(new Tuple7<>(value0, value1, value2, value3, value4, value5, value6)); return this; }
public Tuple7Builder<T0, T1, T2, T3, T4, T5, T6> add(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6){ tuples.add(new Tuple7<>(value0, value1, value2, value3, value4, value5, value6)); return this; }
@Override public void flatMap(String input, Collector<Tuple7<String, String, String, String, String, String, String>> out) throws Exception { JSONObject obj = new JSONObject(input); Tuple7<String, String, String, String, String, String, String> tuple = new Tuple7<>( obj.getString("user_id"), obj.getString("page_id"), obj.getString("ad_id"), obj.getString("ad_type"), obj.getString("event_type"), obj.getString("event_time"), obj.getString("ip_address")); out.collect(tuple); } }
@Override public void flatMap(String input, Collector<Tuple7<String, String, String, String, String, String, String>> out) throws Exception { JSONObject obj = (JSONObject) parser.parse(input); Tuple7<String, String, String, String, String, String, String> tuple = new Tuple7<>( obj.getAsString("user_id"), obj.getAsString("page_id"), obj.getAsString("campaign_id"), obj.getAsString("ad_type"), obj.getAsString("event_type"), obj.getAsString("event_time"), obj.getAsString("ip_address")); out.collect(tuple); } }
@Override public void flatMap(String input, Collector<Tuple7<String, String, String, String, String, String, String>> out) throws Exception { if (parser == null) { parser = new JSONParser(); } JSONObject obj = (JSONObject) parser.parse(input); Tuple7<String, String, String, String, String, String, String> tuple = new Tuple7<>( obj.getAsString("user_id"), obj.getAsString("page_id"), obj.getAsString("ad_id"), obj.getAsString("ad_type"), obj.getAsString("event_type"), obj.getAsString("event_time"), obj.getAsString("ip_address")); out.collect(tuple); } }
@Override public void flatMap(String input, Collector<Tuple7<String, String, String, String, String, String, String>> out) throws Exception { if (parser == null) { parser = new JSONParser(); } net.minidev.json.JSONObject obj = (net.minidev.json.JSONObject) parser.parse(input); Tuple7<String, String, String, String, String, String, String> tuple = new Tuple7<>( obj.getAsString("user_id"), obj.getAsString("page_id"), obj.getAsString("campaign_id"), obj.getAsString("ad_type"), obj.getAsString("event_type"), obj.getAsString("event_time"), obj.getAsString("ip_address")); out.collect(tuple); } }