v.23.3Improvement
Update repeat function to accept negative integers, aligning with Spark behavior
Previously, the repeat function's second argument only accepted an unsigned integer type, which meant it could not accept values such as -1. This behavior differed from that of the Spark function. In this update, the repeat function has been modified to match the behavior of the Spark function. It now accepts the same types of inputs, including negative integers. Extensive testing has been performed to verify the correctness of the updated implementation. #47134 (KevinyhZou). Note: the changelog entry was rewritten by ChatGPT.Why it matters
Previously, therepeat function only accepted unsigned integers as the count parameter, disallowing negative values such as -1. This limited compatibility with other SQL dialects like Spark. The update solves this by allowing negative integers, improving consistency and usability for users coming from or integrating with Spark environments.How to use it
Use therepeat function as before, but now you can pass negative integers as the second argument without errors. For example: repeat('abc', -1) will behave similarly to Spark's function.