{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/presto/issues/2556","labels_url":"https://api.github.com/repos/facebook/presto/issues/2556/labels{/name}","comments_url":"https://api.github.com/repos/facebook/presto/issues/2556/comments","events_url":"https://api.github.com/repos/facebook/presto/issues/2556/events","html_url":"https://github.com/facebook/presto/issues/2556","id":62792026,"number":2556,"title":"Array comparison with null elements fails","user":{"login":"nezihyigitbasi","id":1223839,"avatar_url":"https://avatars.githubusercontent.com/u/1223839?v=3","gravatar_id":"","url":"https://api.github.com/users/nezihyigitbasi","html_url":"https://github.com/nezihyigitbasi","followers_url":"https://api.github.com/users/nezihyigitbasi/followers","following_url":"https://api.github.com/users/nezihyigitbasi/following{/other_user}","gists_url":"https://api.github.com/users/nezihyigitbasi/gists{/gist_id}","starred_url":"https://api.github.com/users/nezihyigitbasi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nezihyigitbasi/subscriptions","organizations_url":"https://api.github.com/users/nezihyigitbasi/orgs","repos_url":"https://api.github.com/users/nezihyigitbasi/repos","events_url":"https://api.github.com/users/nezihyigitbasi/events{/privacy}","received_events_url":"https://api.github.com/users/nezihyigitbasi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-18T20:30:44Z","updated_at":"2015-08-03T16:57:56Z","closed_at":null,"body":"Comparing two arrays where one of the arrays has a ``null`` element fails while formatting a proper error message. The root cause seems to be a ``%`` character added as a prefix to the internal operator names (see [this](https://github.com/facebook/presto/blob/master/presto-main/src/main/java/com/facebook/presto/metadata/Signature.java#L195)), which is not properly escaped before calling the ``String.format()`` function. \r\n\r\n```\r\npresto:default> select array[null] = array[22];\r\nQuery 20150318_202931_00000_k7d2p failed: Conversion = '$'\r\njava.util.UnknownFormatConversionException: Conversion = '$'\r\n\tat java.util.Formatter.checkText(Formatter.java:2579)\r\n\tat java.util.Formatter.parse(Formatter.java:2555)\r\n\tat java.util.Formatter.format(Formatter.java:2501)\r\n\tat java.util.Formatter.format(Formatter.java:2455)\r\n\tat java.lang.String.format(String.java:2927)\r\n\tat com.facebook.presto.sql.analyzer.SemanticException.<init>(SemanticException.java:28)\r\n\tat com.facebook.presto.sql.analyzer.ExpressionAnalyzer$Visitor.coerceType(ExpressionAnalyzer.java:850)\r\n```\r\n\r\nThis is the format string passed to ``String.format()`` (note the ``%$``):\r\n```\r\nOperator FunctionInfo{signature=%$operator$EQUAL(array<bigint>,array<bigint>):boolean, isAggregate=false, isWindow=false} argument 0 must evaluate to a %s (actual: %s)\r\n```\r\n\r\nI will be happy to fix this one after we determine a proper solution.  Does any other part of the code rely on the ``%`` prefix in the internal operator name?\r\n"},"comment":{"url":"https://api.github.com/repos/facebook/presto/issues/comments/127331102","html_url":"https://github.com/facebook/presto/issues/2556#issuecomment-127331102","issue_url":"https://api.github.com/repos/facebook/presto/issues/2556","id":127331102,"user":{"login":"cawallin","id":3652644,"avatar_url":"https://avatars.githubusercontent.com/u/3652644?v=3","gravatar_id":"","url":"https://api.github.com/users/cawallin","html_url":"https://github.com/cawallin","followers_url":"https://api.github.com/users/cawallin/followers","following_url":"https://api.github.com/users/cawallin/following{/other_user}","gists_url":"https://api.github.com/users/cawallin/gists{/gist_id}","starred_url":"https://api.github.com/users/cawallin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cawallin/subscriptions","organizations_url":"https://api.github.com/users/cawallin/orgs","repos_url":"https://api.github.com/users/cawallin/repos","events_url":"https://api.github.com/users/cawallin/events{/privacy}","received_events_url":"https://api.github.com/users/cawallin/received_events","type":"User","site_admin":false},"created_at":"2015-08-03T16:57:56Z","updated_at":"2015-08-03T16:57:56Z","body":"@cberner can you close this please?"}}