It’s sometimes important to display the month name for the specified date when creating summary reports, pivot tables, and charts. We commonly save data in the database in one of two formats: date with timestamp or plain date. Without having to develop User Defined Functions, we can get the part of the date as well as the month name using built-in functions. Let’s look at how Apache Hive and Apache Impala can help.
The query above returns the month of November.
You can use your date column instead of “CURRENT TIMESTAMP.”
Without having to think about workarounds, Apache Impala provides a large number of built-in functions. One of these is the DAYNAME function, which shows the day-name for the given date.
Please note that this function is available in the latest versions of Apache Impala. If you are using older versions then you should depend on the work-around only as shown below:
12, “December”) as month_name;
Hope you find this article helpful.
Please subscribe for more interesting updates.