Open lmatz opened 1 year ago
Flink:
== Optimized Physical Plan ==
Calc(select=[name, city, state, id])
+- Join(joinType=[InnerJoin], where=[=(seller, id0)], select=[id, seller, id0, name, city, state], leftInputSpec=[NoUniqueKey], rightInputSpec=[NoUniqueKey])
:- Exchange(distribution=[hash[seller]])
: +- Calc(select=[auction.id AS id, auction.seller AS seller], where=[AND(=(event_type, 1), SEARCH(auction.category, Sarg[10L:BIGINT]:BIGINT))])
: +- WatermarkAssigner(rowtime=[dateTime], watermark=[-(dateTime, 4000:INTERVAL SECOND)])
: +- Calc(select=[event_type, person, auction, bid, CASE(=(event_type, 0), person.dateTime, =(event_type, 1), auction.dateTime, bid.dateTime) AS dateTime])
: +- TableSourceScan(table=[[default_catalog, default_database, datagen]], fields=[event_type, person, auction, bid])
+- Exchange(distribution=[hash[id]])
+- Calc(select=[person.id AS id, person.name AS name, person.city AS city, person.state AS state], where=[AND(SEARCH(event_type, Sarg[0]), SEARCH(person.state, Sarg[_UTF-16LE'CA':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'ID':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'OR':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"]:VARCHAR(2147483647) CHARACTER SET "UTF-16LE"))])
+- WatermarkAssigner(rowtime=[dateTime], watermark=[-(dateTime, 4000:INTERVAL SECOND)])
+- Calc(select=[event_type, person, auction, bid, CASE(=(event_type, 0), person.dateTime, =(event_type, 1), auction.dateTime, bid.dateTime) AS dateTime])
+- TableSourceScan(table=[[default_catalog, default_database, datagen]], fields=[event_type, person, auction, bid])
== Optimized Execution Plan ==
Calc(select=[name, city, state, id])
+- Join(joinType=[InnerJoin], where=[(seller = id0)], select=[id, seller, id0, name, city, state], leftInputSpec=[NoUniqueKey], rightInputSpec=[NoUniqueKey])
:- Exchange(distribution=[hash[seller]])
: +- Calc(select=[auction.id AS id, auction.seller AS seller], where=[((event_type = 1) AND SEARCH(auction.category, Sarg[10]))])
: +- WatermarkAssigner(rowtime=[dateTime], watermark=[(dateTime - 4000:INTERVAL SECOND)])(reuse_id=[1])
: +- Calc(select=[event_type, person, auction, bid, CASE((event_type = 0), person.dateTime, (event_type = 1), auction.dateTime, bid.dateTime) AS dateTime])
: +- TableSourceScan(table=[[default_catalog, default_database, datagen]], fields=[event_type, person, auction, bid])
+- Exchange(distribution=[hash[id]])
+- Calc(select=[person.id AS id, person.name AS name, person.city AS city, person.state AS state], where=[(SEARCH(event_type, Sarg[0]) AND SEARCH(person.state, Sarg[_UTF-16LE'CA', _UTF-16LE'ID', _UTF-16LE'OR']))])
+- Reused(reference_id=[1])
Query:
RW: