Hi,

after upgr= ading from 2.3.2 to 2.4.0 we recognized a regression when using posexplode(= ) in conjunction with select of another struct fields.
Given a structure like this:
=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D
>>> df =3D (spar= k.range(1)
...=C2=A0 =C2=A0 =C2=A0.withCo= lumn("my_arr", array(lit("1"), lit("2")))
...=C2=A0 =C2=A0 =C2=A0.withColumn("bar= ", lit("1"))
...=C2=A0 =C2= =A0 =C2=A0.select("id", "my_arr", struct("bar"= ;).alias("foo"))
... )
>>>=C2=A0
>>> df.printSchema()
root
=C2=A0|-- id: long (nullable =3D false)
=C2=A0|-- my_arr: array (nullable =3D false)=
=C2=A0|=C2=A0 =C2=A0 |-- element: string= (containsNull =3D false)
=C2=A0|-- foo: = struct (nullable =3D false)
=C2=A0|=C2=A0= =C2=A0 |-- bar: string (nullable =3D false)

<= /div>

Spark 2.3.2
= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>>=C2=A0
>>> df =3D df.select(pose= xplode("my_arr"), "foo.bar")
>>&= gt;=C2=A0
>>> df.printSchema()
r= oot
=C2=A0|-- pos: integer (nullable =3D false)
=C2=A0|-- col: string (nullable =3D false)
=C2=A0|-= - bar: string (nullable =3D false)

selecting "foo.bar" results in field &quo= t;bar".

Spark 2.4.0
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>&= gt;>=C2=A0
= >>> df =3D df.select(posexplode("my_arr"), "foo.bar= ")
>>>= =C2=A0
>>> df= .printSchema()
root
=C2=A0|-- pos: integer (= nullable =3D false)
= =C2=A0|-- col: string (nullable =3D false)
=C2=A0|-- foo.bar: string (nullable =3D false)<= /div>
<= br>
In 2.= 4 'bar' now gets 'foo.bar', which is not what we would expe= ct.
So ex= isting code having .select("bar") will fail.

>>> df.select(&= quot;bar").show()
Traceback (most recent call last):
=C2=A0 File "<stdin>", line 1, in <module>