morningman commented on a change in pull request #2718: [Insert] Return more 
info of insert operation
URL: https://github.com/apache/incubator-doris/pull/2718#discussion_r366345023
 
 

 ##########
 File path: fe/src/main/java/org/apache/doris/analysis/ShowTransactionStmt.java
 ##########
 @@ -0,0 +1,151 @@
+// 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.doris.analysis;
+
+import org.apache.doris.analysis.BinaryPredicate.Operator;
+import org.apache.doris.catalog.Column;
+import org.apache.doris.catalog.ScalarType;
+import org.apache.doris.cluster.ClusterNamespace;
+import org.apache.doris.common.AnalysisException;
+import org.apache.doris.common.ErrorCode;
+import org.apache.doris.common.ErrorReport;
+import org.apache.doris.common.UserException;
+import org.apache.doris.common.proc.TransProcDir;
+import org.apache.doris.qe.ShowResultSetMetaData;
+
+import com.google.common.base.Strings;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+// syntax:
+//      SHOW TRANSACTION  WHERE id=123
+public class ShowTransactionStmt extends ShowStmt {
+    private static final Logger LOG = 
LogManager.getLogger(ShowTransactionStmt.class);
+
+    private String dbName;
+    private Expr whereClause;
+    private long txnId;
+
+    public ShowTransactionStmt(String dbName, Expr whereClause) {
+        this.dbName = dbName;
+        this.whereClause = whereClause;
+    }
+
+    public String getDbName() {
+        return dbName;
+    }
+
+    public long getTxnId() {
+        return txnId;
+    }
+
+    @Override
+    public void analyze(Analyzer analyzer) throws AnalysisException, 
UserException {
+        super.analyze(analyzer);
+
+        if (Strings.isNullOrEmpty(dbName)) {
+            dbName = analyzer.getDefaultDb();
+            if (Strings.isNullOrEmpty(dbName)) {
+                ErrorReport.reportAnalysisException(ErrorCode.ERR_NO_DB_ERROR);
+            }
+        } else {
+            dbName = ClusterNamespace.getFullName(getClusterName(), dbName);
+        }
+
+        if (whereClause == null) {
+            throw new AnalysisException("Missing transaction id");
+        }
+
+        analyzeSubPredicate(whereClause);
+    }
+
+    private void analyzeSubPredicate(Expr subExpr) throws AnalysisException {
 
 Review comment:
   ok

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to