You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2020/08/13 15:39:15 UTC

[incubator-doris] branch master updated: [SQL]Support datagrip show database information (#4332)

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

morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git


The following commit(s) were added to refs/heads/master by this push:
     new ac9c774  [SQL]Support datagrip show database information (#4332)
ac9c774 is described below

commit ac9c7741e9e8104b99f7c4bcc78d452201634b71
Author: xueyan.li <as...@163.com>
AuthorDate: Thu Aug 13 23:39:05 2020 +0800

    [SQL]Support datagrip show database information (#4332)
    
    Support show schema()
---
 fe/fe-core/src/main/cup/sql_parser.cup                                  | 2 ++
 .../src/main/java/org/apache/doris/analysis/InformationFunction.java    | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/fe/fe-core/src/main/cup/sql_parser.cup b/fe/fe-core/src/main/cup/sql_parser.cup
index 4e4e028..cd4ea3c 100644
--- a/fe/fe-core/src/main/cup/sql_parser.cup
+++ b/fe/fe-core/src/main/cup/sql_parser.cup
@@ -3933,6 +3933,8 @@ non_pred_expr ::=
   {: RESULT = new FunctionCallExpr(new FunctionName(null, id), params); :}
   | KW_DATABASE LPAREN RPAREN
   {: RESULT = new InformationFunction("DATABASE"); :}
+  | KW_SCHEMA LPAREN RPAREN
+  {: RESULT = new InformationFunction("SCHEMA"); :}
   | KW_USER LPAREN RPAREN
   {: RESULT = new InformationFunction("USER"); :}
   | KW_CURRENT_USER LPAREN RPAREN
diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/InformationFunction.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/InformationFunction.java
index 5d27188..0550abe 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/InformationFunction.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/InformationFunction.java
@@ -48,7 +48,7 @@ public class InformationFunction extends Expr {
 
     @Override
     protected void analyzeImpl(Analyzer analyzer) throws AnalysisException {
-        if (funcType.equalsIgnoreCase("DATABASE")) {
+        if (funcType.equalsIgnoreCase("DATABASE") || funcType.equalsIgnoreCase("SCHEMA")) {
             type = Type.VARCHAR;
             strValue = analyzer.getDefaultDb();
         } else if (funcType.equalsIgnoreCase("USER")) {


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