MaxGekk commented on pull request #32001: URL: https://github.com/apache/spark/pull/32001#issuecomment-810387240
> How useful it is to support casting from number to interval? We already have the make_interval function and we can create intervals from string values. It doesn't seem to provide much value supporting it. @AngersZhuuuu Any thoughts about use cases? @cloud-fan I could imagine the use cases when we need to transfer/save/load intervals to external systems that don't support any interval types natively. In that case, we can convert our intervals to int/long upload there, and maybe perform some arithmetic ops in the remote systems. If we look at the alternatives proposed by you: 1. Convert to string. We will have to parse the string at the external system. And it is not the fact that parsing is easy task there. 2. `make_interval`. ok. We can construct intervals from separate integral types but we still need to prepare many such columns at the external systems (I guess that is not convenient). And how about the opposite operation - upload interval to the external system. `make_interval` cannot help here. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
