presto-main/src/main/java/io/prestosql/sql/planner/LiteralInterpreter.java/LiteralInterpreter/visitGenericLiteral
class LiteralInterpreter:        @Override
        protected Object visitGenericLiteral(GenericLiteral node, ConnectorSession session)
        {
            Type type;
            try {
                type = metadata.fromSqlType(node.getType());
            }
            catch (TypeNotFoundException e) {
                throw semanticException(TYPE_NOT_FOUND, node, "Unknown type: " + node.getType());
            }

            if (JSON.equals(type)) {
                ResolvedFunction resolvedFunction = metadata.resolveFunction(QualifiedName.of("json_parse"), fromTypes(VARCHAR));
                return functionInvoker.invoke(resolvedFunction, session, ImmutableList.of(utf8Slice(node.getValue())));
            }

            try {
                ResolvedFunction resolvedFunction = metadata.getCoercion(VARCHAR, type);
                return functionInvoker.invoke(resolvedFunction, session, ImmutableList.of(utf8Slice(node.getValue())));
            }
            catch (IllegalArgumentException e) {
                throw semanticException(INVALID_LITERAL, node, "No literal form for type %s", type);
            }
        }