presto-main/src/main/java/io/prestosql/sql/relational/SqlToRowExpressionTranslator.java/Visitor/visitCast
class Visitor:        @Override
        protected RowExpression visitCast(Cast node, Void context)
        {
            RowExpression value = process(node.getExpression(), context);

            Type returnType = getType(node);
            if (node.isTypeOnly()) {
                return changeType(value, returnType);
            }

            if (node.isSafe()) {
                return call(
                        metadata.getCoercion(QualifiedName.of("TRY_CAST"), value.getType(), returnType),
                        returnType,
                        value);
            }

            return call(
                    metadata.getCoercion(value.getType(), returnType),
                    returnType,
                    value);
        }