{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/11184","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/11184/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/11184/comments","events_url":"https://api.github.com/repos/apache/spark/issues/11184/events","html_url":"https://github.com/apache/spark/pull/11184","id":133317904,"number":11184,"title":"[SPARK-13253] [SQL]avoid checking nullability for complex data type for typeSuffix code path","user":{"login":"kevinyu98","id":7550280,"avatar_url":"https://avatars.githubusercontent.com/u/7550280?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinyu98","html_url":"https://github.com/kevinyu98","followers_url":"https://api.github.com/users/kevinyu98/followers","following_url":"https://api.github.com/users/kevinyu98/following{/other_user}","gists_url":"https://api.github.com/users/kevinyu98/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinyu98/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinyu98/subscriptions","organizations_url":"https://api.github.com/users/kevinyu98/orgs","repos_url":"https://api.github.com/users/kevinyu98/repos","events_url":"https://api.github.com/users/kevinyu98/events{/privacy}","received_events_url":"https://api.github.com/users/kevinyu98/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-02-12T19:02:55Z","updated_at":"2016-04-20T16:15:36Z","closed_at":"2016-04-20T16:15:36Z","pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/11184","html_url":"https://github.com/apache/spark/pull/11184","diff_url":"https://github.com/apache/spark/pull/11184.diff","patch_url":"https://github.com/apache/spark/pull/11184.patch"},"body":"Hello: \r\n\r\nWhen we call the typeSuffix method, it will call the dataType and get the LongType for the suffix(\"L\"). But in the complex data type(like CreatArray) cases, the dataType will also evaluate the children's nullability, which is not necessary for the typeSuffix. \r\n\r\nFor the proposed fix, I will create a prettyDataType, in parallel to the dataType in the expression. At the base, it defaults to the dataType. It is only used by typeSuffix in the NameExpression for now.\r\n\r\nSo the main changes is at the typeSuffix in the NameExpression, and the complexTypeCreator. The rest of files just override the prettyDataType from the abstract class Expression when their \"dataType\" method relies on other expression's \"dataType\"\r\n\r\nThen for those complex types, the \"prettyDataType\" does not try to evaluate the \"nullable\" but just pass a default that will not be used at all by the caller, \"typeSuffix\".\r\n "},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/212496355","html_url":"https://github.com/apache/spark/pull/11184#issuecomment-212496355","issue_url":"https://api.github.com/repos/apache/spark/issues/11184","id":212496355,"user":{"login":"kevinyu98","id":7550280,"avatar_url":"https://avatars.githubusercontent.com/u/7550280?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinyu98","html_url":"https://github.com/kevinyu98","followers_url":"https://api.github.com/users/kevinyu98/followers","following_url":"https://api.github.com/users/kevinyu98/following{/other_user}","gists_url":"https://api.github.com/users/kevinyu98/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinyu98/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinyu98/subscriptions","organizations_url":"https://api.github.com/users/kevinyu98/orgs","repos_url":"https://api.github.com/users/kevinyu98/repos","events_url":"https://api.github.com/users/kevinyu98/events{/privacy}","received_events_url":"https://api.github.com/users/kevinyu98/received_events","type":"User","site_admin":false},"created_at":"2016-04-20T16:15:36Z","updated_at":"2016-04-20T16:15:36Z","body":"@marmbrus : sorry, just saw Wenchen Fan's update from jira, the problem has been solved. I will close this PR."}}