[jira] [Commented] (HIVE-3850) hour() function returns 12 hour clock value when using timestamp datatype
[ https://issues.apache.org/jira/browse/HIVE-3850?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13567708#comment-13567708 ] Pieterjan Vriends commented on HIVE-3850: - Sorry about that. I must admit I'm quite new to this. > hour() function returns 12 hour clock value when using timestamp datatype > - > > Key: HIVE-3850 > URL: https://issues.apache.org/jira/browse/HIVE-3850 > Project: Hive > Issue Type: Bug > Components: UDF >Affects Versions: 0.9.0, 0.10.0 >Reporter: Pieterjan Vriends > Fix For: 0.11.0 > > Attachments: HIVE-3850.patch.txt > > > Apparently UDFHour.java does have two evaluate() functions. One that does > accept a Text object as parameter and one that does use a TimeStampWritable > object as parameter. The first function does return the value of > Calendar.HOUR_OF_DAY and the second one of Calendar.HOUR. In the > documentation I couldn't find any information on the overload of the > evaluation function. I did spent quite some time finding out why my statement > didn't return a 24 hour clock value. > Shouldn't both functions return the same? -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (HIVE-3850) hour() function returns 12 hour clock value when using timestamp datatype
[ https://issues.apache.org/jira/browse/HIVE-3850?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Pieterjan Vriends resolved HIVE-3850. - Resolution: Fixed > hour() function returns 12 hour clock value when using timestamp datatype > - > > Key: HIVE-3850 > URL: https://issues.apache.org/jira/browse/HIVE-3850 > Project: Hive > Issue Type: Bug > Components: UDF >Affects Versions: 0.9.0 >Reporter: Pieterjan Vriends > Attachments: HIVE-3850.patch.txt > > > Apparently UDFHour.java does have two evaluate() functions. One that does > accept a Text object as parameter and one that does use a TimeStampWritable > object as parameter. The first function does return the value of > Calendar.HOUR_OF_DAY and the second one of Calendar.HOUR. In the > documentation I couldn't find any information on the overload of the > evaluation function. I did spent quite some time finding out why my statement > didn't return a 24 hour clock value. > Shouldn't both functions return the same? -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HIVE-3850) hour() function returns 12 hour clock value when using timestamp datatype
[ https://issues.apache.org/jira/browse/HIVE-3850?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13564350#comment-13564350 ] Pieterjan Vriends commented on HIVE-3850: - >From the source code: public IntWritable evaluate(Text dateString) { if (dateString == null) { return null; } try { Date date = null; try { date = formatter1.parse(dateString.toString()); } catch (ParseException e) { date = formatter2.parse(dateString.toString()); } calendar.setTime(date); result.set(calendar.get(Calendar.HOUR_OF_DAY)); return result; } catch (ParseException e) { return null; } } public IntWritable evaluate(TimestampWritable t) { if (t == null) { return null; } calendar.setTime(t.getTimestamp()); result.set(calendar.get(Calendar.HOUR)); return result; } As you can see, the second evaluate() method returns the value of Calendar.HOUR instead of Calendar.HOUR_OF_DAY. > hour() function returns 12 hour clock value when using timestamp datatype > - > > Key: HIVE-3850 > URL: https://issues.apache.org/jira/browse/HIVE-3850 > Project: Hive > Issue Type: Bug > Components: UDF >Affects Versions: 0.9.0 >Reporter: Pieterjan Vriends > > Apparently UDFHour.java does have two evaluate() functions. One that does > accept a Text object as parameter and one that does use a TimeStampWritable > object as parameter. The first function does return the value of > Calendar.HOUR_OF_DAY and the second one of Calendar.HOUR. In the > documentation I couldn't find any information on the overload of the > evaluation function. I did spent quite some time finding out why my statement > didn't return a 24 hour clock value. > Shouldn't both functions return the same? -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HIVE-3850) hour() function returns 12 hour clock value when using timestamp datatype
[ https://issues.apache.org/jira/browse/HIVE-3850?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13564348#comment-13564348 ] Pieterjan Vriends commented on HIVE-3850: - I stumbled up on the problem when I queried using the hour() function on an existing field that was declared as a TIMESTAMP, not a STRING. SELECT hour(mytimstampfield) FROM mytable;. When the field is declared as a STRING or as in your example you provide a STRING the query will indeed return an 24 hour value as expected. The overloaded evaluation function that accepts a TIMESTAMP will return a 12 hour value. > hour() function returns 12 hour clock value when using timestamp datatype > - > > Key: HIVE-3850 > URL: https://issues.apache.org/jira/browse/HIVE-3850 > Project: Hive > Issue Type: Bug > Components: UDF >Affects Versions: 0.9.0 >Reporter: Pieterjan Vriends > > Apparently UDFHour.java does have two evaluate() functions. One that does > accept a Text object as parameter and one that does use a TimeStampWritable > object as parameter. The first function does return the value of > Calendar.HOUR_OF_DAY and the second one of Calendar.HOUR. In the > documentation I couldn't find any information on the overload of the > evaluation function. I did spent quite some time finding out why my statement > didn't return a 24 hour clock value. > Shouldn't both functions return the same? -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HIVE-3850) hour() function returns 12 hour clock value when using timestamp datatype
[ https://issues.apache.org/jira/browse/HIVE-3850?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Pieterjan Vriends updated HIVE-3850: Issue Type: Bug (was: Improvement) > hour() function returns 12 hour clock value when using timestamp datatype > - > > Key: HIVE-3850 > URL: https://issues.apache.org/jira/browse/HIVE-3850 > Project: Hive > Issue Type: Bug > Components: UDF >Affects Versions: 0.9.0 >Reporter: Pieterjan Vriends > > Apparently UDFHour.java does have two evaluate() functions. One that does > accept a Text object as parameter and one that does use a TimeStampWritable > object as parameter. The first function does return the value of > Calendar.HOUR_OF_DAY and the second one of Calendar.HOUR. In the > documentation I couldn't find any information on the overload of the > evaluation function. I did spent quite some time finding out why my statement > didn't return a 24 hour clock value. > Shouldn't both functions return the same? -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HIVE-3850) hour() function returns 12 hour clock value when using timestamp datatype
[ https://issues.apache.org/jira/browse/HIVE-3850?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Pieterjan Vriends updated HIVE-3850: Summary: hour() function returns 12 hour clock value when using timestamp datatype (was: hour() function returns 12 hour clock value when using timestamp) > hour() function returns 12 hour clock value when using timestamp datatype > - > > Key: HIVE-3850 > URL: https://issues.apache.org/jira/browse/HIVE-3850 > Project: Hive > Issue Type: Improvement > Components: UDF >Affects Versions: 0.9.0 >Reporter: Pieterjan Vriends > > Apparently UDFHour.java does have two evaluate() functions. One that does > accept a Text object as parameter and one that does use a TimeStampWritable > object as parameter. The first function does return the value of > Calendar.HOUR_OF_DAY and the second one of Calendar.HOUR. In the > documentation I couldn't find any information on the overload of the > evaluation function. I did spent quite some time finding out why my statement > didn't return a 24 hour clock value. > Shouldn't both functions return the same? -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HIVE-3850) hour() function returns 12 hour clock value when using timestamp
[ https://issues.apache.org/jira/browse/HIVE-3850?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Pieterjan Vriends updated HIVE-3850: Description: Apparently UDFHour.java does have two evaluate() functions. One that does accept a Text object as parameter and one that does use a TimeStampWritable object as parameter. The first function does return the value of Calendar.HOUR_OF_DAY and the second one of Calendar.HOUR. In the documentation I couldn't find any information on the overload of the evaluation function. I did spent quite some time finding out why my statement didn't return a 24 hour clock value. Shouldn't both functions return the same? was: Apparently UDFHour.java does have two evaluate() functions. One that does accept a Text object as parameter and one that does use a TimeStampWritable object as parameter. The first function does return the value of Calendar.HOUR_OF_DAY and the second one of Calendar.HOUR. In the documentation I couldn't find any information on the overload of the evaluation function. I did spent quite some time finding out why my statement didn't return a 24 hour clock value. > hour() function returns 12 hour clock value when using timestamp > > > Key: HIVE-3850 > URL: https://issues.apache.org/jira/browse/HIVE-3850 > Project: Hive > Issue Type: Improvement > Components: UDF >Affects Versions: 0.9.0 >Reporter: Pieterjan Vriends > > Apparently UDFHour.java does have two evaluate() functions. One that does > accept a Text object as parameter and one that does use a TimeStampWritable > object as parameter. The first function does return the value of > Calendar.HOUR_OF_DAY and the second one of Calendar.HOUR. In the > documentation I couldn't find any information on the overload of the > evaluation function. I did spent quite some time finding out why my statement > didn't return a 24 hour clock value. > Shouldn't both functions return the same? -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HIVE-3850) hour() function returns 12 hour clock value when using timestamp
[ https://issues.apache.org/jira/browse/HIVE-3850?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Pieterjan Vriends updated HIVE-3850: Affects Version/s: 0.9.0 > hour() function returns 12 hour clock value when using timestamp > > > Key: HIVE-3850 > URL: https://issues.apache.org/jira/browse/HIVE-3850 > Project: Hive > Issue Type: Improvement > Components: UDF >Affects Versions: 0.9.0 >Reporter: Pieterjan Vriends > > Apparently UDFHour.java does have two evaluate() functions. One that does > accept a Text object as parameter and one that does use a TimeStampWritable > object as parameter. The first function does return the value of > Calendar.HOUR_OF_DAY and the second one of Calendar.HOUR. In the > documentation I couldn't find any information on the overload of the > evaluation function. I did spent quite some time finding out why my statement > didn't return a 24 hour clock value. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HIVE-3850) hour() function returns 12 hour clock value when using timestamp
[ https://issues.apache.org/jira/browse/HIVE-3850?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Pieterjan Vriends updated HIVE-3850: Summary: hour() function returns 12 hour clock value when using timestamp (was: hour() function returns 12 hour clock value when using timestamp datatype.) > hour() function returns 12 hour clock value when using timestamp > > > Key: HIVE-3850 > URL: https://issues.apache.org/jira/browse/HIVE-3850 > Project: Hive > Issue Type: Improvement > Components: UDF >Reporter: Pieterjan Vriends >Priority: Minor > > Apparently UDFHour.java does have two evaluate() functions. One that does > accept a Text object as parameter and one that does use a TimeStampWritable > object as parameter. The first function does return the value of > Calendar.HOUR_OF_DAY and the second one of Calendar.HOUR. In the > documentation I couldn't find any information on the overload of the > evaluation function. I did spent quite some time finding out why my statement > didn't return a 24 hour clock value. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (HIVE-3850) hour() function returns 12 hour clock value when using timestamp
[ https://issues.apache.org/jira/browse/HIVE-3850?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Pieterjan Vriends updated HIVE-3850: Priority: Major (was: Minor) > hour() function returns 12 hour clock value when using timestamp > > > Key: HIVE-3850 > URL: https://issues.apache.org/jira/browse/HIVE-3850 > Project: Hive > Issue Type: Improvement > Components: UDF >Reporter: Pieterjan Vriends > > Apparently UDFHour.java does have two evaluate() functions. One that does > accept a Text object as parameter and one that does use a TimeStampWritable > object as parameter. The first function does return the value of > Calendar.HOUR_OF_DAY and the second one of Calendar.HOUR. In the > documentation I couldn't find any information on the overload of the > evaluation function. I did spent quite some time finding out why my statement > didn't return a 24 hour clock value. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Created] (HIVE-3850) hour() function returns 12 hour clock value when using timestamp datatype.
Pieterjan Vriends created HIVE-3850: --- Summary: hour() function returns 12 hour clock value when using timestamp datatype. Key: HIVE-3850 URL: https://issues.apache.org/jira/browse/HIVE-3850 Project: Hive Issue Type: Improvement Components: UDF Reporter: Pieterjan Vriends Priority: Minor Apparently UDFHour.java does have two evaluate() functions. One that does accept a Text object as parameter and one that does use a TimeStampWritable object as parameter. The first function does return the value of Calendar.HOUR_OF_DAY and the second one of Calendar.HOUR. In the documentation I couldn't find any information on the overload of the evaluation function. I did spent quite some time finding out why my statement didn't return a 24 hour clock value. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira