gengliangwang commented on code in PR #57178:
URL: https://github.com/apache/spark/pull/57178#discussion_r3556330986


##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/logical/V2CommandTreePatternSuite.scala:
##########
@@ -0,0 +1,56 @@
+/*
+ * 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.spark.sql.catalyst.plans.logical
+
+import org.apache.spark.SparkFunSuite
+import org.apache.spark.sql.catalyst.dsl.expressions._
+import org.apache.spark.sql.catalyst.expressions.Literal
+import org.apache.spark.sql.catalyst.trees.TreePattern
+
+/**
+ * Pins the tree-pattern identity contract for the DSv2 row-level command 
nodes: each node carries
+ * both the shared `COMMAND` bit and its own identity bit, so rules can prune 
on either.
+ */
+class V2CommandTreePatternSuite extends SparkFunSuite {

Review Comment:
   This suite pins the `COMMAND` + identity-bit contract for 3 of the 5 command 
nodes the PR touches — `ReplaceData` and `WriteDelta` are missing. Their 
`REPLACE_DATA`/`WRITE_DELTA` bits are the most load-bearing in the PR: 
`GroupBasedRowLevelOperationScanPlanning`, 
`OptimizeMetadataOnlyDeleteFromTable`, and 
`RowLevelOperationRuntimeGroupFiltering` all prune exclusively on them, so a 
wrong bit there would silently disable those rules with no unit-level signal. 
Worth adding two cases here; the `nodePatternsInternal()` overrides return 
compile-time constants, so a minimal instance pins the bit without needing 
resolution.
   
   (Relatedly, the PR description's "asserts each command node carries both 
`COMMAND` and its own bit" reads as all five — worth adjusting to match the 
actual coverage.)



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