TO_HOURS (Lakehouse v1)
Converts a specified number of hours into an Interval type.
- Accepts positive integers, zero, and negative integers as input.
Analyze Syntax
Section titled “Analyze Syntax”func.to_hours(<hours>)Analyze Examples
Section titled “Analyze Examples”func.to_hours(2)┌──────────────────────────────────────────────────────┐│ func.to_hours(2) │├──────────────────────────────────────────────────────┤│ 2:00:00 │└──────────────────────────────────────────────────────┘SQL Syntax
Section titled “SQL Syntax”TO_HOURS(<hours>)Return Type
Section titled “Return Type”Interval (in the format hh:mm:ss).
SQL Examples
Section titled “SQL Examples”SELECT TO_HOURS(2), TO_HOURS(0), TO_HOURS((- 2));
┌───────────────────────────────────────────┐│ to_hours(2) │ to_hours(0) │ to_hours(- 2) │├─────────────┼─────────────┼───────────────┤│ 2:00:00 │ 00:00:00 │ -2:00:00 │└───────────────────────────────────────────┘