[jira] [Resolved] (HIVE-25089) Move Materialized View rebuild code to AlterMaterializedViewRebuildAnalyzer

2021-05-06 Thread Krisztian Kasa (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-25089?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Krisztian Kasa resolved HIVE-25089.
---
Resolution: Fixed

Pushed to master. Thanks [~jcamachorodriguez] for review.

> Move Materialized View rebuild code to AlterMaterializedViewRebuildAnalyzer
> ---
>
> Key: HIVE-25089
> URL: https://issues.apache.org/jira/browse/HIVE-25089
> Project: Hive
>  Issue Type: Task
>  Components: Materialized views
>Reporter: Krisztian Kasa
>Assignee: Krisztian Kasa
>Priority: Minor
>  Labels: pull-request-available
>  Time Spent: 20m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-25089) Move Materialized View rebuild code to AlterMaterializedViewRebuildAnalyzer

2021-05-06 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-25089?focusedWorklogId=593150=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-593150
 ]

ASF GitHub Bot logged work on HIVE-25089:
-

Author: ASF GitHub Bot
Created on: 07/May/21 05:55
Start Date: 07/May/21 05:55
Worklog Time Spent: 10m 
  Work Description: kasakrisz merged pull request #2241:
URL: https://github.com/apache/hive/pull/2241


   


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


Issue Time Tracking
---

Worklog Id: (was: 593150)
Time Spent: 20m  (was: 10m)

> Move Materialized View rebuild code to AlterMaterializedViewRebuildAnalyzer
> ---
>
> Key: HIVE-25089
> URL: https://issues.apache.org/jira/browse/HIVE-25089
> Project: Hive
>  Issue Type: Task
>  Components: Materialized views
>Reporter: Krisztian Kasa
>Assignee: Krisztian Kasa
>Priority: Minor
>  Labels: pull-request-available
>  Time Spent: 20m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (HIVE-21563) Improve Table#getEmptyTable performance by disable registerAllFunctionsOnce

2021-05-06 Thread Chao Sun (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-21563?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chao Sun updated HIVE-21563:

Fix Version/s: 2.3.9

> Improve Table#getEmptyTable performance by disable registerAllFunctionsOnce
> ---
>
> Key: HIVE-21563
> URL: https://issues.apache.org/jira/browse/HIVE-21563
> Project: Hive
>  Issue Type: Improvement
>Reporter: Yuming Wang
>Assignee: Yuming Wang
>Priority: Major
>  Labels: pull-request-available
> Fix For: 2.3.9, 4.0.0
>
> Attachments: HIVE-21563.001.patch
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> We do not need registerAllFunctionsOnce when {{Table#getEmptyTable}}. The 
> stack trace:
> {noformat}
>   at 
> org.apache.hadoop.hive.ql.exec.Registry.registerGenericUDF(Registry.java:177)
>   at 
> org.apache.hadoop.hive.ql.exec.Registry.registerGenericUDF(Registry.java:170)
>   at 
> org.apache.hadoop.hive.ql.exec.FunctionRegistry.(FunctionRegistry.java:209)
>   at org.apache.hadoop.hive.ql.metadata.Hive.reloadFunctions(Hive.java:247)
>   at 
> org.apache.hadoop.hive.ql.metadata.Hive.registerAllFunctionsOnce(Hive.java:231)
>   at org.apache.hadoop.hive.ql.metadata.Hive.(Hive.java:388)
>   at org.apache.hadoop.hive.ql.metadata.Hive.create(Hive.java:332)
>   at org.apache.hadoop.hive.ql.metadata.Hive.getInternal(Hive.java:312)
>   at org.apache.hadoop.hive.ql.metadata.Hive.get(Hive.java:288)
>   at 
> org.apache.hadoop.hive.ql.session.SessionState.setAuthorizerV2Config(SessionState.java:913)
>   at 
> org.apache.hadoop.hive.ql.session.SessionState.setupAuth(SessionState.java:877)
>   at 
> org.apache.hadoop.hive.ql.session.SessionState.getAuthenticator(SessionState.java:1479)
>   at 
> org.apache.hadoop.hive.ql.session.SessionState.getUserFromAuthenticator(SessionState.java:1150)
>   at org.apache.hadoop.hive.ql.metadata.Table.getEmptyTable(Table.java:180)
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-21563) Improve Table#getEmptyTable performance by disable registerAllFunctionsOnce

2021-05-06 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-21563?focusedWorklogId=593145=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-593145
 ]

ASF GitHub Bot logged work on HIVE-21563:
-

Author: ASF GitHub Bot
Created on: 07/May/21 05:32
Start Date: 07/May/21 05:32
Worklog Time Spent: 10m 
  Work Description: sunchao merged pull request #2251:
URL: https://github.com/apache/hive/pull/2251


   


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


Issue Time Tracking
---

Worklog Id: (was: 593145)
Remaining Estimate: 0h
Time Spent: 10m

> Improve Table#getEmptyTable performance by disable registerAllFunctionsOnce
> ---
>
> Key: HIVE-21563
> URL: https://issues.apache.org/jira/browse/HIVE-21563
> Project: Hive
>  Issue Type: Improvement
>Reporter: Yuming Wang
>Assignee: Yuming Wang
>Priority: Major
> Attachments: HIVE-21563.001.patch
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> We do not need registerAllFunctionsOnce when {{Table#getEmptyTable}}. The 
> stack trace:
> {noformat}
>   at 
> org.apache.hadoop.hive.ql.exec.Registry.registerGenericUDF(Registry.java:177)
>   at 
> org.apache.hadoop.hive.ql.exec.Registry.registerGenericUDF(Registry.java:170)
>   at 
> org.apache.hadoop.hive.ql.exec.FunctionRegistry.(FunctionRegistry.java:209)
>   at org.apache.hadoop.hive.ql.metadata.Hive.reloadFunctions(Hive.java:247)
>   at 
> org.apache.hadoop.hive.ql.metadata.Hive.registerAllFunctionsOnce(Hive.java:231)
>   at org.apache.hadoop.hive.ql.metadata.Hive.(Hive.java:388)
>   at org.apache.hadoop.hive.ql.metadata.Hive.create(Hive.java:332)
>   at org.apache.hadoop.hive.ql.metadata.Hive.getInternal(Hive.java:312)
>   at org.apache.hadoop.hive.ql.metadata.Hive.get(Hive.java:288)
>   at 
> org.apache.hadoop.hive.ql.session.SessionState.setAuthorizerV2Config(SessionState.java:913)
>   at 
> org.apache.hadoop.hive.ql.session.SessionState.setupAuth(SessionState.java:877)
>   at 
> org.apache.hadoop.hive.ql.session.SessionState.getAuthenticator(SessionState.java:1479)
>   at 
> org.apache.hadoop.hive.ql.session.SessionState.getUserFromAuthenticator(SessionState.java:1150)
>   at org.apache.hadoop.hive.ql.metadata.Table.getEmptyTable(Table.java:180)
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (HIVE-21563) Improve Table#getEmptyTable performance by disable registerAllFunctionsOnce

2021-05-06 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-21563?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ASF GitHub Bot updated HIVE-21563:
--
Labels: pull-request-available  (was: )

> Improve Table#getEmptyTable performance by disable registerAllFunctionsOnce
> ---
>
> Key: HIVE-21563
> URL: https://issues.apache.org/jira/browse/HIVE-21563
> Project: Hive
>  Issue Type: Improvement
>Reporter: Yuming Wang
>Assignee: Yuming Wang
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-21563.001.patch
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> We do not need registerAllFunctionsOnce when {{Table#getEmptyTable}}. The 
> stack trace:
> {noformat}
>   at 
> org.apache.hadoop.hive.ql.exec.Registry.registerGenericUDF(Registry.java:177)
>   at 
> org.apache.hadoop.hive.ql.exec.Registry.registerGenericUDF(Registry.java:170)
>   at 
> org.apache.hadoop.hive.ql.exec.FunctionRegistry.(FunctionRegistry.java:209)
>   at org.apache.hadoop.hive.ql.metadata.Hive.reloadFunctions(Hive.java:247)
>   at 
> org.apache.hadoop.hive.ql.metadata.Hive.registerAllFunctionsOnce(Hive.java:231)
>   at org.apache.hadoop.hive.ql.metadata.Hive.(Hive.java:388)
>   at org.apache.hadoop.hive.ql.metadata.Hive.create(Hive.java:332)
>   at org.apache.hadoop.hive.ql.metadata.Hive.getInternal(Hive.java:312)
>   at org.apache.hadoop.hive.ql.metadata.Hive.get(Hive.java:288)
>   at 
> org.apache.hadoop.hive.ql.session.SessionState.setAuthorizerV2Config(SessionState.java:913)
>   at 
> org.apache.hadoop.hive.ql.session.SessionState.setupAuth(SessionState.java:877)
>   at 
> org.apache.hadoop.hive.ql.session.SessionState.getAuthenticator(SessionState.java:1479)
>   at 
> org.apache.hadoop.hive.ql.session.SessionState.getUserFromAuthenticator(SessionState.java:1150)
>   at org.apache.hadoop.hive.ql.metadata.Table.getEmptyTable(Table.java:180)
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (HIVE-21563) Improve Table#getEmptyTable performance by disable registerAllFunctionsOnce

2021-05-06 Thread Chao Sun (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-21563?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chao Sun updated HIVE-21563:

Fix Version/s: 4.0.0
   Resolution: Fixed
   Status: Resolved  (was: Patch Available)

> Improve Table#getEmptyTable performance by disable registerAllFunctionsOnce
> ---
>
> Key: HIVE-21563
> URL: https://issues.apache.org/jira/browse/HIVE-21563
> Project: Hive
>  Issue Type: Improvement
>Reporter: Yuming Wang
>Assignee: Yuming Wang
>Priority: Major
>  Labels: pull-request-available
> Fix For: 4.0.0
>
> Attachments: HIVE-21563.001.patch
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> We do not need registerAllFunctionsOnce when {{Table#getEmptyTable}}. The 
> stack trace:
> {noformat}
>   at 
> org.apache.hadoop.hive.ql.exec.Registry.registerGenericUDF(Registry.java:177)
>   at 
> org.apache.hadoop.hive.ql.exec.Registry.registerGenericUDF(Registry.java:170)
>   at 
> org.apache.hadoop.hive.ql.exec.FunctionRegistry.(FunctionRegistry.java:209)
>   at org.apache.hadoop.hive.ql.metadata.Hive.reloadFunctions(Hive.java:247)
>   at 
> org.apache.hadoop.hive.ql.metadata.Hive.registerAllFunctionsOnce(Hive.java:231)
>   at org.apache.hadoop.hive.ql.metadata.Hive.(Hive.java:388)
>   at org.apache.hadoop.hive.ql.metadata.Hive.create(Hive.java:332)
>   at org.apache.hadoop.hive.ql.metadata.Hive.getInternal(Hive.java:312)
>   at org.apache.hadoop.hive.ql.metadata.Hive.get(Hive.java:288)
>   at 
> org.apache.hadoop.hive.ql.session.SessionState.setAuthorizerV2Config(SessionState.java:913)
>   at 
> org.apache.hadoop.hive.ql.session.SessionState.setupAuth(SessionState.java:877)
>   at 
> org.apache.hadoop.hive.ql.session.SessionState.getAuthenticator(SessionState.java:1479)
>   at 
> org.apache.hadoop.hive.ql.session.SessionState.getUserFromAuthenticator(SessionState.java:1150)
>   at org.apache.hadoop.hive.ql.metadata.Table.getEmptyTable(Table.java:180)
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (HIVE-25095) Beeline/hive -e command can't deal with query with trailing quote

2021-05-06 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-25095?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ASF GitHub Bot updated HIVE-25095:
--
Labels: pull-request-available  (was: )

> Beeline/hive -e command can't deal with query with trailing quote
> -
>
> Key: HIVE-25095
> URL: https://issues.apache.org/jira/browse/HIVE-25095
> Project: Hive
>  Issue Type: Bug
>Reporter: Robbie Zhang
>Assignee: Robbie Zhang
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> The command 
> {code:java}
> hive -e 'select "hive"'{code}
> and
> {code:java}
> beeline -e 'select "hive"'{code}
> fail with such error:
> {code:java}
> Error: Error while compiling statement: FAILED: ParseException line 1:12 
> character '' not supported here (state=42000,code=4){code}
> The reason is that org.apache.commons.cli.Util.stripLeadingAndTrailingQuotes 
> in commons-cli-1.2.jar strips the trailing quote so the query string is 
> changed to
> {code:java}
> select "hive{code}
> This bug is fixed in commons-cli-1.3.1 and commons-cli-1.4.jar. The 
> workaround is to overwrite commons-cli-1.2.jar with commons-cli-1.3.1 or 
> commons-cli-1.4.jar.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-25095) Beeline/hive -e command can't deal with query with trailing quote

2021-05-06 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-25095?focusedWorklogId=593139=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-593139
 ]

ASF GitHub Bot logged work on HIVE-25095:
-

Author: ASF GitHub Bot
Created on: 07/May/21 03:58
Start Date: 07/May/21 03:58
Worklog Time Spent: 10m 
  Work Description: ujc714 opened a new pull request #2255:
URL: https://github.com/apache/hive/pull/2255


   …### What changes were proposed in this pull request?
   
   Upgrade commons-cli to 1.4.
   
   ### Why are the changes needed?
   There is a bug in commons-cli-1.2 which trips trailing quote improperly.
   
   
   ### Does this PR introduce _any_ user-facing change?
   No.
   
   ### How was this patch tested?
   mvn test -Dtest=org.apache.hive.beeline.cli.TestHiveCli
   mvn test -Dtest=org.apache.hive.beeline.TestBeelineArgParsing
   
   


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


Issue Time Tracking
---

Worklog Id: (was: 593139)
Remaining Estimate: 0h
Time Spent: 10m

> Beeline/hive -e command can't deal with query with trailing quote
> -
>
> Key: HIVE-25095
> URL: https://issues.apache.org/jira/browse/HIVE-25095
> Project: Hive
>  Issue Type: Bug
>Reporter: Robbie Zhang
>Assignee: Robbie Zhang
>Priority: Major
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> The command 
> {code:java}
> hive -e 'select "hive"'{code}
> and
> {code:java}
> beeline -e 'select "hive"'{code}
> fail with such error:
> {code:java}
> Error: Error while compiling statement: FAILED: ParseException line 1:12 
> character '' not supported here (state=42000,code=4){code}
> The reason is that org.apache.commons.cli.Util.stripLeadingAndTrailingQuotes 
> in commons-cli-1.2.jar strips the trailing quote so the query string is 
> changed to
> {code:java}
> select "hive{code}
> This bug is fixed in commons-cli-1.3.1 and commons-cli-1.4.jar. The 
> workaround is to overwrite commons-cli-1.2.jar with commons-cli-1.3.1 or 
> commons-cli-1.4.jar.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Assigned] (HIVE-25095) Beeline/hive -e command can't deal with query with trailing quote

2021-05-06 Thread Robbie Zhang (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-25095?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Robbie Zhang reassigned HIVE-25095:
---

Assignee: Robbie Zhang

> Beeline/hive -e command can't deal with query with trailing quote
> -
>
> Key: HIVE-25095
> URL: https://issues.apache.org/jira/browse/HIVE-25095
> Project: Hive
>  Issue Type: Bug
>Reporter: Robbie Zhang
>Assignee: Robbie Zhang
>Priority: Major
>
> The command 
> {code:java}
> hive -e 'select "hive"'{code}
> and
> {code:java}
> beeline -e 'select "hive"'{code}
> fail with such error:
> {code:java}
> Error: Error while compiling statement: FAILED: ParseException line 1:12 
> character '' not supported here (state=42000,code=4){code}
> The reason is that org.apache.commons.cli.Util.stripLeadingAndTrailingQuotes 
> in commons-cli-1.2.jar strips the trailing quote so the query string is 
> changed to
> {code:java}
> select "hive{code}
> This bug is fixed in commons-cli-1.3.1 and commons-cli-1.4.jar. The 
> workaround is to overwrite commons-cli-1.2.jar with commons-cli-1.3.1 or 
> commons-cli-1.4.jar.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-23756) drop table command fails with MySQLIntegrityConstraintViolationException:

2021-05-06 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-23756?focusedWorklogId=593093=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-593093
 ]

ASF GitHub Bot logged work on HIVE-23756:
-

Author: ASF GitHub Bot
Created on: 07/May/21 00:57
Start Date: 07/May/21 00:57
Worklog Time Spent: 10m 
  Work Description: scarlin-cloudera opened a new pull request #2254:
URL: https://github.com/apache/hive/pull/2254


   
   
   ### What changes were proposed in this pull request?
   
   
   
   ### Why are the changes needed?
   
   
   
   ### Does this PR introduce _any_ user-facing change?
   
   
   
   ### How was this patch tested?
   
   


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


Issue Time Tracking
---

Worklog Id: (was: 593093)
Time Spent: 20m  (was: 10m)

> drop table command fails with MySQLIntegrityConstraintViolationException:
> -
>
> Key: HIVE-23756
> URL: https://issues.apache.org/jira/browse/HIVE-23756
> Project: Hive
>  Issue Type: Bug
>Reporter: Ganesha Shreedhara
>Assignee: Ganesha Shreedhara
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-23756.1.patch
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> Drop table command fails intermittently with the following exception.
> {code:java}
> Caused by: java.sql.BatchUpdateException: Cannot delete or update a parent 
> row: a foreign key constraint fails ("metastore"."COLUMNS_V2", CONSTRAINT 
> "COLUMNS_V2_FK1" FOREIGN KEY ("CD_ID") REFERENCES "CDS" ("CD_ID")) App > at 
> com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1815)at
>  com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1277) 
> Appat 
> org.datanucleus.store.rdbms.ParamLoggingPreparedStatement.executeBatch(ParamLoggingPreparedStatement.java:372)
> at 
> org.datanucleus.store.rdbms.SQLController.processConnectionStatement(SQLController.java:628)
> at 
> org.datanucleus.store.rdbms.SQLController.getStatementForUpdate(SQLController.java:207)
> at 
> org.datanucleus.store.rdbms.SQLController.getStatementForUpdate(SQLController.java:179)
> at 
> org.datanucleus.store.rdbms.scostore.JoinMapStore.clearInternal(JoinMapStore.java:901)
> ... 36 more 
> Caused by: 
> com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: 
> Cannot delete or update a parent row: a foreign key constraint fails 
> ("metastore"."COLUMNS_V2", CONSTRAINT "COLUMNS_V2_FK1" FOREIGN KEY ("CD_ID") 
> REFERENCES "CDS" ("CD_ID"))
> at sun.reflect.GeneratedConstructorAccessor121.newInstance(Unknown Source)
> at 
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
> at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)
> at com.mysql.jdbc.Util.getInstance(Util.java:360)
> at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:971)
> at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3887)
> at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3823){code}
> Although HIVE-19994 resolves this issue, the FK constraint name of COLUMNS_V2 
> table specified in package.jdo file is not same as the FK constraint name 
> used while creating COLUMNS_V2 table ([Ref|#L60]]). 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (HIVE-23756) drop table command fails with MySQLIntegrityConstraintViolationException:

2021-05-06 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-23756?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ASF GitHub Bot updated HIVE-23756:
--
Labels: pull-request-available  (was: )

> drop table command fails with MySQLIntegrityConstraintViolationException:
> -
>
> Key: HIVE-23756
> URL: https://issues.apache.org/jira/browse/HIVE-23756
> Project: Hive
>  Issue Type: Bug
>Reporter: Ganesha Shreedhara
>Assignee: Ganesha Shreedhara
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-23756.1.patch
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Drop table command fails intermittently with the following exception.
> {code:java}
> Caused by: java.sql.BatchUpdateException: Cannot delete or update a parent 
> row: a foreign key constraint fails ("metastore"."COLUMNS_V2", CONSTRAINT 
> "COLUMNS_V2_FK1" FOREIGN KEY ("CD_ID") REFERENCES "CDS" ("CD_ID")) App > at 
> com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1815)at
>  com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1277) 
> Appat 
> org.datanucleus.store.rdbms.ParamLoggingPreparedStatement.executeBatch(ParamLoggingPreparedStatement.java:372)
> at 
> org.datanucleus.store.rdbms.SQLController.processConnectionStatement(SQLController.java:628)
> at 
> org.datanucleus.store.rdbms.SQLController.getStatementForUpdate(SQLController.java:207)
> at 
> org.datanucleus.store.rdbms.SQLController.getStatementForUpdate(SQLController.java:179)
> at 
> org.datanucleus.store.rdbms.scostore.JoinMapStore.clearInternal(JoinMapStore.java:901)
> ... 36 more 
> Caused by: 
> com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: 
> Cannot delete or update a parent row: a foreign key constraint fails 
> ("metastore"."COLUMNS_V2", CONSTRAINT "COLUMNS_V2_FK1" FOREIGN KEY ("CD_ID") 
> REFERENCES "CDS" ("CD_ID"))
> at sun.reflect.GeneratedConstructorAccessor121.newInstance(Unknown Source)
> at 
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
> at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)
> at com.mysql.jdbc.Util.getInstance(Util.java:360)
> at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:971)
> at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3887)
> at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3823){code}
> Although HIVE-19994 resolves this issue, the FK constraint name of COLUMNS_V2 
> table specified in package.jdo file is not same as the FK constraint name 
> used while creating COLUMNS_V2 table ([Ref|#L60]]). 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-23756) drop table command fails with MySQLIntegrityConstraintViolationException:

2021-05-06 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-23756?focusedWorklogId=593092=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-593092
 ]

ASF GitHub Bot logged work on HIVE-23756:
-

Author: ASF GitHub Bot
Created on: 07/May/21 00:55
Start Date: 07/May/21 00:55
Worklog Time Spent: 10m 
  Work Description: scarlin-cloudera closed pull request #2253:
URL: https://github.com/apache/hive/pull/2253


   


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


Issue Time Tracking
---

Worklog Id: (was: 593092)
Remaining Estimate: 0h
Time Spent: 10m

> drop table command fails with MySQLIntegrityConstraintViolationException:
> -
>
> Key: HIVE-23756
> URL: https://issues.apache.org/jira/browse/HIVE-23756
> Project: Hive
>  Issue Type: Bug
>Reporter: Ganesha Shreedhara
>Assignee: Ganesha Shreedhara
>Priority: Major
> Attachments: HIVE-23756.1.patch
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Drop table command fails intermittently with the following exception.
> {code:java}
> Caused by: java.sql.BatchUpdateException: Cannot delete or update a parent 
> row: a foreign key constraint fails ("metastore"."COLUMNS_V2", CONSTRAINT 
> "COLUMNS_V2_FK1" FOREIGN KEY ("CD_ID") REFERENCES "CDS" ("CD_ID")) App > at 
> com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1815)at
>  com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1277) 
> Appat 
> org.datanucleus.store.rdbms.ParamLoggingPreparedStatement.executeBatch(ParamLoggingPreparedStatement.java:372)
> at 
> org.datanucleus.store.rdbms.SQLController.processConnectionStatement(SQLController.java:628)
> at 
> org.datanucleus.store.rdbms.SQLController.getStatementForUpdate(SQLController.java:207)
> at 
> org.datanucleus.store.rdbms.SQLController.getStatementForUpdate(SQLController.java:179)
> at 
> org.datanucleus.store.rdbms.scostore.JoinMapStore.clearInternal(JoinMapStore.java:901)
> ... 36 more 
> Caused by: 
> com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: 
> Cannot delete or update a parent row: a foreign key constraint fails 
> ("metastore"."COLUMNS_V2", CONSTRAINT "COLUMNS_V2_FK1" FOREIGN KEY ("CD_ID") 
> REFERENCES "CDS" ("CD_ID"))
> at sun.reflect.GeneratedConstructorAccessor121.newInstance(Unknown Source)
> at 
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
> at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)
> at com.mysql.jdbc.Util.getInstance(Util.java:360)
> at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:971)
> at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3887)
> at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3823){code}
> Although HIVE-19994 resolves this issue, the FK constraint name of COLUMNS_V2 
> table specified in package.jdo file is not same as the FK constraint name 
> used while creating COLUMNS_V2 table ([Ref|#L60]]). 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Comment Edited] (HIVE-24066) Hive query on parquet data should identify if column is not present in file schema and show NULL value instead of Exception

2021-05-06 Thread Shivam Sharma (Jira)


[ 
https://issues.apache.org/jira/browse/HIVE-24066?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17340225#comment-17340225
 ] 

Shivam Sharma edited comment on HIVE-24066 at 5/6/21, 1:59 PM:
---

I am also facing the same issue.  Can we get an update here?

Can we get some workarounds here other than creating a new table?


was (Author: shivamsharma):
I am also facing the same issue. Can we get update here?

> Hive query on parquet data should identify if column is not present in file 
> schema and show NULL value instead of Exception
> ---
>
> Key: HIVE-24066
> URL: https://issues.apache.org/jira/browse/HIVE-24066
> Project: Hive
>  Issue Type: Bug
>  Components: Hive
>Affects Versions: 2.3.5, 3.1.2
>Reporter: Jainik Vora
>Priority: Major
> Attachments: day_01.snappy.parquet
>
>
> I created a hive table containing columns with struct data type 
>   
> {code:java}
> CREATE EXTERNAL TABLE test_dwh.sample_parquet_table (
>   `context` struct<
> `app`: struct<
> `build`: string,
> `name`: string,
> `namespace`: string,
> `version`: string
> >,
> `device`: struct<
> `adtrackingenabled`: boolean,
> `advertisingid`: string,
> `id`: string,
> `manufacturer`: string,
> `model`: string,
> `type`: string
> >,
> `locale`: string,
> `library`: struct<
> `name`: string,
> `version`: string
> >,
> `os`: struct<
> `name`: string,
> `version`: string
> >,
> `screen`: struct<
> `height`: bigint,
> `width`: bigint
> >,
> `network`: struct<
> `carrier`: string,
> `cellular`: boolean,
> `wifi`: boolean
>  >,
> `timezone`: string,
> `userAgent`: string
> >
> ) PARTITIONED BY (day string)
> STORED as PARQUET
> LOCATION 's3://xyz/events'{code}
>  
>  All columns are nullable hence the parquet files read by the table don't 
> always contain all columns. If any file in a partition doesn't have 
> "context.os" struct and if "context.os.name" is queried, Hive throws an 
> exception as below. Same for "context.screen" as well.
>   
> {code:java}
> 2020-10-23T00:44:10,496 ERROR [db58bfe6-d0ca-4233-845a-8a10916c3ff1 
> main([])]: CliDriver (SessionState.java:printError(1126)) - Failed with 
> exception java.io.IOException:java.lang.RuntimeException: Primitive type 
> osshould not doesn't match typeos[name]
> 2020-10-23T00:44:10,496 ERROR [db58bfe6-d0ca-4233-845a-8a10916c3ff1 
> main([])]: CliDriver (SessionState.java:printError(1126)) - Failed with 
> exception java.io.IOException:java.lang.RuntimeException: Primitive type 
> osshould not doesn't match typeos[name]java.io.IOException: 
> java.lang.RuntimeException: Primitive type osshould not doesn't match 
> typeos[name] 
>   at 
> org.apache.hadoop.hive.ql.exec.FetchOperator.getNextRow(FetchOperator.java:521)
>   at 
> org.apache.hadoop.hive.ql.exec.FetchOperator.pushRow(FetchOperator.java:428)
>   at org.apache.hadoop.hive.ql.exec.FetchTask.fetch(FetchTask.java:147)
>   at org.apache.hadoop.hive.ql.Driver.getResults(Driver.java:2208)
>   at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:253)
>   at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:184)
>   at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:403)
>   at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:336)
>   at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:787)
>   at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:759)
>   at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:686)
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>   at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>   at java.lang.reflect.Method.invoke(Method.java:498) at 
> org.apache.hadoop.util.RunJar.run(RunJar.java:239)
>   at org.apache.hadoop.util.RunJar.main(RunJar.java:153)
> Caused by: java.lang.RuntimeException: Primitive type osshould not doesn't 
> match typeos[name] 
>   at 
> org.apache.hadoop.hive.ql.io.parquet.read.DataWritableReadSupport.projectLeafTypes(DataWritableReadSupport.java:330)
>  
>   at 
> org.apache.hadoop.hive.ql.io.parquet.read.DataWritableReadSupport.projectLeafTypes(DataWritableReadSupport.java:322)
>  
>   at 
> 

[jira] [Commented] (HIVE-24066) Hive query on parquet data should identify if column is not present in file schema and show NULL value instead of Exception

2021-05-06 Thread Shivam Sharma (Jira)


[ 
https://issues.apache.org/jira/browse/HIVE-24066?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17340225#comment-17340225
 ] 

Shivam Sharma commented on HIVE-24066:
--

I am also facing the same issue. Can we get update here?

> Hive query on parquet data should identify if column is not present in file 
> schema and show NULL value instead of Exception
> ---
>
> Key: HIVE-24066
> URL: https://issues.apache.org/jira/browse/HIVE-24066
> Project: Hive
>  Issue Type: Bug
>  Components: Hive
>Affects Versions: 2.3.5, 3.1.2
>Reporter: Jainik Vora
>Priority: Major
> Attachments: day_01.snappy.parquet
>
>
> I created a hive table containing columns with struct data type 
>   
> {code:java}
> CREATE EXTERNAL TABLE test_dwh.sample_parquet_table (
>   `context` struct<
> `app`: struct<
> `build`: string,
> `name`: string,
> `namespace`: string,
> `version`: string
> >,
> `device`: struct<
> `adtrackingenabled`: boolean,
> `advertisingid`: string,
> `id`: string,
> `manufacturer`: string,
> `model`: string,
> `type`: string
> >,
> `locale`: string,
> `library`: struct<
> `name`: string,
> `version`: string
> >,
> `os`: struct<
> `name`: string,
> `version`: string
> >,
> `screen`: struct<
> `height`: bigint,
> `width`: bigint
> >,
> `network`: struct<
> `carrier`: string,
> `cellular`: boolean,
> `wifi`: boolean
>  >,
> `timezone`: string,
> `userAgent`: string
> >
> ) PARTITIONED BY (day string)
> STORED as PARQUET
> LOCATION 's3://xyz/events'{code}
>  
>  All columns are nullable hence the parquet files read by the table don't 
> always contain all columns. If any file in a partition doesn't have 
> "context.os" struct and if "context.os.name" is queried, Hive throws an 
> exception as below. Same for "context.screen" as well.
>   
> {code:java}
> 2020-10-23T00:44:10,496 ERROR [db58bfe6-d0ca-4233-845a-8a10916c3ff1 
> main([])]: CliDriver (SessionState.java:printError(1126)) - Failed with 
> exception java.io.IOException:java.lang.RuntimeException: Primitive type 
> osshould not doesn't match typeos[name]
> 2020-10-23T00:44:10,496 ERROR [db58bfe6-d0ca-4233-845a-8a10916c3ff1 
> main([])]: CliDriver (SessionState.java:printError(1126)) - Failed with 
> exception java.io.IOException:java.lang.RuntimeException: Primitive type 
> osshould not doesn't match typeos[name]java.io.IOException: 
> java.lang.RuntimeException: Primitive type osshould not doesn't match 
> typeos[name] 
>   at 
> org.apache.hadoop.hive.ql.exec.FetchOperator.getNextRow(FetchOperator.java:521)
>   at 
> org.apache.hadoop.hive.ql.exec.FetchOperator.pushRow(FetchOperator.java:428)
>   at org.apache.hadoop.hive.ql.exec.FetchTask.fetch(FetchTask.java:147)
>   at org.apache.hadoop.hive.ql.Driver.getResults(Driver.java:2208)
>   at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:253)
>   at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:184)
>   at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:403)
>   at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:336)
>   at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:787)
>   at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:759)
>   at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:686)
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>   at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>   at java.lang.reflect.Method.invoke(Method.java:498) at 
> org.apache.hadoop.util.RunJar.run(RunJar.java:239)
>   at org.apache.hadoop.util.RunJar.main(RunJar.java:153)
> Caused by: java.lang.RuntimeException: Primitive type osshould not doesn't 
> match typeos[name] 
>   at 
> org.apache.hadoop.hive.ql.io.parquet.read.DataWritableReadSupport.projectLeafTypes(DataWritableReadSupport.java:330)
>  
>   at 
> org.apache.hadoop.hive.ql.io.parquet.read.DataWritableReadSupport.projectLeafTypes(DataWritableReadSupport.java:322)
>  
>   at 
> org.apache.hadoop.hive.ql.io.parquet.read.DataWritableReadSupport.getProjectedSchema(DataWritableReadSupport.java:249)
>   at 
> org.apache.hadoop.hive.ql.io.parquet.read.DataWritableReadSupport.init(DataWritableReadSupport.java:379)
>  
>   at 
> 

[jira] [Updated] (HIVE-25093) date_format() UDF is returning values in UTC time zone only

2021-05-06 Thread Ashish Sharma (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-25093?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ashish Sharma updated HIVE-25093:
-
Description: 
*HIVE - 1.2*

sshuser@hn0-dateti:~$ *timedatectl*

  Local time: Thu 2021-05-06 11:56:08 IST
  Universal time: Thu 2021-05-06 06:26:08 UTC
RTC time: Thu 2021-05-06 06:26:08
   Time zone: Asia/Kolkata (IST, +0530)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

sshuser@hn0-dateti:~$ beeline
0: jdbc:hive2://localhost:10001/default> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+--+
| _c0  |
+--+--+
| 2021-05-06 11:58:53.760 IST  |
+--+--+
1 row selected (1.271 seconds)


*HIVE - 3.1.0*

sshuser@hn0-testja:~$ *timedatectl*
  Local time: Thu 2021-05-06 12:03:32 IST
  Universal time: Thu 2021-05-06 06:33:32 UTC
RTC time: Thu 2021-05-06 06:33:32
   Time zone: Asia/Kolkata (IST, +0530)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

sshuser@hn0-testja:~$ beeline
0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+
| _c0  |
+--+
| *2021-05-06 06:33:59.078 UTC*  |
+--+
1 row selected (13.396 seconds)

0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *set 
hive.local.time.zone=Asia/Kolkata;*
No rows affected (0.025 seconds)
0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+
| _c0  |
+--+
| *{color:red}2021-05-06 12:08:15.118 UTC{color}*  | 
+--+
1 row selected (1.074 seconds)

expected result was *2021-05-06 12:08:15.118 IST*


As part of HIVE-12192 it was decided to have a common time zone for all 
computation i.e. "UTC". Due to which data_format() function was hard coded to 
"UTC".

But later in HIVE-21039 it was decided that user session time zone value should 
be the default not UTC. 

date_format() was not fixed as part of HIVE-21039.

what should be the ideal time zone value of date_format().

  was:
*HIVE - 1.2*

sshuser@hn0-dateti:~$ *timedatectl*

  Local time: Thu 2021-05-06 11:56:08 IST
  Universal time: Thu 2021-05-06 06:26:08 UTC
RTC time: Thu 2021-05-06 06:26:08
   Time zone: Asia/Kolkata (IST, +0530)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

sshuser@hn0-dateti:~$ beeline
0: jdbc:hive2://localhost:10001/default> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+--+
| _c0  |
+--+--+
| 2021-05-06 11:58:53.760 IST  |
+--+--+
1 row selected (1.271 seconds)


*HIVE - 3.1.0*

sshuser@hn0-testja:~$ *timedatectl*
  Local time: Thu 2021-05-06 12:03:32 IST
  Universal time: Thu 2021-05-06 06:33:32 UTC
RTC time: Thu 2021-05-06 06:33:32
   Time zone: Asia/Kolkata (IST, +0530)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

sshuser@hn0-testja:~$ beeline
0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+
| _c0  |
+--+
| *2021-05-06 06:33:59.078 UTC*  |
+--+
1 row selected (13.396 seconds)

0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *set 
hive.local.time.zone=Asia/Kolkata;*
No rows affected (0.025 seconds)
0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+
| _c0  |
+--+
| *{color:red}2021-05-06 12:08:15.118 UTC{color}*  | 
+--+
1 row selected (1.074 seconds)

expected result was *2021-05-06 12:08:15.118 IST*


As part of HIVE-12192 it was decided to have a common time zone for all 
computation i.e. "UTC". Due to which data_format() function was hard coded to 
"UTC".

But later in HIVE-21039 it was decided that user session time zone value should 
be the default not UTC. 

date_format() was not fixed as part of HIVE-21039.

what should be the ideal time zone value of date_format().


Code - 
https://github.com/apache/hive/blob/7b3ecf617a6d46f48a3b6f77e0339fd4ad95a420/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateFormat.java

if (fmtStr != null) {
try {
  formatter = new SimpleDateFormat(fmtStr);
 formatter.setCalendar(DateTimeMath.getProlepticGregorianCalendarUTC());
} catch (IllegalArgumentException e) {
  // ignore
}


> date_format() 

[jira] [Updated] (HIVE-25093) date_format() UDF is returning values in UTC time zone only

2021-05-06 Thread Sankar Hariappan (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-25093?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sankar Hariappan updated HIVE-25093:

Priority: Minor  (was: Trivial)

> date_format() UDF is returning values in UTC time zone only 
> 
>
> Key: HIVE-25093
> URL: https://issues.apache.org/jira/browse/HIVE-25093
> Project: Hive
>  Issue Type: Bug
>  Components: UDF
>Affects Versions: 3.1.2
>Reporter: Ashish Sharma
>Assignee: Ashish Sharma
>Priority: Minor
>
> *HIVE - 1.2*
> sshuser@hn0-dateti:~$ *timedatectl*
>   Local time: Thu 2021-05-06 11:56:08 IST
>   Universal time: Thu 2021-05-06 06:26:08 UTC
> RTC time: Thu 2021-05-06 06:26:08
>Time zone: Asia/Kolkata (IST, +0530)
>  Network time on: yes
> NTP synchronized: yes
>  RTC in local TZ: no
> sshuser@hn0-dateti:~$ beeline
> 0: jdbc:hive2://localhost:10001/default> *select 
> date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
> +--+--+
> | _c0  |
> +--+--+
> | 2021-05-06 11:58:53.760 IST  |
> +--+--+
> 1 row selected (1.271 seconds)
> *HIVE - 3.1.0*
> sshuser@hn0-testja:~$ *timedatectl*
>   Local time: Thu 2021-05-06 12:03:32 IST
>   Universal time: Thu 2021-05-06 06:33:32 UTC
> RTC time: Thu 2021-05-06 06:33:32
>Time zone: Asia/Kolkata (IST, +0530)
>  Network time on: yes
> NTP synchronized: yes
>  RTC in local TZ: no
> sshuser@hn0-testja:~$ beeline
> 0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *select 
> date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
> +--+
> | _c0  |
> +--+
> | *2021-05-06 06:33:59.078 UTC*  |
> +--+
> 1 row selected (13.396 seconds)
> 0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *set 
> hive.local.time.zone=Asia/Kolkata;*
> No rows affected (0.025 seconds)
> 0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *select 
> date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
> +--+
> | _c0  |
> +--+
> | *{color:red}2021-05-06 12:08:15.118 UTC{color}*  | 
> +--+
> 1 row selected (1.074 seconds)
> expected result was *2021-05-06 12:08:15.118 IST*
> As part of HIVE-12192 it was decided to have a common time zone for all 
> computation i.e. "UTC". Due to which data_format() function was hard coded to 
> "UTC".
> But later in HIVE-21039 it was decided that user session time zone value 
> should be the default not UTC. 
> date_format() was not fixed as part of HIVE-21039.
> what should be the ideal time zone value of date_format().
> Code - 
> https://github.com/apache/hive/blob/7b3ecf617a6d46f48a3b6f77e0339fd4ad95a420/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateFormat.java
> if (fmtStr != null) {
> try {
>   formatter = new SimpleDateFormat(fmtStr);
>  
> formatter.setCalendar(DateTimeMath.getProlepticGregorianCalendarUTC());
> } catch (IllegalArgumentException e) {
>   // ignore
> }



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (HIVE-25093) date_format() UDF is returning values in UTC time zone only

2021-05-06 Thread Ashish Sharma (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-25093?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ashish Sharma updated HIVE-25093:
-
Description: 
*HIVE - 1.2*

sshuser@hn0-dateti:~$ *timedatectl*

  Local time: Thu 2021-05-06 11:56:08 IST
  Universal time: Thu 2021-05-06 06:26:08 UTC
RTC time: Thu 2021-05-06 06:26:08
   Time zone: Asia/Kolkata (IST, +0530)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

sshuser@hn0-dateti:~$ beeline
0: jdbc:hive2://localhost:10001/default> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+--+
| _c0  |
+--+--+
| 2021-05-06 11:58:53.760 IST  |
+--+--+
1 row selected (1.271 seconds)


*HIVE - 3.1.0*

sshuser@hn0-testja:~$ *timedatectl*
  Local time: Thu 2021-05-06 12:03:32 IST
  Universal time: Thu 2021-05-06 06:33:32 UTC
RTC time: Thu 2021-05-06 06:33:32
   Time zone: Asia/Kolkata (IST, +0530)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

sshuser@hn0-testja:~$ beeline
0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+
| _c0  |
+--+
| *2021-05-06 06:33:59.078 UTC*  |
+--+
1 row selected (13.396 seconds)

0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *set 
hive.local.time.zone=Asia/Kolkata;*
No rows affected (0.025 seconds)
0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+
| _c0  |
+--+
| *{color:red}2021-05-06 12:08:15.118 UTC{color}*  | 
+--+
1 row selected (1.074 seconds)

expected result was *2021-05-06 12:08:15.118 IST*


As part of HIVE-12192 it was decided to have a common time zone for all 
computation i.e. "UTC". Due to which data_format() function was hard coded to 
"UTC".

But later in HIVE-21039 it was decided that user session time zone value should 
be the default not UTC. 

date_format() was not fixed as part of HIVE-21039.

what should be the ideal time zone value of date_format().


Code - 
https://github.com/apache/hive/blob/7b3ecf617a6d46f48a3b6f77e0339fd4ad95a420/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateFormat.java

if (fmtStr != null) {
try {
  formatter = new SimpleDateFormat(fmtStr);
 formatter.setCalendar(DateTimeMath.getProlepticGregorianCalendarUTC());
} catch (IllegalArgumentException e) {
  // ignore
}

  was:
*HIVE - 1.2*

sshuser@hn0-dateti:~$ *timedatectl*

  Local time: Thu 2021-05-06 11:56:08 IST
  Universal time: Thu 2021-05-06 06:26:08 UTC
RTC time: Thu 2021-05-06 06:26:08
   Time zone: Asia/Kolkata (IST, +0530)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

sshuser@hn0-dateti:~$ beeline
0: jdbc:hive2://localhost:10001/default> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+--+
| _c0  |
+--+--+
| 2021-05-06 11:58:53.760 IST  |
+--+--+
1 row selected (1.271 seconds)


*HIVE - 3.1.0*

sshuser@hn0-testja:~$ *timedatectl*
  Local time: Thu 2021-05-06 12:03:32 IST
  Universal time: Thu 2021-05-06 06:33:32 UTC
RTC time: Thu 2021-05-06 06:33:32
   Time zone: Asia/Kolkata (IST, +0530)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

sshuser@hn0-testja:~$ beeline
0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+
| _c0  |
+--+
| *2021-05-06 06:33:59.078 UTC*  |
+--+
1 row selected (13.396 seconds)

0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *set 
hive.local.time.zone=Asia/Kolkata;*
No rows affected (0.025 seconds)
0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+
| _c0  |
+--+
| *2021-05-06 12:08:15.118 {color:red}UTC{color}*  | 
+--+
1 row selected (1.074 seconds)



As part of HIVE-12192 it was decided to have a common time zone for all 
computation i.e. "UTC". Due to which data_format() function was hard coded to 
"UTC".

But later in HIVE-21039 it was decided that user session time zone value should 
be the default not UTC. 

date_format() was not fixed as part of HIVE-21039.

what should be the ideal time zone value of date_format().


Code - 

[jira] [Updated] (HIVE-25093) date_format() UDF is returning values in UTC time zone only

2021-05-06 Thread Ashish Sharma (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-25093?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ashish Sharma updated HIVE-25093:
-
Description: 
*HIVE - 1.2*

sshuser@hn0-dateti:~$ *timedatectl*

  Local time: Thu 2021-05-06 11:56:08 IST
  Universal time: Thu 2021-05-06 06:26:08 UTC
RTC time: Thu 2021-05-06 06:26:08
   Time zone: Asia/Kolkata (IST, +0530)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

sshuser@hn0-dateti:~$ beeline
0: jdbc:hive2://localhost:10001/default> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+--+
| _c0  |
+--+--+
| 2021-05-06 11:58:53.760 IST  |
+--+--+
1 row selected (1.271 seconds)


*HIVE - 3.1.0*

sshuser@hn0-testja:~$ *timedatectl*
  Local time: Thu 2021-05-06 12:03:32 IST
  Universal time: Thu 2021-05-06 06:33:32 UTC
RTC time: Thu 2021-05-06 06:33:32
   Time zone: Asia/Kolkata (IST, +0530)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

sshuser@hn0-testja:~$ beeline
0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+
| _c0  |
+--+
| *2021-05-06 06:33:59.078 UTC*  |
+--+
1 row selected (13.396 seconds)

0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *set 
hive.local.time.zone=Asia/Kolkata;*
No rows affected (0.025 seconds)
0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+
| _c0  |
+--+
| *2021-05-06 12:08:15.118 {color:red}UTC{color}*  | 
+--+
1 row selected (1.074 seconds)



As part of HIVE-12192 it was decided to have a common time zone for all 
computation i.e. "UTC". Due to which data_format() function was hard coded to 
"UTC".

But later in HIVE-21039 it was decided that user session time zone value should 
be the default not UTC. 

date_format() was not fixed as part of HIVE-21039.

what should be the ideal time zone value of date_format().


Code - 
https://github.com/apache/hive/blob/7b3ecf617a6d46f48a3b6f77e0339fd4ad95a420/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateFormat.java

if (fmtStr != null) {
try {
  formatter = new SimpleDateFormat(fmtStr);
 formatter.setCalendar(DateTimeMath.getProlepticGregorianCalendarUTC());
} catch (IllegalArgumentException e) {
  // ignore
}

  was:
*HIVE - 1.2*

sshuser@hn0-dateti:~$ *timedatectl*

  Local time: Thu 2021-05-06 11:56:08 IST
  Universal time: Thu 2021-05-06 06:26:08 UTC
RTC time: Thu 2021-05-06 06:26:08
   Time zone: Asia/Kolkata (IST, +0530)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

sshuser@hn0-dateti:~$ beeline
0: jdbc:hive2://localhost:10001/default> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+--+
| _c0  |
+--+--+
| 2021-05-06 11:58:53.760 IST  |
+--+--+
1 row selected (1.271 seconds)


*HIVE - 3.1.0*

sshuser@hn0-testja:~$ *timedatectl*
  Local time: Thu 2021-05-06 12:03:32 IST
  Universal time: Thu 2021-05-06 06:33:32 UTC
RTC time: Thu 2021-05-06 06:33:32
   Time zone: Asia/Kolkata (IST, +0530)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

sshuser@hn0-testja:~$ beeline
0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+
| _c0  |
+--+
| *2021-05-06 06:33:59.078 UTC*  |
+--+
1 row selected (13.396 seconds)

0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *set 
hive.local.time.zone=Asia/Kolkata;*
No rows affected (0.025 seconds)
0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+
| _c0  |
+--+
| *2021-05-06 12:08:15.118 {color:red}UTC{color}*  | (Since time changes but it 
still prints UTC)
+--+
1 row selected (1.074 seconds)



As part of HIVE-12192 it was decided to have a common time zone for all 
computation i.e. "UTC". Due to which data_format() function was hard coded to 
"UTC".

But later in HIVE-21039 it was decided that user session time zone value should 
be the default not UTC. 

date_format() was not fixed as part of HIVE-21039.

what should be the ideal time zone value of date_format().


Code - 

[jira] [Updated] (HIVE-25093) date_format() UDF is returning values in UTC time zone only

2021-05-06 Thread Ashish Sharma (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-25093?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ashish Sharma updated HIVE-25093:
-
Description: 
*HIVE - 1.2*

sshuser@hn0-dateti:~$ *timedatectl*

  Local time: Thu 2021-05-06 11:56:08 IST
  Universal time: Thu 2021-05-06 06:26:08 UTC
RTC time: Thu 2021-05-06 06:26:08
   Time zone: Asia/Kolkata (IST, +0530)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

sshuser@hn0-dateti:~$ beeline
0: jdbc:hive2://localhost:10001/default> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+--+
| _c0  |
+--+--+
| 2021-05-06 11:58:53.760 IST  |
+--+--+
1 row selected (1.271 seconds)


*HIVE - 3.1.0*

sshuser@hn0-testja:~$ *timedatectl*
  Local time: Thu 2021-05-06 12:03:32 IST
  Universal time: Thu 2021-05-06 06:33:32 UTC
RTC time: Thu 2021-05-06 06:33:32
   Time zone: Asia/Kolkata (IST, +0530)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

sshuser@hn0-testja:~$ beeline
0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+
| _c0  |
+--+
| *2021-05-06 06:33:59.078 UTC*  |
+--+
1 row selected (13.396 seconds)

0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *set 
hive.local.time.zone=Asia/Kolkata;*
No rows affected (0.025 seconds)
0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+
| _c0  |
+--+
| *2021-05-06 12:08:15.118 {color:red}UTC{color}*  | (Since time changes but it 
still prints UTC)
+--+
1 row selected (1.074 seconds)



As part of HIVE-12192 it was decided to have a common time zone for all 
computation i.e. "UTC". Due to which data_format() function was hard coded to 
"UTC".

But later in HIVE-21039 it was decided that user session time zone value should 
be the default not UTC. 

date_format() was not fixed as part of HIVE-21039.

what should be the ideal time zone value of date_format().


Code - 
https://github.com/apache/hive/blob/7b3ecf617a6d46f48a3b6f77e0339fd4ad95a420/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateFormat.java

if (fmtStr != null) {
try {
  formatter = new SimpleDateFormat(fmtStr);
 formatter.setCalendar(DateTimeMath.getProlepticGregorianCalendarUTC());
} catch (IllegalArgumentException e) {
  // ignore
}

  was:
*HIVE - 1.2*

sshuser@hn0-dateti:~$ *timedatectl*

  Local time: Thu 2021-05-06 11:56:08 IST
  Universal time: Thu 2021-05-06 06:26:08 UTC
RTC time: Thu 2021-05-06 06:26:08
   Time zone: Asia/Kolkata (IST, +0530)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

sshuser@hn0-dateti:~$ beeline
0: jdbc:hive2://localhost:10001/default> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+--+
| _c0  |
+--+--+
| 2021-05-06 11:58:53.760 IST  |
+--+--+
1 row selected (1.271 seconds)


*HIVE - 3.1.0*

sshuser@hn0-testja:~$ *timedatectl*
  Local time: Thu 2021-05-06 12:03:32 IST
  Universal time: Thu 2021-05-06 06:33:32 UTC
RTC time: Thu 2021-05-06 06:33:32
   Time zone: Asia/Kolkata (IST, +0530)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

sshuser@hn0-testja:~$ beeline
0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+
| _c0  |
+--+
| *2021-05-06 06:33:59.078 UTC*  |
+--+
1 row selected (13.396 seconds)

0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *set 
hive.local.time.zone=Asia/Kolkata;*
No rows affected (0.025 seconds)
0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+
| _c0  |
+--+
| *2021-05-06 12:08:15.118 UTC*  |
+--+
1 row selected (1.074 seconds)



As part of HIVE-12192 it was decided to have a common time zone for all 
computation i.e. "UTC". Due to which data_format() function was hard coded to 
"UTC".

But later in HIVE-21039 it was decided that user session time zone value should 
be the default not UTC. 

date_format() was not fixed as part of HIVE-21039.

what should be the ideal time zone value of date_format().


Code - 

[jira] [Updated] (HIVE-25093) date_format() UDF is returning values in UTC time zone only

2021-05-06 Thread Ashish Sharma (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-25093?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ashish Sharma updated HIVE-25093:
-
Description: 
*HIVE - 1.2*

sshuser@hn0-dateti:~$ *timedatectl*

  Local time: Thu 2021-05-06 11:56:08 IST
  Universal time: Thu 2021-05-06 06:26:08 UTC
RTC time: Thu 2021-05-06 06:26:08
   Time zone: Asia/Kolkata (IST, +0530)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

sshuser@hn0-dateti:~$ beeline
0: jdbc:hive2://localhost:10001/default> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+--+
| _c0  |
+--+--+
| 2021-05-06 11:58:53.760 IST  |
+--+--+
1 row selected (1.271 seconds)


*HIVE - 3.1.0*

sshuser@hn0-testja:~$ *timedatectl*
  Local time: Thu 2021-05-06 12:03:32 IST
  Universal time: Thu 2021-05-06 06:33:32 UTC
RTC time: Thu 2021-05-06 06:33:32
   Time zone: Asia/Kolkata (IST, +0530)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

sshuser@hn0-testja:~$ beeline
0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+
| _c0  |
+--+
| *2021-05-06 06:33:59.078 UTC*  |
+--+
1 row selected (13.396 seconds)

0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *set 
hive.local.time.zone=Asia/Kolkata;*
No rows affected (0.025 seconds)
0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+
| _c0  |
+--+
| *2021-05-06 12:08:15.118 UTC*  |
+--+
1 row selected (1.074 seconds)



As part of HIVE-12192 it was decided to have a common time zone for all 
computation i.e. "UTC". Due to which data_format() function was hard coded to 
"UTC".

But later in HIVE-21039 it was decided that user session time zone value should 
be the default not UTC. 

date_format() was not fixed as part of HIVE-21039.

what should be the ideal time zone value of date_format().


Code - 
https://github.com/apache/hive/blob/7b3ecf617a6d46f48a3b6f77e0339fd4ad95a420/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateFormat.java

if (fmtStr != null) {
try {
  formatter = new SimpleDateFormat(fmtStr);
 formatter.setCalendar(DateTimeMath.getProlepticGregorianCalendarUTC());
} catch (IllegalArgumentException e) {
  // ignore
}

  was:
*HIVE - 1.2*

sshuser@hn0-dateti:~$ *timedatectl*

  Local time: Thu 2021-05-06 11:56:08 IST
  Universal time: Thu 2021-05-06 06:26:08 UTC
RTC time: Thu 2021-05-06 06:26:08
   Time zone: Asia/Kolkata (IST, +0530)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

sshuser@hn0-dateti:~$ beeline
0: jdbc:hive2://localhost:10001/default> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+--+
| _c0  |
+--+--+
| 2021-05-06 11:58:53.760 IST  |
+--+--+
1 row selected (1.271 seconds)


*HIVE - 3.1.0*

sshuser@hn0-testja:~$ *timedatectl*
  Local time: Thu 2021-05-06 12:03:32 IST
  Universal time: Thu 2021-05-06 06:33:32 UTC
RTC time: Thu 2021-05-06 06:33:32
   Time zone: Asia/Kolkata (IST, +0530)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

sshuser@hn0-testja:~$ beeline
0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+
| _c0  |
+--+
| *2021-05-06 06:33:59.078 UTC*  |
+--+
1 row selected (13.396 seconds)

0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *set 
hive.local.time.zone=Asia/Kolkata;*
No rows affected (0.025 seconds)
0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+
| _c0  |
+--+
|* 2021-05-06 12:08:15.118 UTC*  |
+--+
1 row selected (1.074 seconds)



As part of HIVE-12192 it was decided to have a common time zone for all 
computation i.e. "UTC". Due to which data_format() function was hard coded to 
"UTC".

But later in HIVE-21039 it was decided that user session time zone value should 
be the default not UTC. 

date_format() was not fixed as part of HIVE-21039.

what should be the ideal time zone value of date_format().


Code - 

[jira] [Updated] (HIVE-25093) date_format() UDF is returning values in UTC time zone only

2021-05-06 Thread Ashish Sharma (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-25093?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ashish Sharma updated HIVE-25093:
-
Description: 
*HIVE - 1.2*

sshuser@hn0-dateti:~$ *timedatectl*

  Local time: Thu 2021-05-06 11:56:08 IST
  Universal time: Thu 2021-05-06 06:26:08 UTC
RTC time: Thu 2021-05-06 06:26:08
   Time zone: Asia/Kolkata (IST, +0530)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

sshuser@hn0-dateti:~$ beeline
0: jdbc:hive2://localhost:10001/default> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+--+
| _c0  |
+--+--+
| 2021-05-06 11:58:53.760 IST  |
+--+--+
1 row selected (1.271 seconds)


*HIVE - 3.1.0*

sshuser@hn0-testja:~$ *timedatectl*
  Local time: Thu 2021-05-06 12:03:32 IST
  Universal time: Thu 2021-05-06 06:33:32 UTC
RTC time: Thu 2021-05-06 06:33:32
   Time zone: Asia/Kolkata (IST, +0530)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

sshuser@hn0-testja:~$ beeline
0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+
| _c0  |
+--+
| *2021-05-06 06:33:59.078 UTC*  |
+--+
1 row selected (13.396 seconds)

0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *set 
hive.local.time.zone=Asia/Kolkata;*
No rows affected (0.025 seconds)
0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+
| _c0  |
+--+
|* 2021-05-06 12:08:15.118 UTC*  |
+--+
1 row selected (1.074 seconds)



As part of HIVE-12192 it was decided to have a common time zone for all 
computation i.e. "UTC". Due to which data_format() function was hard coded to 
"UTC".

But later in HIVE-21039 it was decided that user session time zone value should 
be the default not UTC. 

date_format() was not fixed as part of HIVE-21039.

what should be the ideal time zone value of date_format().


Code - 
https://github.com/apache/hive/blob/7b3ecf617a6d46f48a3b6f77e0339fd4ad95a420/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateFormat.java

if (fmtStr != null) {
try {
  formatter = new SimpleDateFormat(fmtStr);
 formatter.setCalendar(DateTimeMath.getProlepticGregorianCalendarUTC());
} catch (IllegalArgumentException e) {
  // ignore
}

  was:
*HIVE - 1.2*

sshuser@hn0-dateti:~$ *timedatectl*

  Local time: Thu 2021-05-06 11:56:08 IST
  Universal time: Thu 2021-05-06 06:26:08 UTC
RTC time: Thu 2021-05-06 06:26:08
   Time zone: Asia/Kolkata (IST, +0530)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

sshuser@hn0-dateti:~$ beeline
0: jdbc:hive2://localhost:10001/default> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+--+
| _c0  |
+--+--+
| 2021-05-06 11:58:53.760 IST  |
+--+--+
1 row selected (1.271 seconds)


*HIVE - 3.1.0*

sshuser@hn0-testja:~$ *timedatectl*
  Local time: Thu 2021-05-06 12:03:32 IST
  Universal time: Thu 2021-05-06 06:33:32 UTC
RTC time: Thu 2021-05-06 06:33:32
   Time zone: Asia/Kolkata (IST, +0530)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

sshuser@hn0-testja:~$ beeline
0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+
| _c0  |
+--+
| *2021-05-06 06:33:59.078 UTC*  |
+--+
1 row selected (13.396 seconds)

0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *set 
hive.local.time.zone=Asia/Kolkata;*
No rows affected (0.025 seconds)
0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+
| _c0  |
+--+
|* 2021-05-06 12:08:15.118 UTC*  |
+--+
1 row selected (1.074 seconds)



As part of HIVE-12192 it was decided to have a common time zone for all 
computation i.e. "UTC". Due to which data_format() function was hard coded to 
"UTC".

But later in HIVE-21039 it was decided that user session time zone value should 
be the default not UTC. 

date_format() was not fixed as part of HIVE-21039.

what should be the ideal time zone value of date_format().


Code - 

[jira] [Commented] (HIVE-25093) date_format() UDF is returning values in UTC time zone only

2021-05-06 Thread Ashish Sharma (Jira)


[ 
https://issues.apache.org/jira/browse/HIVE-25093?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17340030#comment-17340030
 ] 

Ashish Sharma commented on HIVE-25093:
--

[~zabetak] updated the description

> date_format() UDF is returning values in UTC time zone only 
> 
>
> Key: HIVE-25093
> URL: https://issues.apache.org/jira/browse/HIVE-25093
> Project: Hive
>  Issue Type: Bug
>  Components: UDF
>Affects Versions: 3.1.2
>Reporter: Ashish Sharma
>Assignee: Ashish Sharma
>Priority: Trivial
>
> *HIVE - 1.2*
> sshuser@hn0-dateti:~$ *timedatectl*
>   Local time: Thu 2021-05-06 11:56:08 IST
>   Universal time: Thu 2021-05-06 06:26:08 UTC
> RTC time: Thu 2021-05-06 06:26:08
>Time zone: Asia/Kolkata (IST, +0530)
>  Network time on: yes
> NTP synchronized: yes
>  RTC in local TZ: no
> sshuser@hn0-dateti:~$ beeline
> 0: jdbc:hive2://localhost:10001/default> *select 
> date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
> +--+--+
> | _c0  |
> +--+--+
> | 2021-05-06 11:58:53.760 IST  |
> +--+--+
> 1 row selected (1.271 seconds)
> *HIVE - 3.1.0*
> sshuser@hn0-testja:~$ *timedatectl*
>   Local time: Thu 2021-05-06 12:03:32 IST
>   Universal time: Thu 2021-05-06 06:33:32 UTC
> RTC time: Thu 2021-05-06 06:33:32
>Time zone: Asia/Kolkata (IST, +0530)
>  Network time on: yes
> NTP synchronized: yes
>  RTC in local TZ: no
> sshuser@hn0-testja:~$ beeline
> 0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *select 
> date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
> +--+
> | _c0  |
> +--+
> | *2021-05-06 06:33:59.078 UTC*  |
> +--+
> 1 row selected (13.396 seconds)
> 0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *set 
> hive.local.time.zone=Asia/Kolkata;*
> No rows affected (0.025 seconds)
> 0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *select 
> date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
> +--+
> | _c0  |
> +--+
> |* 2021-05-06 12:08:15.118 UTC*  |
> +--+
> 1 row selected (1.074 seconds)
> As part of HIVE-12192 it was decided to have a common time zone for all 
> computation i.e. "UTC". Due to which data_format() function was hard coded to 
> "UTC".
> But later in HIVE-21039 it was decided that user session time zone value 
> should be the default not UTC. 
> date_format() was not fixed as part of HIVE-21039.
> what should be the ideal time zone value of date_format().
> Code - 
> https://github.com/apache/hive/blob/7b3ecf617a6d46f48a3b6f77e0339fd4ad95a420/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateFormat.java
> if (fmtStr != null) {
> try {
>   formatter = new SimpleDateFormat(fmtStr);
>  
> formatter.setCalendar(DateTimeMath.getProlepticGregorianCalendarUTC());
> } catch (IllegalArgumentException e) {
>   // ignore
> }



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (HIVE-25093) date_format() UDF is returning values in UTC time zone only

2021-05-06 Thread Ashish Sharma (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-25093?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ashish Sharma updated HIVE-25093:
-
Description: 
*HIVE - 1.2*

sshuser@hn0-dateti:~$ *timedatectl*

  Local time: Thu 2021-05-06 11:56:08 IST
  Universal time: Thu 2021-05-06 06:26:08 UTC
RTC time: Thu 2021-05-06 06:26:08
   Time zone: Asia/Kolkata (IST, +0530)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

sshuser@hn0-dateti:~$ beeline
0: jdbc:hive2://localhost:10001/default> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+--+
| _c0  |
+--+--+
| 2021-05-06 11:58:53.760 IST  |
+--+--+
1 row selected (1.271 seconds)


*HIVE - 3.1.0*

sshuser@hn0-testja:~$ *timedatectl*
  Local time: Thu 2021-05-06 12:03:32 IST
  Universal time: Thu 2021-05-06 06:33:32 UTC
RTC time: Thu 2021-05-06 06:33:32
   Time zone: Asia/Kolkata (IST, +0530)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

sshuser@hn0-testja:~$ beeline
0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+
| _c0  |
+--+
| *2021-05-06 06:33:59.078 UTC*  |
+--+
1 row selected (13.396 seconds)

0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *set 
hive.local.time.zone=Asia/Kolkata;*
No rows affected (0.025 seconds)
0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+
| _c0  |
+--+
|* 2021-05-06 12:08:15.118 UTC*  |
+--+
1 row selected (1.074 seconds)



As part of HIVE-12192 it was decided to have a common time zone for all 
computation i.e. "UTC". Due to which data_format() function was hard coded to 
"UTC".

But later in HIVE-21039 it was decided that user session time zone value should 
be the default not UTC. 

date_format() was not fixed as part of HIVE-21039.

what should be the ideal time zone value of date_format().


Code - 
https://github.com/apache/hive/blob/7b3ecf617a6d46f48a3b6f77e0339fd4ad95a420/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateFormat.java

if (fmtStr != null) {
try {
  formatter = new SimpleDateFormat(fmtStr);
 * 
formatter.setCalendar(DateTimeMath.getProlepticGregorianCalendarUTC());*
} catch (IllegalArgumentException e) {
  // ignore
}



  was:
*HIVE - 1.2*

sshuser@hn0-dateti:~$ *timedatectl*

  Local time: Thu 2021-05-06 11:56:08 IST
  Universal time: Thu 2021-05-06 06:26:08 UTC
RTC time: Thu 2021-05-06 06:26:08
   Time zone: Asia/Kolkata (IST, +0530)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

sshuser@hn0-dateti:~$ beeline
0: jdbc:hive2://localhost:10001/default> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+--+
| _c0  |
+--+--+
| 2021-05-06 11:58:53.760 IST  |
+--+--+
1 row selected (1.271 seconds)


*HIVE - 3.1.0*

sshuser@hn0-testja:~$ *timedatectl*
  Local time: Thu 2021-05-06 12:03:32 IST
  Universal time: Thu 2021-05-06 06:33:32 UTC
RTC time: Thu 2021-05-06 06:33:32
   Time zone: Asia/Kolkata (IST, +0530)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

sshuser@hn0-testja:~$ beeline
0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+
| _c0  |
+--+
| *2021-05-06 06:33:59.078 UTC*  |
+--+
1 row selected (13.396 seconds)

0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *set 
hive.local.time.zone=Asia/Kolkata;*
No rows affected (0.025 seconds)
0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+
| _c0  |
+--+
|* 2021-05-06 12:08:15.118 UTC*  |
+--+
1 row selected (1.074 seconds)



As part of HIVE-12192 it was decided to have a common time zone for all 
computation i.e. "UTC". Due to which data_format() function was hard coded to 
"UTC".

But later in HIVE-21039 it was decided that user session time zone value should 
be the default not UTC. 

date_format() was not fixed as part of HIVE-21039.

what should be the ideal time zone value of date_format().


> date_format() UDF is returning values in UTC time zone only 
> 
>
> 

[jira] [Updated] (HIVE-25093) date_format() UDF is returning values in UTC time zone only

2021-05-06 Thread Ashish Sharma (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-25093?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ashish Sharma updated HIVE-25093:
-
Description: 
*HIVE - 1.2*

sshuser@hn0-dateti:~$ *timedatectl*

  Local time: Thu 2021-05-06 11:56:08 IST
  Universal time: Thu 2021-05-06 06:26:08 UTC
RTC time: Thu 2021-05-06 06:26:08
   Time zone: Asia/Kolkata (IST, +0530)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

sshuser@hn0-dateti:~$ beeline
0: jdbc:hive2://localhost:10001/default> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+--+
| _c0  |
+--+--+
| 2021-05-06 11:58:53.760 IST  |
+--+--+
1 row selected (1.271 seconds)


*HIVE - 3.1.0*

sshuser@hn0-testja:~$ *timedatectl*
  Local time: Thu 2021-05-06 12:03:32 IST
  Universal time: Thu 2021-05-06 06:33:32 UTC
RTC time: Thu 2021-05-06 06:33:32
   Time zone: Asia/Kolkata (IST, +0530)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

sshuser@hn0-testja:~$ beeline
0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+
| _c0  |
+--+
| *2021-05-06 06:33:59.078 UTC*  |
+--+
1 row selected (13.396 seconds)

0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *set 
hive.local.time.zone=Asia/Kolkata;*
No rows affected (0.025 seconds)
0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+
| _c0  |
+--+
|* 2021-05-06 12:08:15.118 UTC*  |
+--+
1 row selected (1.074 seconds)



As part of HIVE-12192 it was decided to have a common time zone for all 
computation i.e. "UTC". Due to which data_format() function was hard coded to 
"UTC".

But later in HIVE-21039 it was decided that user session time zone value should 
be the default not UTC. 

date_format() was not fixed as part of HIVE-21039.

what should be the ideal time zone value of date_format().

  was:
*HIVE - 1.2*

sshuser@hn0-dateti:~$ *timedatectl*

  Local time: Thu 2021-05-06 11:56:08 IST
  Universal time: Thu 2021-05-06 06:26:08 UTC
RTC time: Thu 2021-05-06 06:26:08
   Time zone: Asia/Kolkata (IST, +0530)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

sshuser@hn0-dateti:~$ beeline
0: jdbc:hive2://localhost:10001/default> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+--+
| _c0  |
+--+--+
| 2021-05-06 11:58:53.760 IST  |
+--+--+
1 row selected (1.271 seconds)


*HIVE - 3.1.0*

sshuser@hn0-testja:~$ *timedatectl*
  Local time: Thu 2021-05-06 12:03:32 IST
  Universal time: Thu 2021-05-06 06:33:32 UTC
RTC time: Thu 2021-05-06 06:33:32
   Time zone: Asia/Kolkata (IST, +0530)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

sshuser@hn0-testja:~$ beeline
0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+
| _c0  |
+--+
| *2021-05-06 06:33:59.078 UTC*  |
+--+
1 row selected (13.396 seconds)

0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> set 
hive.local.time.zone=Asia/Kolkata;
No rows affected (0.025 seconds)
0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");
+--+
| _c0  |
+--+
| 2021-05-06 12:08:15.118 UTC  |
+--+
1 row selected (1.074 seconds)



As part of HIVE-12192 it was decided to have a common time zone for all 
computation i.e. "UTC". Due to which data_format() function was hard coded to 
"UTC".

But later in HIVE-21039 it was decided that user session time zone value should 
be the default not UTC. 

date_format() was not fixed as part of HIVE-21039.

what should be the ideal time zone value of date_format().


> date_format() UDF is returning values in UTC time zone only 
> 
>
> Key: HIVE-25093
> URL: https://issues.apache.org/jira/browse/HIVE-25093
> Project: Hive
>  Issue Type: Bug
>  Components: UDF
>Affects Versions: 3.1.2
>Reporter: Ashish Sharma
>Assignee: Ashish Sharma
>Priority: Trivial
>
> *HIVE - 1.2*
> sshuser@hn0-dateti:~$ *timedatectl*
>   Local time: Thu 2021-05-06 11:56:08 IST
>   Universal 

[jira] [Updated] (HIVE-25093) date_format() UDF is returning values in UTC time zone only

2021-05-06 Thread Ashish Sharma (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-25093?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ashish Sharma updated HIVE-25093:
-
Description: 
*HIVE - 1.2*

sshuser@hn0-dateti:~$ *timedatectl*

  Local time: Thu 2021-05-06 11:56:08 IST
  Universal time: Thu 2021-05-06 06:26:08 UTC
RTC time: Thu 2021-05-06 06:26:08
   Time zone: Asia/Kolkata (IST, +0530)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

sshuser@hn0-dateti:~$ beeline
0: jdbc:hive2://localhost:10001/default> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+--+
| _c0  |
+--+--+
| 2021-05-06 11:58:53.760 IST  |
+--+--+
1 row selected (1.271 seconds)


*HIVE - 3.1.0*

sshuser@hn0-testja:~$ *timedatectl*
  Local time: Thu 2021-05-06 12:03:32 IST
  Universal time: Thu 2021-05-06 06:33:32 UTC
RTC time: Thu 2021-05-06 06:33:32
   Time zone: Asia/Kolkata (IST, +0530)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

sshuser@hn0-testja:~$ beeline
0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> *select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
+--+
| _c0  |
+--+
| *2021-05-06 06:33:59.078 UTC*  |
+--+
1 row selected (13.396 seconds)

0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> set 
hive.local.time.zone=Asia/Kolkata;
No rows affected (0.025 seconds)
0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");
+--+
| _c0  |
+--+
| 2021-05-06 12:08:15.118 UTC  |
+--+
1 row selected (1.074 seconds)



As part of HIVE-12192 it was decided to have a common time zone for all 
computation i.e. "UTC". Due to which data_format() function was hard coded to 
"UTC".

But later in HIVE-21039 it was decided that user session time zone value should 
be the default not UTC. 

date_format() was not fixed as part of HIVE-21039.

what should be the ideal time zone value of date_format().

  was:
HIVE - 3.1.0

sshuser@hn0-testja:~$ timedatectl
  Local time: Thu 2021-05-06 12:03:32 IST
  Universal time: Thu 2021-05-06 06:33:32 UTC
RTC time: Thu 2021-05-06 06:33:32
   Time zone: Asia/Kolkata (IST, +0530)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

sshuser@hn0-testja:~$ beeline
0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");
+--+
| _c0  |
+--+
| 2021-05-06 06:33:59.078 UTC  |
+--+
1 row selected (13.396 seconds)





HIVE - 1.2



sshuser@hn0-dateti:~$ timedatectl

  Local time: Thu 2021-05-06 11:56:08 IST
  Universal time: Thu 2021-05-06 06:26:08 UTC
RTC time: Thu 2021-05-06 06:26:08
   Time zone: Asia/Kolkata (IST, +0530)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

sshuser@hn0-dateti:~$ beeline
0: jdbc:hive2://localhost:10001/default> select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");
+--+--+
| _c0  |
+--+--+
| 2021-05-06 11:58:53.760 IST  |
+--+--+
1 row selected (1.271 seconds)

As part of HIVE-12192 it was decided to have a common time zone for all 
computation i.e. "UTC". Due to which data_format() function was hard coded to 
"UTC".

But later in HIVE-21039 it was decided that user session time zone value should 
be the default not UTC. 

date_format() was not fixed as part of HIVE-21039.

what should be the ideal time zone value of date_format().


> date_format() UDF is returning values in UTC time zone only 
> 
>
> Key: HIVE-25093
> URL: https://issues.apache.org/jira/browse/HIVE-25093
> Project: Hive
>  Issue Type: Bug
>  Components: UDF
>Affects Versions: 3.1.2
>Reporter: Ashish Sharma
>Assignee: Ashish Sharma
>Priority: Trivial
>
> *HIVE - 1.2*
> sshuser@hn0-dateti:~$ *timedatectl*
>   Local time: Thu 2021-05-06 11:56:08 IST
>   Universal time: Thu 2021-05-06 06:26:08 UTC
> RTC time: Thu 2021-05-06 06:26:08
>Time zone: Asia/Kolkata (IST, +0530)
>  Network time on: yes
> NTP synchronized: yes
>  RTC in local TZ: no
> sshuser@hn0-dateti:~$ beeline
> 0: jdbc:hive2://localhost:10001/default> *select 
> date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");*
> +--+--+
> | _c0  |
> +--+--+

[jira] [Updated] (HIVE-25093) date_format() UDF is returning values in UTC time zone only

2021-05-06 Thread Ashish Sharma (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-25093?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ashish Sharma updated HIVE-25093:
-
Description: 
HIVE - 3.1.0

sshuser@hn0-testja:~$ timedatectl
  Local time: Thu 2021-05-06 12:03:32 IST
  Universal time: Thu 2021-05-06 06:33:32 UTC
RTC time: Thu 2021-05-06 06:33:32
   Time zone: Asia/Kolkata (IST, +0530)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

sshuser@hn0-testja:~$ beeline
0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");
+--+
| _c0  |
+--+
| 2021-05-06 06:33:59.078 UTC  |
+--+
1 row selected (13.396 seconds)





HIVE - 1.2



sshuser@hn0-dateti:~$ timedatectl

  Local time: Thu 2021-05-06 11:56:08 IST
  Universal time: Thu 2021-05-06 06:26:08 UTC
RTC time: Thu 2021-05-06 06:26:08
   Time zone: Asia/Kolkata (IST, +0530)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

sshuser@hn0-dateti:~$ beeline
0: jdbc:hive2://localhost:10001/default> select 
date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");
+--+--+
| _c0  |
+--+--+
| 2021-05-06 11:58:53.760 IST  |
+--+--+
1 row selected (1.271 seconds)

As part of HIVE-12192 it was decided to have a common time zone for all 
computation i.e. "UTC". Due to which data_format() function was hard coded to 
"UTC".

But later in HIVE-21039 it was decided that user session time zone value should 
be the default not UTC. 

date_format() was not fixed as part of HIVE-21039.

what should be the ideal time zone value of date_format().

  was:
Query - select date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z")

Result - 2021-05-04 13:00:33.358 UTC

As part of HIVE-12192 it was decided to have a common time zone for all 
computation i.e. "UTC". Due to which data_format() function was hard coded to 
"UTC".

But later in HIVE-21039 it was decided that user session time zone value should 
be the default not UTC. 

date_format() was not fixed as part of HIVE-21039.

what should be the ideal time zone value of date_format().


> date_format() UDF is returning values in UTC time zone only 
> 
>
> Key: HIVE-25093
> URL: https://issues.apache.org/jira/browse/HIVE-25093
> Project: Hive
>  Issue Type: Bug
>  Components: UDF
>Affects Versions: 3.1.2
>Reporter: Ashish Sharma
>Assignee: Ashish Sharma
>Priority: Trivial
>
> HIVE - 3.1.0
> sshuser@hn0-testja:~$ timedatectl
>   Local time: Thu 2021-05-06 12:03:32 IST
>   Universal time: Thu 2021-05-06 06:33:32 UTC
> RTC time: Thu 2021-05-06 06:33:32
>Time zone: Asia/Kolkata (IST, +0530)
>  Network time on: yes
> NTP synchronized: yes
>  RTC in local TZ: no
> sshuser@hn0-testja:~$ beeline
> 0: jdbc:hive2://zk0-testja.e0mrrixnyxde5h1suy> select 
> date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");
> +--+
> | _c0  |
> +--+
> | 2021-05-06 06:33:59.078 UTC  |
> +--+
> 1 row selected (13.396 seconds)
> HIVE - 1.2
> sshuser@hn0-dateti:~$ timedatectl
>   Local time: Thu 2021-05-06 11:56:08 IST
>   Universal time: Thu 2021-05-06 06:26:08 UTC
> RTC time: Thu 2021-05-06 06:26:08
>Time zone: Asia/Kolkata (IST, +0530)
>  Network time on: yes
> NTP synchronized: yes
>  RTC in local TZ: no
> sshuser@hn0-dateti:~$ beeline
> 0: jdbc:hive2://localhost:10001/default> select 
> date_format(current_timestamp,"-MM-dd HH:mm:ss.SSS z");
> +--+--+
> | _c0  |
> +--+--+
> | 2021-05-06 11:58:53.760 IST  |
> +--+--+
> 1 row selected (1.271 seconds)
> As part of HIVE-12192 it was decided to have a common time zone for all 
> computation i.e. "UTC". Due to which data_format() function was hard coded to 
> "UTC".
> But later in HIVE-21039 it was decided that user session time zone value 
> should be the default not UTC. 
> date_format() was not fixed as part of HIVE-21039.
> what should be the ideal time zone value of date_format().



--
This message was sent by Atlassian Jira
(v8.3.4#803005)