Durga Gadiraju

​Section 9:102.Type Cast Functions for Data Type Conversion

In Hive, you can convert data from one data type to another using type conversion functions. These functions allow you to transform data into a format that is suitable for a specific operation or query. Here are some of the commonly used type conversion functions in Hive: CAST(expression AS data_type) – converts an expression to …

​Section 9:102.Type Cast Functions for Data Type Conversion Read More »

​Section 9:101.Overview of Numeric Functions

Hive provides a wide range of numeric functions that can be used for performing arithmetic, trigonometric, statistical, and other mathematical operations on numeric data. Here is an overview of some of the commonly used numeric functions in Hive: abs(x) – returns the absolute value of x. ceil(x) – returns the smallest integer that is greater …

​Section 9:101.Overview of Numeric Functions Read More »

Section 9:100. Date Manipulation – Extracting information using Year,month,day, etc

In Hive, you can work with Unix timestamps using the built-in from_unixtime() and unix_timestamp() functions. The unix_timestamp() function converts a string to a Unix timestamp, which is the number of seconds since January 1, 1970, 00:00:00 UTC. The syntax of the unix_timestamp() function is as follows: unix_timestamp(string date, string pattern) Here, date is the input …

Section 9:100. Date Manipulation – Extracting information using Year,month,day, etc Read More »

Section 9:99. Date Manipulation – Extracting information using Year,month,day, etc

1.year(date) – This function returns the year component of the given date. Example: SELECT year(‘2022-03-05’); returns 2022 2.month(date) – This function returns the month component of the given date. Example: SELECT month(‘2022-03-05’); returns 3 3.day(date) – This function returns the day of the month component of the given date. Example: SELECT day(‘2022-03-05’); returns 5 4.hour(timestamp) …

Section 9:99. Date Manipulation – Extracting information using Year,month,day, etc Read More »

Section 9:98. Date Manipulation – Extracting information using Date_format

The date_format() function in Hive is used to format a date or timestamp value as a string, according to a specified format string. The syntax of the date_format() function is as follows: date_format(date/timestamp, format) Here, date/timestamp is the input date or timestamp value that you want to format, and format is the format string that …

Section 9:98. Date Manipulation – Extracting information using Date_format Read More »