You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2021/09/30 15:01:05 UTC

[GitHub] [hive] ashish-kumar-sharma opened a new pull request #2690: HIVE-25576: Raise exception instead of silent change for new DateTimeformatter

ashish-kumar-sharma opened a new pull request #2690:
URL: https://github.com/apache/hive/pull/2690


   …formatter
   
   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://cwiki.apache.org/confluence/display/Hive/HowToContribute
     2. Ensure that you have created an issue on the Hive project JIRA: https://issues.apache.org/jira/projects/HIVE/summary
     3. Ensure you have added or run the appropriate tests for your PR: 
     4. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP]HIVE-XXXXX:  Your PR title ...'.
     5. Be sure to keep the PR description updated to reflect all changes.
     6. Please write your PR title to summarize what this PR proposes.
     7. If possible, provide a concise example to reproduce the issue for a faster review.
   
   -->
   
   ### What changes were proposed in this pull request?
   <!--
   Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue. 
   If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
     1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
     2. If you fix some SQL features, you can provide some references of other DBMSes.
     3. If there is design documentation, please add the link.
     4. If there is a discussion in the mailing list, please add the link.
   -->
   
   
   ### Why are the changes needed?
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   
   
   ### Does this PR introduce _any_ user-facing change?
   <!--
   Note that it means *any* user-facing change including all aspects such as the documentation fix.
   If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description, screenshot and/or a reproducable example to show the behavior difference if possible.
   If possible, please also clarify if this is a user-facing change compared to the released Hive versions or within the unreleased branches such as master.
   If no, write 'No'.
   -->
   
   
   ### How was this patch tested?
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   -->
   


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] zabetak commented on pull request #2690: HIVE-25576: Add config to parse date with older date format

Posted by GitBox <gi...@apache.org>.
zabetak commented on pull request #2690:
URL: https://github.com/apache/hive/pull/2690#issuecomment-993349113


   Apologies for the delay @ashish-kumar-sharma , I will try to rearrange this on my TODO list. 


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] zabetak commented on pull request #2690: HIVE-25576: Add config to parse date with older date format

Posted by GitBox <gi...@apache.org>.
zabetak commented on pull request #2690:
URL: https://github.com/apache/hive/pull/2690#issuecomment-1038843062


   Please bot keep this open :)


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] zabetak commented on a change in pull request #2690: HIVE-25576: Add config to parse date with older date format

Posted by GitBox <gi...@apache.org>.
zabetak commented on a change in pull request #2690:
URL: https://github.com/apache/hive/pull/2690#discussion_r728036705



##########
File path: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
##########
@@ -3711,6 +3711,11 @@ private static void populateLlapDaemonVarsSet(Set<String> llapDaemonVarsSetLocal
         "1800s", new TimeValidator(TimeUnit.SECONDS),
         "Interval to synchronize privileges from external authorizer periodically in HS2"),
 
+    HIVE_LEGACY_TIMEPARSER_POLICY("hive.legacy.timeparser.policy", false,

Review comment:
       How about renaming to `hive.datetime.formatter.legacy.enabled`? That way we create a `hive.datetime` namespace which we can use for other props in the future.

##########
File path: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
##########
@@ -3711,6 +3711,11 @@ private static void populateLlapDaemonVarsSet(Set<String> llapDaemonVarsSetLocal
         "1800s", new TimeValidator(TimeUnit.SECONDS),
         "Interval to synchronize privileges from external authorizer periodically in HS2"),
 
+    HIVE_LEGACY_TIMEPARSER_POLICY("hive.legacy.timeparser.policy", false,

Review comment:
       One thing that I am a bit skeptical about is that when I search for `SimpleDateFormat` or `DateTimeFormatter` in the repo I find occurrences in various places (including other UDFs). I am wondering what should we do with the other parts using new/old formatters. The current description of the property makes me believe that it has a kind of global effect but in this PR we are only touching the Unix timestamp UDFs.

##########
File path: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
##########
@@ -3711,6 +3711,11 @@ private static void populateLlapDaemonVarsSet(Set<String> llapDaemonVarsSetLocal
         "1800s", new TimeValidator(TimeUnit.SECONDS),
         "Interval to synchronize privileges from external authorizer periodically in HS2"),
 
+    HIVE_LEGACY_TIMEPARSER_POLICY("hive.legacy.timeparser.policy", false,
+        "When true, java.text.SimpleDateFormat is used for formatting and parsing\n"
+            + "dates/timestamps in a locale-sensitive manner, which is the approach before Hive 3.x.\n"
+            + "When set to false, classes from java.time.* packages are used for the same purpose.\n"
+            + "The default value is false, RuntimeException is thrown when we will get different results."),

Review comment:
       Do we throw an exception? I don't think so.




-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] ashish-kumar-sharma edited a comment on pull request #2690: HIVE-25576: Add config to parse date with older date format

Posted by GitBox <gi...@apache.org>.
ashish-kumar-sharma edited a comment on pull request #2690:
URL: https://github.com/apache/hive/pull/2690#issuecomment-942235815


   @zabetak Could you please review the PR?


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] ashish-kumar-sharma commented on pull request #2690: HIVE-25576: Raise exception instead of silent change for new DateTimeformatter

Posted by GitBox <gi...@apache.org>.
ashish-kumar-sharma commented on pull request #2690:
URL: https://github.com/apache/hive/pull/2690#issuecomment-934037741


   @zabetak @sankarh  Could guys please review the PR?


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] ashish-kumar-sharma commented on pull request #2690: HIVE-25576: Add config to parse date with older date format

Posted by GitBox <gi...@apache.org>.
ashish-kumar-sharma commented on pull request #2690:
URL: https://github.com/apache/hive/pull/2690#issuecomment-942438192


   > Hey @ashish-kumar-sharma , I just did a quick pass to get the general idea. I hope I find some time to do a proper review next week.
   
   Sure I will wait for your review.


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] zabetak commented on a change in pull request #2690: HIVE-25576: Add config to parse date with older date format

Posted by GitBox <gi...@apache.org>.
zabetak commented on a change in pull request #2690:
URL: https://github.com/apache/hive/pull/2690#discussion_r728036705



##########
File path: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
##########
@@ -3711,6 +3711,11 @@ private static void populateLlapDaemonVarsSet(Set<String> llapDaemonVarsSetLocal
         "1800s", new TimeValidator(TimeUnit.SECONDS),
         "Interval to synchronize privileges from external authorizer periodically in HS2"),
 
+    HIVE_LEGACY_TIMEPARSER_POLICY("hive.legacy.timeparser.policy", false,

Review comment:
       How about renaming to `hive.datetime.formatter.legacy.enabled`? That way we create a `hive.datetime` namespace which we can use for other props in the future.

##########
File path: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
##########
@@ -3711,6 +3711,11 @@ private static void populateLlapDaemonVarsSet(Set<String> llapDaemonVarsSetLocal
         "1800s", new TimeValidator(TimeUnit.SECONDS),
         "Interval to synchronize privileges from external authorizer periodically in HS2"),
 
+    HIVE_LEGACY_TIMEPARSER_POLICY("hive.legacy.timeparser.policy", false,

Review comment:
       One thing that I am a bit skeptical about is that when I search for `SimpleDateFormat` or `DateTimeFormatter` in the repo I find occurrences in various places (including other UDFs). I am wondering what should we do with the other parts using new/old formatters. The current description of the property makes me believe that it has a kind of global effect but in this PR we are only touching the Unix timestamp UDFs.

##########
File path: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
##########
@@ -3711,6 +3711,11 @@ private static void populateLlapDaemonVarsSet(Set<String> llapDaemonVarsSetLocal
         "1800s", new TimeValidator(TimeUnit.SECONDS),
         "Interval to synchronize privileges from external authorizer periodically in HS2"),
 
+    HIVE_LEGACY_TIMEPARSER_POLICY("hive.legacy.timeparser.policy", false,
+        "When true, java.text.SimpleDateFormat is used for formatting and parsing\n"
+            + "dates/timestamps in a locale-sensitive manner, which is the approach before Hive 3.x.\n"
+            + "When set to false, classes from java.time.* packages are used for the same purpose.\n"
+            + "The default value is false, RuntimeException is thrown when we will get different results."),

Review comment:
       Do we throw an exception? I don't think so.




-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] github-actions[bot] commented on pull request #2690: HIVE-25576: Add config to parse date with older date format

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #2690:
URL: https://github.com/apache/hive/pull/2690#issuecomment-1037602311


   This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
   Feel free to reach out on the dev@hive.apache.org list if the patch is in need of reviews.


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] github-actions[bot] commented on pull request #2690: HIVE-25576: Add config to parse date with older date format

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #2690:
URL: https://github.com/apache/hive/pull/2690#issuecomment-992000258


   This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
   Feel free to reach out on the dev@hive.apache.org list if the patch is in need of reviews.


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] ashish-kumar-sharma commented on a change in pull request #2690: HIVE-25576: Add config to parse date with older date format

Posted by GitBox <gi...@apache.org>.
ashish-kumar-sharma commented on a change in pull request #2690:
URL: https://github.com/apache/hive/pull/2690#discussion_r728209617



##########
File path: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
##########
@@ -3711,6 +3711,11 @@ private static void populateLlapDaemonVarsSet(Set<String> llapDaemonVarsSetLocal
         "1800s", new TimeValidator(TimeUnit.SECONDS),
         "Interval to synchronize privileges from external authorizer periodically in HS2"),
 
+    HIVE_LEGACY_TIMEPARSER_POLICY("hive.legacy.timeparser.policy", false,

Review comment:
       Yes you are right. There are lot of UDF which required changes. That i will do in incremental fashion. Since Unix timestamp UDFs are logical start. That's why this PR only contain Unix timestamp UDFs. I will create subtask for UDF as well. 




-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] ashish-kumar-sharma commented on pull request #2690: HIVE-25576: Add config to parse date with older date format

Posted by GitBox <gi...@apache.org>.
ashish-kumar-sharma commented on pull request #2690:
URL: https://github.com/apache/hive/pull/2690#issuecomment-942235815






-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] ashish-kumar-sharma commented on a change in pull request #2690: HIVE-25576: Add config to parse date with older date format

Posted by GitBox <gi...@apache.org>.
ashish-kumar-sharma commented on a change in pull request #2690:
URL: https://github.com/apache/hive/pull/2690#discussion_r728209617



##########
File path: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
##########
@@ -3711,6 +3711,11 @@ private static void populateLlapDaemonVarsSet(Set<String> llapDaemonVarsSetLocal
         "1800s", new TimeValidator(TimeUnit.SECONDS),
         "Interval to synchronize privileges from external authorizer periodically in HS2"),
 
+    HIVE_LEGACY_TIMEPARSER_POLICY("hive.legacy.timeparser.policy", false,

Review comment:
       Yes you are right. There are lot of UDF which required changes. That i will do in incremental fashion. Since Unix timestamp UDFs are logical start. That's why this PR only contain Unix timestamp UDFs. I will create subtask for UDF as well. 




-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] ashish-kumar-sharma commented on pull request #2690: HIVE-25576: Add config to parse date with older date format

Posted by GitBox <gi...@apache.org>.
ashish-kumar-sharma commented on pull request #2690:
URL: https://github.com/apache/hive/pull/2690#issuecomment-942235815


   @zabetak Could please review the PR?


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] ashish-kumar-sharma edited a comment on pull request #2690: HIVE-25576: Add config to parse date with older date format

Posted by GitBox <gi...@apache.org>.
ashish-kumar-sharma edited a comment on pull request #2690:
URL: https://github.com/apache/hive/pull/2690#issuecomment-942235815


   @zabetak Could you please review the PR?


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] github-actions[bot] commented on pull request #2690: HIVE-25576: Add config to parse date with older date format

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #2690:
URL: https://github.com/apache/hive/pull/2690#issuecomment-1037602311


   This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
   Feel free to reach out on the dev@hive.apache.org list if the patch is in need of reviews.


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org