TO_HOURS(Lakehouse v1)
将指定数量的小时转换为 Interval 类型。
- 接受正整数、零和负整数作为输入。
Analyze 语法
Section titled “Analyze 语法”func.to_hours(<hours>)Analyze 示例
Section titled “Analyze 示例”func.to_hours(2)┌──────────────────────────────────────────────────────┐│ func.to_hours(2) │├──────────────────────────────────────────────────────┤│ 2:00:00 │└──────────────────────────────────────────────────────┘SQL 语法
Section titled “SQL 语法”TO_HOURS(<hours>)Interval(格式为 hh:mm:ss)。
SQL 示例
Section titled “SQL 示例”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 │└───────────────────────────────────────────┘