viirya commented on a change in pull request #28327:
URL: https://github.com/apache/spark/pull/28327#discussion_r414644438



##########
File path: python/pyspark/sql/column.py
##########
@@ -296,12 +299,17 @@ def getItem(self, key):
         +----+------+
         |   1| value|
         +----+------+
-
-        .. versionchanged:: 3.0
-           If `key` is a `Column` object, the indexing operator should be used 
instead.
-           For example, `map_col.getItem(col('id'))` should be replaced with 
`map_col[col('id')]`.
         """
-        return _bin_op("getItem")(self, key)
+        if isinstance(key, Column) and not is_instance_of(
+                SparkContext._gateway,
+                key._jc.expr(),
+                "org.apache.spark.sql.catalyst.expressions.Literal"):

Review comment:
       So we allow Column of Literal? 




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to