Code review comment: Good point, I think I accidentally missed that detail when I worked on this part of the PR a while back. I'll add a timestamp extractor. Doing this on the level of `DataGeneratorSource` is currently not possible - that would require some redesign around a low-level implementation with user-supplied SerDe, similar to how KafkaSource does it: https://github.com/apache/flink/blob/8db43d7ffeabc7a0f5c67c9cdd964c64f400789b/flink-connectors/flink-connector-kafka/src/main/java/org/apache/flink/connector/kafka/source/reader/KafkaRecordEmitter.java#L60

Code under review:
public static void main(String[] args) throws Exception {

        final ParameterTool params = ParameterTool.fromArgs(args);
        final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

        env.getConfig().setGlobalJobParameters(params);
        env.setParallelism(1);

        final boolean fileOutput = params.has("output");

        final List<Tuple3<String, Long, Integer>> input = new ArrayList<>();

        input.add(new Tuple3<>("a", 1L, 1));
        input.add(new Tuple3<>("b", 1L, 1));
        input.add(new Tuple3<>("b", 3L, 1));
        input.add(new Tuple3<>("b", 5L, 1));
        input.add(new Tuple3<>("c", 6L, 1));
        
        
        input.add(new Tuple3<>("a", 10L, 1));
        
        input.add(new Tuple3<>("c", 11L, 1));

        GeneratorFunction<Long, Tuple3<String, Long, Integer>> dataGenerator =
                index -> input.get(index.intValue());
        DataGeneratorSource<Tuple3<String, Long, Integer>> generatorSource =
                new DataGeneratorSource<>(
                        dataGenerator,
                        input.size(),
                        TypeInformation.of(new TypeHint<Tuple3<String, Long, Integer>>() {}));

        DataStream<Tuple3<String, Long, Integer>> source =
                env.fromSource(
                        generatorSource,
                        WatermarkStrategy.forMonotonousTimestamps(),
                        "Generated data source");

        
        DataStream<Tuple3<String, Long, Integer>> aggregated =
                source.keyBy(value -> value.f0)
                        .window(EventTimeSessionWindows.withGap(Time.milliseconds(3L)))
                        .sum(2);

        if (fileOutput) {
            aggregated
                    .sinkTo(
                            FileSink.<Tuple3<String, Long, Integer>>forRowFormat(
                                            new Path(params.get("output")),
                                            new SimpleStringEncoder<>())
                                    .withRollingPolicy(
                                            DefaultRollingPolicy.builder()
                                                    .withMaxPartSize(MemorySize.ofMebiBytes(1))
                                                    .withRolloverInterval(Duration.ofSeconds(10))
                                                    .build())
                                    .build())
                    .name("output");
        } else {
            System.out.println("Printing result to stdout. Use --output to specify output path.");
            aggregated.print();
        }

        env.execute();
    }

Line commented on: TypeInformation.of(new TypeHint<Tuple3<String, Long, Integer>>() {}));

Revised code:
public static void main(String[] args) throws Exception {

        final ParameterTool params = ParameterTool.fromArgs(args);
        final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

        env.getConfig().setGlobalJobParameters(params);
        env.setParallelism(1);

        final boolean fileOutput = params.has("output");

        final List<Tuple3<String, Long, Integer>> input = new ArrayList<>();

        input.add(new Tuple3<>("a", 1L, 1));
        input.add(new Tuple3<>("b", 1L, 1));
        input.add(new Tuple3<>("b", 3L, 1));
        input.add(new Tuple3<>("b", 5L, 1));
        input.add(new Tuple3<>("c", 6L, 1));
        
        
        input.add(new Tuple3<>("a", 10L, 1));
        
        input.add(new Tuple3<>("c", 11L, 1));

        GeneratorFunction<Long, Tuple3<String, Long, Integer>> dataGenerator =
                index -> input.get(index.intValue());
        DataGeneratorSource<Tuple3<String, Long, Integer>> generatorSource =
                new DataGeneratorSource<>(
                        dataGenerator,
                        input.size(),
                        TypeInformation.of(new TypeHint<Tuple3<String, Long, Integer>>() {}));

        DataStream<Tuple3<String, Long, Integer>> source =
                env.fromSource(
                        generatorSource,
                        WatermarkStrategy.<Tuple3<String, Long, Integer>>forMonotonousTimestamps()
                                .withTimestampAssigner((event, timestamp) -> event.f1),
                        "Generated data source");

        
        DataStream<Tuple3<String, Long, Integer>> aggregated =
                source.keyBy(value -> value.f0)
                        .window(EventTimeSessionWindows.withGap(Time.milliseconds(3L)))
                        .sum(2);

        if (fileOutput) {
            aggregated
                    .sinkTo(
                            FileSink.<Tuple3<String, Long, Integer>>forRowFormat(
                                            new Path(params.get("output")),
                                            new SimpleStringEncoder<>())
                                    .withRollingPolicy(
                                            DefaultRollingPolicy.builder()
                                                    .withMaxPartSize(MemorySize.ofMebiBytes(1))
                                                    .withRolloverInterval(Duration.ofSeconds(10))
                                                    .build())
                                    .build())
                    .name("output");
        } else {
            System.out.println("Printing result to stdout. Use --output to specify output path.");
            aggregated.print();
        }

        env.execute();
    }