github-actions[bot] commented on code in PR #24864:
URL: https://github.com/apache/doris/pull/24864#discussion_r1335587990


##########
be/src/exec/es/es_scroll_parser.cpp:
##########
@@ -187,21 +187,42 @@ Status get_int_value(const rapidjson::Value& col, 
PrimitiveType type, void* slot
 
 template <typename T, typename RT>
 Status get_date_value_int(const rapidjson::Value& col, PrimitiveType type, 
bool is_date_str,
-                          RT* slot) {
+                          RT* slot, const std::string& time_zone) {
     constexpr bool is_datetime_v1 = std::is_same_v<T, 
vectorized::VecDateTimeValue>;
     T dt_val;
     if (is_date_str) {
         const std::string str_date = col.GetString();
         int str_length = col.GetStringLength();
         bool success = false;
-        // YYYY-MM-DDTHH:MM:SSZ or YYYY-MM-DDTHH:MM:SS+08:00 or 
2022-08-08T12:10:10.000Z
         if (str_length > 19) {
             std::chrono::system_clock::time_point tp;
-            const bool ok =
-                    cctz::parse("%Y-%m-%dT%H:%M:%E*S%Ez", str_date, 
cctz::utc_time_zone(), &tp);
+            // time_zone suffix pattern
+            // Z/+08:00/-04:30
+            std::regex time_zone_pattern(R"([+-]\d{2}:\d{2}|Z)");
+            std::smatch time_zone_match;

Review Comment:
   warning: variable 'time_zone_match' is not initialized 
[cppcoreguidelines-init-variables]
   
   ```suggestion
               std::smatch time_zone_match = 0;
   ```
   



##########
be/src/exec/es/es_scroll_parser.cpp:
##########
@@ -187,21 +187,42 @@ Status get_int_value(const rapidjson::Value& col, 
PrimitiveType type, void* slot
 
 template <typename T, typename RT>
 Status get_date_value_int(const rapidjson::Value& col, PrimitiveType type, 
bool is_date_str,
-                          RT* slot) {
+                          RT* slot, const std::string& time_zone) {
     constexpr bool is_datetime_v1 = std::is_same_v<T, 
vectorized::VecDateTimeValue>;
     T dt_val;
     if (is_date_str) {
         const std::string str_date = col.GetString();
         int str_length = col.GetStringLength();
         bool success = false;
-        // YYYY-MM-DDTHH:MM:SSZ or YYYY-MM-DDTHH:MM:SS+08:00 or 
2022-08-08T12:10:10.000Z
         if (str_length > 19) {
             std::chrono::system_clock::time_point tp;
-            const bool ok =
-                    cctz::parse("%Y-%m-%dT%H:%M:%E*S%Ez", str_date, 
cctz::utc_time_zone(), &tp);
+            // time_zone suffix pattern
+            // Z/+08:00/-04:30
+            std::regex time_zone_pattern(R"([+-]\d{2}:\d{2}|Z)");
+            std::smatch time_zone_match;
+            bool ok = false;
+            std::string fmt;

Review Comment:
   warning: variable 'fmt' is not initialized [cppcoreguidelines-init-variables]
   
   ```suggestion
               std::string fmt = 0;
   ```
   



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to