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 ed9c70b  [Bug] Fix bug of create ODBC table first column is float or 
double, issue#5350 (#5351)
ed9c70b is described below

commit ed9c70bdb9c8c4aed7127b0e04edef74f977f5db
Author: HappenLee <[email protected]>
AuthorDate: Thu Feb 4 09:32:53 2021 +0800

    [Bug] Fix bug of create ODBC table first column is float or double, 
issue#5350 (#5351)
---
 .../src/main/java/org/apache/doris/analysis/CreateTableStmt.java      | 4 ++--
 fe/fe-core/src/test/java/org/apache/doris/planner/QueryPlanTest.java  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/analysis/CreateTableStmt.java 
b/fe/fe-core/src/main/java/org/apache/doris/analysis/CreateTableStmt.java
index 23f5636..46d0098 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/CreateTableStmt.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/CreateTableStmt.java
@@ -259,7 +259,7 @@ public class CreateTableStmt extends DdlStmt {
             throw new AnalysisException("Spark Load from hive table is coming 
soon");
         }
         // analyze key desc
-        if (!(engineName.equals("mysql") || engineName.equals("broker") || 
engineName.equals("hive"))) {
+        if (engineName.equalsIgnoreCase("olap")) {
             // olap table
             if (keysDesc == null) {
                 List<String> keysColumnNames = Lists.newArrayList();
@@ -301,7 +301,7 @@ public class CreateTableStmt extends DdlStmt {
                     // The OLAP table must has at least one short key and the 
float and double should not be short key.
                     // So the float and double could not be the first column 
in OLAP table.
                     if (keysColumnNames.isEmpty()) {
-                        throw new AnalysisException("The first column could 
not be float or double,"
+                        throw new AnalysisException("The olap table first 
column could not be float or double,"
                                 + " use decimal instead.");
                     }
                     keysDesc = new KeysDesc(KeysType.DUP_KEYS, 
keysColumnNames);
diff --git 
a/fe/fe-core/src/test/java/org/apache/doris/planner/QueryPlanTest.java 
b/fe/fe-core/src/test/java/org/apache/doris/planner/QueryPlanTest.java
index 576cae0..f66c9be 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/planner/QueryPlanTest.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/planner/QueryPlanTest.java
@@ -361,7 +361,7 @@ public class QueryPlanTest {
                 ");");
 
         createTable("create external table test.odbc_oracle\n" +
-                "(k1 int, k2 int)\n" +
+                "(k1 float, k2 int)\n" +
                 "ENGINE=ODBC\n" +
                 "PROPERTIES (\n" +
                 "\"host\" = \"127.0.0.1\",\n" +


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

Reply via email to