-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Closed
Labels
kind/fixCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.
Description
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:
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.
Metadata
Metadata
Assignees
Labels
kind/fixCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.