andygrove commented on code in PR #6082:
URL: https://github.com/apache/datafusion-comet/pull/6082#discussion_r4065645856


##########
spark/src/main/scala/org/apache/comet/rules/CometRule.scala:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+
+package org.apache.comet.rules
+
+import org.apache.spark.sql.SparkSession
+import org.apache.spark.sql.catalyst.rules.Rule
+import org.apache.spark.sql.execution.SparkPlan
+
+/**
+ * Comet's plan conversion pass: scan conversion followed by operator 
conversion.
+ *
+ * The two were previously registered as separate rules, adjacently, in both 
the columnar and the
+ * query-stage-prep paths. Nothing ever ran between them, and neither is 
useful on its own -
+ * [[CometExecRule]] seeds its native chain only from the nodes 
[[CometScanRule]] produces
+ * (`CometScanExec`, `CometBatchScanExec`, `CometContribScanMarker`), so 
operator conversion
+ * against unconverted Spark scans converts nothing. Composing them here makes 
that ordering an
+ * invariant of the code rather than of the registration order, and gives 
callers that need the
+ * whole conversion - rather than half of it - a single entry point.
+ *
+ * The two rules keep their own classes, files and tests; this only fixes how 
they are sequenced.
+ * `ruleName` in `spark.comet.explain.transformations` output is still each 
inner rule's own,
+ * since this delegates to their `apply`.

Review Comment:
   Fixed, thanks — you're right on all three. Took your suggestion nearly 
verbatim for the first paragraph, and dropped the archaeology.
   
   On the plan change log: I checked, and it's only the query-stage-prep 
registration that gets a per-rule entry. In the non-AQE columnar path 
`ApplyColumnarRulesAndInsertTransitions` is itself the logged rule and the 
columnar rules inside it are never named, so the old names never appeared there 
to begin with. The docstring now says query-stage preparation logs this pass as 
`org.apache.comet.rules.CometRule`, and I've added a section to the PR 
description calling out that anyone filtering `spark.sql.planChangeLog.rules` 
on either old name has to switch.



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