Details
Description
For example, in the test travel-sample-views, the plan contains several calls to cast even though the input and output types are exactly the same.
For example:
assign [$$7264, $$4010] <- [cast(cast(cast(cast(cast(cast(cast({\"t\": \"airline_view\", \"k\": $$4072, \"v\": {\"airline_iata_code\": $$4072, \"airline_icao_code\": string-default-null($$airline.getField(\"icao\")), \"airline_callsign\": string-default-null($$airline.getField(\"callsign\")), \"airline_name\": string-default-null($$airline.getField(\"name\")), \"country\": string-default-null($$airline.getField(\"country\"))}}))))))), \"airline_view\"]
|
-- ASSIGN |UNPARTITIONED|
|
limit 3
|
-- STREAM_LIMIT |UNPARTITIONED|
|
exchange
|
-- SORT_MERGE_EXCHANGE [$$4072(ASC) ] |PARTITIONED|
|
limit 3
|
-- STREAM_LIMIT |PARTITIONED|
|
exchange
|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
|
order (topK: 3) (ASC, $$4072)
|
-- STABLE_SORT [topK: 3] [$$4072(ASC)] |PARTITIONED|
|
exchange
|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
|
select (not(is-null($$4072)))
|
-- STREAM_SELECT |PARTITIONED|
|
assign [$$4072] <- [string-default-null($$airline.getField(\"iata\"))]
|
-- ASSIGN |PARTITIONED|
|
project ([$$airline])
|
-- STREAM_PROJECT |PARTITIONED|
|
exchange
|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
|
data-scan []<-[$$1295, $$airline, $$1296] <- `travel-sample`.inventory.airline
|
-- DATASOURCE_SCAN |PARTITIONED|
|
exchange
|
-- ONE_TO_ONE_EXCHANGE |PARTITIONED|
|
empty-tuple-source
|
-- EMPTY_TUPLE_SOURCE |PARTITIONED
|
The multiple casts below are mostly useless as the input and output record types are exactly the same.
assign [$$7264, $$4010] <- [cast(cast(cast(cast(cast(cast(cast({\"t\": \"airline_view\", \"k\": $$4072, \"v\": {\"airline_iata_code\": $$4072, \"airline_icao_code\": string-default-null($$airline.getField(\"icao\")), \"airline_callsign\": string-default-null($$airline.getField(\"callsign\")), \"airline_name\": string-default-null($$airline.getField(\"name\")), \"country\": string-default-null($$airline.getField(\"country\"))}}))))))), \"airline_view\"]
|
The issue is ARecordType deepEqual also compares allPossibleAdditionalFieldNames, which (I believe) should not be included in the comparison as it sole purpose is to provide a hint to the compiler about the possible fields in the open part.
Attachments
Issue Links
- links to