morningman opened a new issue #3309: [Bug] errCode = 2, detailMessage = errCode 
= 2, detailMessage = date literal [2020-03-06] is invalid
URL: https://github.com/apache/incubator-doris/issues/3309
 
 
   **Describe the bug**
   Error thrown when executing load statement.
   
   **To Reproduce**
   
   ```
   CREATE TABLE `app_profile` (
     `event_date` date NOT NULL COMMENT "",
     `app_name` varchar(64) NOT NULL COMMENT "",
     `package_name` varchar(64) NOT NULL COMMENT "",
     `age` varchar(32) NOT NULL COMMENT "",
     `gender` varchar(32) NOT NULL COMMENT "",
     `level` varchar(64) NOT NULL COMMENT "",
     `city` varchar(64) NOT NULL COMMENT "",
     `model` varchar(64) NOT NULL COMMENT "",
     `brand` varchar(64) NOT NULL COMMENT "",
     `hours` varchar(16) NOT NULL COMMENT "",
     `use_num` int(11) SUM NOT NULL COMMENT "",
     `use_time` double SUM NOT NULL COMMENT "",
     `start_times` bigint(20) SUM NOT NULL COMMENT ""
   ) ENGINE=OLAP
   AGGREGATE KEY(`event_date`, `app_name`, `package_name`, `age`, `gender`, 
`level`, `city`, `model`, `brand`, `hours`)
   COMMENT "OLAP"
   PARTITION BY RANGE(`event_date`)
   (PARTITION p_20200301 VALUES [('2020-02-27'), ('2020-03-02')),
   PARTITION p_20200306 VALUES [('2020-03-02'), ('2020-03-07')))
   DISTRIBUTED BY HASH(`event_date`, `app_name`, `package_name`, `age`, 
`gender`, `level`, `city`, `model`, `brand`, `hours`) BUCKETS 32
   PROPERTIES (
    "replication_num" = "1"
   );
   
   load label db1.app_profile_20200306 ( DATA INFILE('filexxx') INTO TABLE 
app_profile partition (p_20200306) COLUMNS TERMINATED BY '\t' 
(app_name,package_name,age,gender,level,city,model,brand,hours,use_num,use_time,start_times)
 SET ( event_date = default_value('2020-03-06') ) ) PROPERTIES ( 
'max_filter_ratio'='0.0001' );
   ```
   
   Sometimes it will throw:
   
   ```
   errCode = 2, detailMessage = errCode = 2, detailMessage = date literal 
[2020-03-06] is invalid
   ```
   
   **Why**
   
   This is because here:
   
   
https://github.com/apache/incubator-doris/blob/be090f5929c3ed866af9a8789b2008ae4dc7e921/fe/src/main/java/org/apache/doris/analysis/DateLiteral.java#L194
   
   the `if` clause return false, even if the `type` is truly `DATE`, but 
`equals()` will return true.
   
   I really do not know why, it should be return true by using `==`, because we 
never create the 
   new instance of `Type.DATE`, but to reference the static member in Type.

----------------------------------------------------------------
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