Before you insert the data into the database, you need to convert the integer seconds into a time format. In a derived column, use :
toString(toTimestamp(lpad(toString(copyDuration), 6, '0'), 'HHmmss'))
If you initially tried to store the values in a column of type time
and encountered errors, it could be due to the way the data was formatted or the limitations of the time
data type (which typically handles up to 24 hours). Instead, consider using a varchar
type for storing the time as a string, which will avoid data type conversion errors in SQL.
More links :