Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 0.9.0
    • Fix Version/s: None
    • Component/s: UDF
    • Labels:

      Description

      dayname(date/timestamp/string)

      Returns the name of the weekday for date. The language used for the name is English.

      select dayname('2015-04-08');
      Wednesday

      1. udf_dayname.q.out
        4 kB
        Namitha Babychan
      2. udf_dayname.q
        0.6 kB
        Namitha Babychan
      3. HIVE-3299.patch.txt
        11 kB
        Ann Dominic
      4. HIVE-3299.5.patch
        18 kB
        Alexander Pivovarov
      5. HIVE-3299.4.patch
        18 kB
        Alexander Pivovarov
      6. HIVE-3299.3.patch
        18 kB
        Alexander Pivovarov
      7. HIVE-3299.2.patch
        18 kB
        Alexander Pivovarov
      8. HIVE-3299.1.patch.txt
        14 kB
        Namitha Babychan
      9. Hive-3299_Testcase.doc
        26 kB
        Namitha Babychan

        Issue Links

          Activity

          Alexander Pivovarov made changes -
          Status Patch Available [ 10002 ] Resolved [ 5 ]
          Resolution Duplicate [ 3 ]
          Alexander Pivovarov made changes -
          Status In Progress [ 3 ] Patch Available [ 10002 ]
          Alexander Pivovarov made changes -
          Attachment HIVE-3299.5.patch [ 12724305 ]
          Alexander Pivovarov made changes -
          Status Patch Available [ 10002 ] In Progress [ 3 ]
          Alexander Pivovarov made changes -
          Status In Progress [ 3 ] Patch Available [ 10002 ]
          Alexander Pivovarov made changes -
          Attachment HIVE-3299.4.patch [ 12724272 ]
          Alexander Pivovarov made changes -
          Status Patch Available [ 10002 ] In Progress [ 3 ]
          Alexander Pivovarov made changes -
          Status In Progress [ 3 ] Patch Available [ 10002 ]
          Alexander Pivovarov made changes -
          Attachment HIVE-3299.3.patch [ 12724134 ]
          Alexander Pivovarov made changes -
          Status Patch Available [ 10002 ] In Progress [ 3 ]
          Alexander Pivovarov made changes -
          Link This issue is related to HIVE-10276 [ HIVE-10276 ]
          Alexander Pivovarov made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Alexander Pivovarov made changes -
          Attachment HIVE-3299.2.patch [ 12723992 ]
          Alexander Pivovarov made changes -
          Remote Link This issue links to "https://reviews.apache.org/r/32985/ (Web Link)" [ 24997 ]
          Alexander Pivovarov made changes -
          Summary UDF DAYNAME(date) to HIVE Create UDF DAYNAME(date)
          Alexander Pivovarov made changes -
          Assignee Alexander Pivovarov [ apivovarov ]
          Alexander Pivovarov made changes -
          Description Current releases of Hive lacks a function which would return the day name corresponding to a date / timestamp value which might be a part of a column.
          The function -DAYNAME (date) would return the day name from a date / timestamp or column which would be useful while using HiveQL. This would find its use in various business sectors like retail, which would help in identifying the trends and sales datails for a particular weekday for entire year,month or week.


          Functionality :-

          Function Name: DAYNAME (date)

          Returns the name of the weekday for date.
          Example: hive> SELECT DAYNAME('2012-07-25');
                             -> 'Wednesday'

          Usage :-

          Case 1 : To find DAY NAME corresponding to a particular date

          hive> SELECT DAYNAME('2012-07-25');

                             -> 'Wednesday'



          Case 2 : To query a table to find details based on a particular day name
          Table :-
          date |item id|store id |value|unit|price

          01/07/2012|110001|0011111111003|0.99|1.00|0.99

          02/07/2012|110001|0011111111008|0.99|0.00|0.00

          03/07/2012|110001|0011111111009|0.99|0.00|0.00

          04/07/2012|110001|0011111112002|0.99|0.00|0.00

          05/07/2012|110001|0011111112003|0.99|0.00|0.00

          06/07/2012|110001|0011111112006|0.99|1.00|0.99

          07/07/2012|110001|0011111112007|0.99|0.00|0.00

          08/07/2012|110001|0011111112008|0.99|0.00|0.00

          09/07/2012|110001|0011111112009|0.99|0.00|0.00

          10/07/2012|110001|0011111112010|0.99|0.00|0.00

          11/07/2012|110001|0011111113003|0.99|0.00|0.00

          12/07/2012|110001|0011111113006|0.99|0.00|0.00

          13/07/2012|110001|0011111113008|0.99|0.00|0.00

          14/07/2012|110001|0011111113010|0.99|0.00|0.00

          15/07/2012|110001|0011111114002|0.99|0.00|0.00

          16/07/2012|110001|0011111114004|0.99|1.00|0.99

          17/07/2012|110001|0011111114005|0.99|0.00|0.00

          18/07/2012|110001|0011111121004|0.99|0.00|0.00




          Query : select * from sales where dayname(date)='wednesday';


          Result :-
          04/07/2012|110001|0011111112002|0.99|0.00|0.00

          11/07/2012|110001|0011111113003|0.99|0.00|0.00

          18/07/2012|110001|0011111121004|0.99|0.00|0.00
          dayname(date/timestamp/string)

          Returns the name of the weekday for date. The language used for the name is English.

          select dayname('2015-04-08');
          Wednesday
          Carl Steinbach made changes -
          Assignee Carl Steinbach [ cwsteinbach ]
          Ann Dominic made changes -
          Attachment HIVE-3299.patch.txt [ 12568222 ]
          Carl Steinbach made changes -
          Status Patch Available [ 10002 ] Open [ 1 ]
          Namitha Babychan made changes -
          Assignee Namitha Babychan [ medicaux ] Carl Steinbach [ cwsteinbach ]
          Namitha Babychan made changes -
          Attachment HIVE-3299.1.patch.txt [ 12538657 ]
          Namitha Babychan made changes -
          Attachment hive-3299.1.patch [ 12538531 ]
          Namitha Babychan made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Namitha Babychan made changes -
          Attachment HIVE-3299.1.patch.txt [ 12539965 ]
          Attachment udf_dayname.q [ 12539966 ]
          Attachment udf_dayname.q.out [ 12539967 ]
          Carl Steinbach made changes -
          Status Patch Available [ 10002 ] Open [ 1 ]
          Fix Version/s 0.10.0 [ 12320745 ]
          Carl Steinbach made changes -
          Assignee Carl Steinbach [ cwsteinbach ] Namitha Babychan [ medicaux ]
          Namitha Babychan made changes -
          Assignee Carl Steinbach [ cwsteinbach ]
          Namitha Babychan made changes -
          Assignee Namitha Babychan [ medicaux ]
          Namitha Babychan made changes -
          Attachment Hive-3299_Testcase.doc [ 12538775 ]
          Namitha Babychan made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Namitha Babychan made changes -
          Attachment HIVE-3299.1.patch.txt [ 12538657 ]
          Carl Steinbach made changes -
          Status Patch Available [ 10002 ] Open [ 1 ]
          Carl Steinbach made changes -
          Assignee Namitha Babychan [ medicaux ]
          Namitha Babychan made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Labels patch
          Namitha Babychan made changes -
          Attachment hive-3299.1.patch [ 12538531 ]
          shalish made changes -
          Field Original Value New Value
          Description Function Name: DAYNAME (date)

          Returns the name of the weekday for date.
          Example: hive> SELECT DAYNAME('2012-07-25');
                             -> 'Wednesday'
          Current releases of Hive lacks a function which would return the day name corresponding to a date / timestamp value which might be a part of a column.
          The function -DAYNAME (date) would return the day name from a date / timestamp or column which would be useful while using HiveQL. This would find its use in various business sectors like retail, which would help in identifying the trends and sales datails for a particular weekday for entire year,month or week.


          Functionality :-

          Function Name: DAYNAME (date)

          Returns the name of the weekday for date.
          Example: hive> SELECT DAYNAME('2012-07-25');
                             -> 'Wednesday'

          Usage :-

          Case 1 : To find DAY NAME corresponding to a particular date

          hive> SELECT DAYNAME('2012-07-25');

                             -> 'Wednesday'



          Case 2 : To query a table to find details based on a particular day name
          Table :-
          date |item id|store id |value|unit|price

          01/07/2012|110001|0011111111003|0.99|1.00|0.99

          02/07/2012|110001|0011111111008|0.99|0.00|0.00

          03/07/2012|110001|0011111111009|0.99|0.00|0.00

          04/07/2012|110001|0011111112002|0.99|0.00|0.00

          05/07/2012|110001|0011111112003|0.99|0.00|0.00

          06/07/2012|110001|0011111112006|0.99|1.00|0.99

          07/07/2012|110001|0011111112007|0.99|0.00|0.00

          08/07/2012|110001|0011111112008|0.99|0.00|0.00

          09/07/2012|110001|0011111112009|0.99|0.00|0.00

          10/07/2012|110001|0011111112010|0.99|0.00|0.00

          11/07/2012|110001|0011111113003|0.99|0.00|0.00

          12/07/2012|110001|0011111113006|0.99|0.00|0.00

          13/07/2012|110001|0011111113008|0.99|0.00|0.00

          14/07/2012|110001|0011111113010|0.99|0.00|0.00

          15/07/2012|110001|0011111114002|0.99|0.00|0.00

          16/07/2012|110001|0011111114004|0.99|1.00|0.99

          17/07/2012|110001|0011111114005|0.99|0.00|0.00

          18/07/2012|110001|0011111121004|0.99|0.00|0.00




          Query : select * from sales where dayname(date)='wednesday';


          Result :-
          04/07/2012|110001|0011111112002|0.99|0.00|0.00

          11/07/2012|110001|0011111113003|0.99|0.00|0.00

          18/07/2012|110001|0011111121004|0.99|0.00|0.00
          Namitha Babychan created issue -

            People

            • Assignee:
              Alexander Pivovarov
              Reporter:
              Namitha Babychan
            • Votes:
              4 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development