Describe the bug
Datafusion substrait consumer is unable to produce/consumer a substrait plan that uses the same column names with different aliases
To Reproduce
import substrait.gen.proto.plan_pb2 as plan_pb2
from datafusion import SessionContext
from datafusion import substrait as ss
ctx = SessionContext()
sql_query = "SELECT PS_PARTKEY K1, PS_SUPPKEY AS K1 FROM 'partsupp'"
substrait_proto = plan_pb2.Plan()
substrait_plan = ss.substrait.serde.serialize_to_plan(sql_query, ctx)
Error:
DataFusion error: Plan("Projections require unique expression names but the expression \\"partsupp.ps_partkey AS k1\\" at position 0 and \\"partsupp.ps_suppkey AS k1\\" at position 1 have the same name. Consider aliasing (\\"AS\\") one of them.")')
Expected behavior
No response
Additional context
No response