zhengruifeng commented on code in PR #44532:
URL: https://github.com/apache/spark/pull/44532#discussion_r1441368306
##########
python/pyspark/pandas/base.py:
##########
@@ -1361,10 +1361,14 @@ def value_counts(
# If even one StructField is null, that row should be dropped.
index_spark_column_names =
self._internal.index_spark_column_names
spark_column = self.spark.column
Review Comment:
a minimum reproducer is
```
In [16]: from pyspark.sql import functions as sf
In [17]: df1 = spark.range(10).withColumn("a", sf.lit(0))
In [18]: c = sf.struct(df1["id"], df1["a"]).alias("s")
In [19]: df2 = df1.select(c)
In [20]: df2.where(c['id'] > 0)
Out[20]: 24/01/04 13:53:41 ERROR ErrorUtils: Spark Connect RPC error during:
analyze. UserId: ruifeng.zheng. SessionId: ac766649-8114-42ab-8bbb-f0f358b4a717.
org.apache.spark.sql.AnalysisException: [CANNOT_RESOLVE_WITH_PLAN_ID] Cannot
resolve `id` with plan id 21 in plan '[25]Filter '`>`('struct('id, 'a) AS
s#299[id], 0)
+- [24]Project [struct(id, id#292L, a, a#295) AS s#298]
+- [21]Project [id#292L, 0 AS a#295]
+- Range (0, 10, step=1, splits=Some(12))
. It's probably because of illegal references like
`df1.select(df2.col("a"))`. SQLSTATE: 42704
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]