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

caogaofei pushed a commit to branch ty/TableModelGrammar
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/ty/TableModelGrammar by this 
push:
     new e40d2d4a79b fix select coulmn with _ symbol
e40d2d4a79b is described below

commit e40d2d4a79b65341fccaf70ac5ab6014f83eac98
Author: Beyyes <[email protected]>
AuthorDate: Sat Apr 20 08:56:53 2024 +0800

    fix select coulmn with _ symbol
---
 .../plan/relational/planner/SymbolAllocator.java   | 25 ++++++++--------------
 1 file changed, 9 insertions(+), 16 deletions(-)

diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/SymbolAllocator.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/SymbolAllocator.java
index be6c360a5c4..96ce0ad30e7 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/SymbolAllocator.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/SymbolAllocator.java
@@ -18,11 +18,8 @@ import 
org.apache.iotdb.db.queryengine.plan.relational.analyzer.Field;
 import org.apache.iotdb.db.relational.sql.tree.Expression;
 import org.apache.iotdb.db.relational.sql.tree.FunctionCall;
 import org.apache.iotdb.db.relational.sql.tree.SymbolReference;
-import org.apache.iotdb.tsfile.read.common.type.LongType;
 import org.apache.iotdb.tsfile.read.common.type.Type;
 
-import com.google.common.primitives.Ints;
-
 import java.util.HashMap;
 import java.util.Map;
 
@@ -55,10 +52,6 @@ public class SymbolAllocator {
     return newSymbol(nameHint, type, null);
   }
 
-  public Symbol newHashSymbol() {
-    return newSymbol("$hashValue", LongType.getInstance());
-  }
-
   public Symbol newSymbol(String nameHint, Type type, String suffix) {
     requireNonNull(nameHint, "nameHint is null");
     requireNonNull(type, "type is null");
@@ -67,15 +60,15 @@ public class SymbolAllocator {
     nameHint = nameHint.toLowerCase(ENGLISH);
 
     // don't strip the tail if the only _ is the first character
-    int index = nameHint.lastIndexOf("_");
-    if (index > 0) {
-      String tail = nameHint.substring(index + 1);
-
-      // only strip if tail is numeric or _ is the last character
-      if (Ints.tryParse(tail) != null || index == nameHint.length() - 1) {
-        nameHint = nameHint.substring(0, index);
-      }
-    }
+    //    int index = nameHint.lastIndexOf("_");
+    //    if (index > 0) {
+    //      String tail = nameHint.substring(index + 1);
+    //
+    //      // only strip if tail is numeric or _ is the last character
+    //      if (Ints.tryParse(tail) != null || index == nameHint.length() - 1) 
{
+    //        nameHint = nameHint.substring(0, index);
+    //      }
+    //    }
 
     String unique = nameHint;
 

Reply via email to