You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "ueshin (via GitHub)" <gi...@apache.org> on 2023/04/16 19:20:57 UTC

[GitHub] [spark] ueshin commented on a diff in pull request #40800: [SPARK-43146][CONNECT][PYTHON] Implement eager evaluation for __repr__ and _repr_html_

ueshin commented on code in PR #40800:
URL: https://github.com/apache/spark/pull/40800#discussion_r1168005573


##########
python/pyspark/sql/connect/plan.py:
##########
@@ -387,6 +387,30 @@ def plan(self, session: "SparkConnectClient") -> proto.Relation:
         return plan
 
 
+class EagerEvalString(LogicalPlan):
+    def __init__(self, child: Optional["LogicalPlan"], format: str) -> None:
+        super().__init__(child)
+        self._format = format
+
+    def plan(self, session: "SparkConnectClient") -> proto.Relation:
+        assert self._child is not None
+        plan = self._create_proto_relation()
+        plan.eager_eval_string.input.CopyFrom(self._child.plan(session))
+        if self._format == "show_string":
+            plan.eager_eval_string.format = proto.EagerEvalString.Format.FORMAT_SHOW_STRING
+        elif self._format == "html_string":
+            plan.eager_eval_string.format = proto.EagerEvalString.Format.FORMAT_HTML_STRING
+        else:
+            raise NotImplementedError(
+                """
+                Unsupported format: %s. Supported join types include:

Review Comment:
   Good catch. I forgot to update it.



-- 
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-unsubscribe@spark.apache.org

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


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