MartijnVisser commented on a change in pull request #18813: URL: https://github.com/apache/flink/pull/18813#discussion_r823697352
########## File path: docs/content/docs/dev/table/types.md ########## @@ -1487,6 +1481,88 @@ Not supported. {{< /tab >}} {{< /tabs >}} +Casting +------- + +Flink SQL can perform casting between a defined pair `from` type and `target` type pair. While some +casting operations can always succeed regardless of the input value, others can fail at runtime +(i.e. where there is no way to create a value for the target type). For example, it is always +possible to convert `INT` to `STRING`, but you cannot always convert a `STRING` to `INT`. + +During the planning stage, Flink SQL rejects queries for invalid cast input and target type with +a `ValidationException`, e.g. when trying to cast a `TIMESTAMP` to an `INTERVAL`. +While for valid type pairs that can fail at runtime Flink SQL accepts them, but requires the user to correctly handle failures. + +In Flink SQL, casting can be performed by using one of the two following built-in functions: Review comment: ```suggestion In Flink Table API and SQL, casting can be performed by using one of the two following built-in functions: ``` -- 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. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org