Mikhail Spirin
07/10/2023, 12:42 PMAlex Cruise
07/11/2023, 9:32 PMMikhail Spirin
07/12/2023, 4:32 AMMikhail Spirin
07/12/2023, 8:55 AMt_env.execute_sql(f"""
CREATE TABLE data (
o STRING,
price INT
) WITH (
'connector' = 'datagen',
'rows-per-second' = '1'
)
""")
ds = t_env.to_data_stream(t_env.from_path("data"))
keyed = ds.key_by(lambda x: x[1], key_type=<http://Types.INT|Types.INT>())
keyed = keyed.map(lambda x: f"new - {x[0]} - {x[1]} - 11\n", output_type=Types.STRING())
keyed.sink_to(kds_sink)
env.execute()
this - doesn’t work. Key is still fixed “0”…Mikhail Spirin
07/12/2023, 9:20 AMPartitionKey.
https://nightlies.apache.org/flink/flink-docs-master/api/java/org/apache/flink/connector/kinesis/table/FixedKinesisPartitionKeyGenerator.html
Seems to me it’s impossible, as python kinesis sink PartitionKeyGenerator has only two options, both of which are actually gateways to Java versions and no abliilty to have othewr ones….Alex Cruise
07/13/2023, 8:27 PMAlex Cruise
07/13/2023, 8:28 PMAlex Cruise
07/13/2023, 8:30 PMclientId , then a count(*) (assuming they all arrive within the window) will return:
• 123: 2
• 234: 1
• 345: 1Alex Cruise
07/13/2023, 8:31 PMval events: DataStream[X] = ...
val keyed = events.keyBy(_.clientId)