comphead commented on code in PR #4086:
URL: https://github.com/apache/datafusion-comet/pull/4086#discussion_r3150599123


##########
docs/source/user-guide/latest/understanding-comet-plans.md:
##########
@@ -0,0 +1,232 @@
+<!---
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+# Understanding Comet Plans
+
+This guide explains how to read a Spark query plan once Comet is enabled, what
+happens when parts of a plan fall back to Spark, and which configs to use to
+inspect that behavior.
+
+## Overview
+
+When Comet is enabled, the `CometSparkSessionExtensions` rules walk the
+physical plan bottom-up and replace Spark operators with Comet equivalents
+where possible. Consecutive native operators are combined into a single block
+that is serialized as protobuf and executed by DataFusion on the executor.
+Operators that Comet does not support remain as their original Spark form.
+
+As a result, a plan can mix three kinds of nodes:
+
+- **`Comet*` nodes** that run natively in Rust (for example `CometProject`,
+  `CometHashAggregate`).
+- **`Comet*` nodes that run on the JVM** but are still part of the Comet
+  pipeline (for example `CometBroadcastExchange`, `CometColumnarExchange`).
+- **Standard Spark nodes** (for example `Project`, `HashAggregate`) where
+  Comet either does not support the operator or has fallen back due to an
+  unsupported expression, data type, or configuration.
+
+Wherever data crosses between columnar and row-based execution, Comet inserts
+a transition node such as `CometColumnarToRow` or `CometSparkRowToColumnar`.
+
+## Reading a Plan
+
+You can print a plan with `df.explain(true)` or `EXPLAIN FORMATTED <sql>`, and

Review Comment:
   ```suggestion
   You can print a plan with `df.explain("formatted")` or `EXPLAIN FORMATTED 
<sql>`, and
   ```
   
   to be the same



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

Reply via email to