This is an automated email from the ASF dual-hosted git repository.

philo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-gluten.git


The following commit(s) were added to refs/heads/main by this push:
     new 0825c3e8c2 [GLUTEN-10482] Improve `collectAttributeNamesDFS` to avoid 
repeated check calls (#10483)
0825c3e8c2 is described below

commit 0825c3e8c221516c13ebec31da8b690a739f4809
Author: Jiaan Geng <[email protected]>
AuthorDate: Tue Aug 19 17:14:25 2025 +0800

    [GLUTEN-10482] Improve `collectAttributeNamesDFS` to avoid repeated check 
calls (#10483)
---
 .../org/apache/gluten/expression/ConverterUtils.scala  | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git 
a/gluten-substrait/src/main/scala/org/apache/gluten/expression/ConverterUtils.scala
 
b/gluten-substrait/src/main/scala/org/apache/gluten/expression/ConverterUtils.scala
index 4dce9858d4..5a9602898d 100644
--- 
a/gluten-substrait/src/main/scala/org/apache/gluten/expression/ConverterUtils.scala
+++ 
b/gluten-substrait/src/main/scala/org/apache/gluten/expression/ConverterUtils.scala
@@ -111,20 +111,22 @@ object ConverterUtils extends Logging {
 
   private def collectAttributeNamesDFS(attributes: Seq[Attribute])(
       f: Attribute => String): JList[String] = {
-    val nameList = new JArrayList[String]()
-    attributes.foreach(
-      attr => {
-        nameList.add(f(attr))
-        if (BackendsApiManager.getSettings.supportStructType()) {
+    if (BackendsApiManager.getSettings.supportStructType()) {
+      val nameList = new JArrayList[String]()
+      attributes.foreach {
+        attr =>
+          nameList.add(f(attr))
           attr.dataType match {
             case struct: StructType =>
               val nestedNames = collectStructFieldNames(struct)
               nameList.addAll(nestedNames)
             case _ =>
           }
-        }
-      })
-    nameList
+      }
+      nameList
+    } else {
+      attributes.map(f(_)).asJava
+    }
   }
 
   def collectStructFieldNames(dataType: DataType): JList[String] = {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to