@Override
    protected Object visitGenericLiteral(GenericLiteral node, ConnectorSession session) {
      Type type = metadata.getType(parseTypeSignature(node.getType()));
      if (type == null) {
        throw new SemanticException(TYPE_MISMATCH, node, "Unknown type: " + node.getType());
      }

      if (JSON.equals(type)) {
        ScalarFunctionImplementation operator =
            metadata
                .getFunctionRegistry()
                .getScalarFunctionImplementation(
                    new Signature(
                        "json_parse", SCALAR, JSON.getTypeSignature(), VARCHAR.getTypeSignature()));
        try {
          return ExpressionInterpreter.invoke(
              session, operator, ImmutableList.<Object>of(utf8Slice(node.getValue())));
        } catch (Throwable throwable) {
          throw Throwables.propagate(throwable);
        }
      }

      ScalarFunctionImplementation operator;
      try {
        Signature signature = metadata.getFunctionRegistry().getCoercion(VARCHAR, type);
        operator = metadata.getFunctionRegistry().getScalarFunctionImplementation(signature);
      } catch (IllegalArgumentException e) {
        throw new SemanticException(TYPE_MISMATCH, node, "No literal form for type %s", type);
      }
      try {
        return ExpressionInterpreter.invoke(
            session, operator, ImmutableList.<Object>of(utf8Slice(node.getValue())));
      } catch (Throwable throwable) {
        throw Throwables.propagate(throwable);
      }
    }