HyukjinKwon commented on code in PR #44349:
URL: https://github.com/apache/spark/pull/44349#discussion_r1427536554


##########
python/pyspark/errors/exceptions/captured.py:
##########
@@ -332,3 +345,37 @@ class UnknownException(CapturedException, 
BaseUnknownException):
     """
     None of the other exceptions.
     """
+
+
+class QueryContext(BaseQueryContext):
+    def __init__(self, q: JavaObject):
+        self._q = q
+
+    def contextType(self) -> QueryContextType:
+        context_type = self._q.contextType().toString()
+        assert context_type in ("SQL", "DataFrame")
+        if context_type == "DataFrame":
+            return QueryContextType.DataFrame
+        else:
+            return QueryContextType.SQL
+
+    def objectType(self) -> str:
+        return str(self._q.objectType())
+
+    def objectName(self) -> str:
+        return str(self._q.objectName())
+
+    def startIndex(self) -> int:

Review Comment:
   See my comment linked above 
https://github.com/apache/spark/pull/43352/files#r1427431997



-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to