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
commit 7d63b5d1c99a0bc81d6a8869e73bec5945aeb1ec Author: Beyyes <[email protected]> AuthorDate: Wed May 22 10:43:04 2024 +0800 Revert "add expression temp impl" This reverts commit f1d2cce85301d744615a153711330ca91f9307e5. --- .../relational/planner/ir/RewritingVisitor.java | 19 ---------- .../relational/planner/ir/SerializeVisitor.java | 3 -- iotdb-core/relational-parser/pom.xml | 6 ---- .../relational/sql/tree/ComparisonExpression.java | 16 --------- .../iotdb/db/relational/sql/tree/Expression.java | 40 ---------------------- .../relational/sql/tree/TableExpressionType.java | 34 ------------------ 6 files changed, 118 deletions(-) diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/ir/RewritingVisitor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/ir/RewritingVisitor.java index 6fbe7493c81..64a87fa7bf7 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/ir/RewritingVisitor.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/ir/RewritingVisitor.java @@ -1,22 +1,3 @@ -/* - * 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.iotdb.db.queryengine.plan.relational.planner.ir; import org.apache.iotdb.db.relational.sql.tree.ArithmeticBinaryExpression; diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/ir/SerializeVisitor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/ir/SerializeVisitor.java deleted file mode 100644 index 2ab295c11cb..00000000000 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/ir/SerializeVisitor.java +++ /dev/null @@ -1,3 +0,0 @@ -package org.apache.iotdb.db.queryengine.plan.relational.planner.ir; - -public class SerializeVisitor {} diff --git a/iotdb-core/relational-parser/pom.xml b/iotdb-core/relational-parser/pom.xml index 8257f4551e9..e65d4eb10c0 100644 --- a/iotdb-core/relational-parser/pom.xml +++ b/iotdb-core/relational-parser/pom.xml @@ -56,11 +56,5 @@ <artifactId>iotdb-relational-grammar</artifactId> <version>1.3.2-SNAPSHOT</version> </dependency> - <dependency> - <groupId>org.apache.iotdb</groupId> - <artifactId>tsfile</artifactId> - <version>1.3.2-SNAPSHOT</version> - <scope>compile</scope> - </dependency> </dependencies> </project> diff --git a/iotdb-core/relational-parser/src/main/java/org/apache/iotdb/db/relational/sql/tree/ComparisonExpression.java b/iotdb-core/relational-parser/src/main/java/org/apache/iotdb/db/relational/sql/tree/ComparisonExpression.java index 3c55d8a6c62..f5a264ed786 100644 --- a/iotdb-core/relational-parser/src/main/java/org/apache/iotdb/db/relational/sql/tree/ComparisonExpression.java +++ b/iotdb-core/relational-parser/src/main/java/org/apache/iotdb/db/relational/sql/tree/ComparisonExpression.java @@ -19,14 +19,10 @@ package org.apache.iotdb.db.relational.sql.tree; -import org.apache.iotdb.tsfile.utils.ReadWriteIOUtils; - import com.google.common.collect.ImmutableList; import javax.annotation.Nonnull; -import java.io.DataOutputStream; -import java.nio.ByteBuffer; import java.util.List; import java.util.Objects; @@ -172,16 +168,4 @@ public class ComparisonExpression extends Expression { return operator == ((ComparisonExpression) other).operator; } - - // =============== serialize ================= - protected void serialize(DataOutputStream stream) { - // stream.write(); - } - - public ComparisonExpression(ByteBuffer byteBuffer) { - super(null); - operator = Operator.values()[ReadWriteIOUtils.readInt(byteBuffer)]; - left = null; - right = null; - } } diff --git a/iotdb-core/relational-parser/src/main/java/org/apache/iotdb/db/relational/sql/tree/Expression.java b/iotdb-core/relational-parser/src/main/java/org/apache/iotdb/db/relational/sql/tree/Expression.java index bcd5916e0bd..29ab6b83674 100644 --- a/iotdb-core/relational-parser/src/main/java/org/apache/iotdb/db/relational/sql/tree/Expression.java +++ b/iotdb-core/relational-parser/src/main/java/org/apache/iotdb/db/relational/sql/tree/Expression.java @@ -20,14 +20,9 @@ package org.apache.iotdb.db.relational.sql.tree; import org.apache.iotdb.db.relational.sql.util.ExpressionFormatter; -import org.apache.iotdb.tsfile.utils.ReadWriteIOUtils; import javax.annotation.Nullable; -import java.io.DataOutputStream; -import java.io.IOException; -import java.nio.ByteBuffer; - public abstract class Expression extends Node { protected Expression(@Nullable NodeLocation location) { @@ -44,39 +39,4 @@ public abstract class Expression extends Node { public final String toString() { return ExpressionFormatter.formatExpression(this); } - - public TableExpressionType getExpressionType() { - return null; - } - - protected void serialize(ByteBuffer byteBuffer) {} - - protected void serialize(DataOutputStream stream) {} - - public static void serialize(Expression expression, ByteBuffer byteBuffer) { - ReadWriteIOUtils.write( - expression.getExpressionType().getExpressionTypeInShortEnum(), byteBuffer); - - expression.serialize(byteBuffer); - } - - public static void serialize(Expression expression, DataOutputStream stream) throws IOException { - ReadWriteIOUtils.write(expression.getExpressionType().getExpressionTypeInShortEnum(), stream); - expression.serialize(stream); - } - - public static Expression deserialize(ByteBuffer byteBuffer) { - short type = ReadWriteIOUtils.readShort(byteBuffer); - - Expression expression; - switch (type) { - case 0: - expression = new ComparisonExpression(byteBuffer); - break; - default: - throw new IllegalArgumentException("Invalid expression type: " + type); - } - - return expression; - } } diff --git a/iotdb-core/relational-parser/src/main/java/org/apache/iotdb/db/relational/sql/tree/TableExpressionType.java b/iotdb-core/relational-parser/src/main/java/org/apache/iotdb/db/relational/sql/tree/TableExpressionType.java deleted file mode 100644 index ed3b6ff420c..00000000000 --- a/iotdb-core/relational-parser/src/main/java/org/apache/iotdb/db/relational/sql/tree/TableExpressionType.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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.iotdb.db.relational.sql.tree; - -public enum TableExpressionType { - LITERAL((short) 1); - - TableExpressionType(short type) { - this.type = type; - } - - private final short type; - - public short getExpressionTypeInShortEnum() { - return type; - } -}
