{"action":"created","comment":{"url":"https://api.github.com/repos/prestodb/presto/pulls/comments/62082934","id":62082934,"diff_hunk":"@@ -169,5 +187,35 @@ public void testRowEquality()\n         assertFunction(\"test_row(TRUE, ARRAY [1]) != test_row(TRUE, ARRAY [1])\", BOOLEAN, false);\n         assertFunction(\"test_row(TRUE, ARRAY [1]) != test_row(TRUE, ARRAY [1,2])\", BOOLEAN, true);\n         assertFunction(\"test_row(1.0, ARRAY [1,2,3], test_row(2,2.0)) != test_row(1.0, ARRAY [1,2,3], test_row(1,2.0))\", BOOLEAN, true);\n+\n+        // Cannot be applied with different field names\n+        // assertFunction(\"CAST(ROW(1, 2) AS ROW(a BIGINT, b BIGINT)) = CAST(ROW(1, 2) AS ROW(b BIGINT, a BIGINT))\", BOOLEAN, true);\n+        // assertFunction(\"CAST(ROW(1, 2) AS ROW(a BIGINT, b BIGINT)) != CAST(ROW(2, 1) AS ROW(b BIGINT, a BIGINT))\", BOOLEAN, true);\n+        // assertFunction(\"ROW(1, 2) = CAST(ROW(1, 2) AS ROW(a BIGINT, b BIGINT))\", BOOLEAN, true);\n+        // assertFunction(\"CAST(ROW(1, 2) AS ROW(a BIGINT, b BIGINT)) = ROW(1, 2)\", BOOLEAN, true);\n+        assertFunction(\"ROW(1, 2) = ROW(1, 2)\", BOOLEAN, true);\n+        assertFunction(\"ROW(2, 1) != ROW(1, 2)\", BOOLEAN, true);\n+    }\n+\n+    @Test\n+    public void testRowSelect()\n+            throws Exception\n+    {\n+        testQuery(\"SELECT ROW(1 + 2, CONCAT('a', 'b'))\", \"SELECT ROW(3, 'ab')\");","path":"presto-main/src/test/java/com/facebook/presto/type/TestRowOperators.java","position":96,"original_position":96,"commit_id":"2b658a7b2448c2a911e68dfbd96791d2f7b783b0","original_commit_id":"2b658a7b2448c2a911e68dfbd96791d2f7b783b0","user":{"login":"cberner","id":842688,"avatar_url":"https://avatars.githubusercontent.com/u/842688?v=3","gravatar_id":"","url":"https://api.github.com/users/cberner","html_url":"https://github.com/cberner","followers_url":"https://api.github.com/users/cberner/followers","following_url":"https://api.github.com/users/cberner/following{/other_user}","gists_url":"https://api.github.com/users/cberner/gists{/gist_id}","starred_url":"https://api.github.com/users/cberner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cberner/subscriptions","organizations_url":"https://api.github.com/users/cberner/orgs","repos_url":"https://api.github.com/users/cberner/repos","events_url":"https://api.github.com/users/cberner/events{/privacy}","received_events_url":"https://api.github.com/users/cberner/received_events","type":"User","site_admin":false},"body":"Add these tests to `AbstractTestQueries` instead of here. Then you can remove the `queryRunner`","created_at":"2016-05-04T17:47:04Z","updated_at":"2016-05-04T17:47:04Z","html_url":"https://github.com/prestodb/presto/pull/5044#discussion_r62082934","pull_request_url":"https://api.github.com/repos/prestodb/presto/pulls/5044","_links":{"self":{"href":"https://api.github.com/repos/prestodb/presto/pulls/comments/62082934"},"html":{"href":"https://github.com/prestodb/presto/pull/5044#discussion_r62082934"},"pull_request":{"href":"https://api.github.com/repos/prestodb/presto/pulls/5044"}}},"pull_request":{"url":"https://api.github.com/repos/prestodb/presto/pulls/5044","id":66726535,"html_url":"https://github.com/prestodb/presto/pull/5044","diff_url":"https://github.com/prestodb/presto/pull/5044.diff","patch_url":"https://github.com/prestodb/presto/pull/5044.patch","issue_url":"https://api.github.com/repos/prestodb/presto/issues/5044","number":5044,"state":"open","locked":false,"title":"Add ROW constructor","user":{"login":"lacbs","id":2650088,"avatar_url":"https://avatars.githubusercontent.com/u/2650088?v=3","gravatar_id":"","url":"https://api.github.com/users/lacbs","html_url":"https://github.com/lacbs","followers_url":"https://api.github.com/users/lacbs/followers","following_url":"https://api.github.com/users/lacbs/following{/other_user}","gists_url":"https://api.github.com/users/lacbs/gists{/gist_id}","starred_url":"https://api.github.com/users/lacbs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lacbs/subscriptions","organizations_url":"https://api.github.com/users/lacbs/orgs","repos_url":"https://api.github.com/users/lacbs/repos","events_url":"https://api.github.com/users/lacbs/events{/privacy}","received_events_url":"https://api.github.com/users/lacbs/received_events","type":"User","site_admin":false},"body":"It doesn't explicitly set the fields names.\r\nNow it's possible to do nice things like `select row(1, row(9, a, array[], null), row(1, 2)), row(date '2016-04-15') from (values ('a'), ('b')) t(a);`\r\n\r\nNotice that the type for ROW will have changes.\r\nNow it's syntax is `ROW<type1, type2...>(field1, field2...)`, but it should be `ROW(field1 type1, field2 type2...)`\r\nBecause of the presence of `<` and `>` in the type name, this commit introduces a hack because the typeName is used as an part of variables name in the generated bytecode. Once it's changed to the new syntax, we can remove the hack.\r\n\r\nAlso, ROW CAST is not completly implemented:\r\n- CAST from one row to another doesn't rename fields.\r\n- It doesn't CAST the arguments types to super types.\r\n- It's not possible to cast from NULL (implicitly) because it generates a type with fields with uppercase letters.\r\n- It's not possible to explicitly cast because the the file `SqlBase.g4` doesn't define the syntax for ROW type.\r\n- Because of the same reason you can get a weird error if you try `select * from (values (row(1,2), 3), (null, 3));`. Since arilift doesn't have the syntax for `ROW<types>(fields)` it throws `ParsingException`.","created_at":"2016-04-16T03:31:35Z","updated_at":"2016-05-04T17:47:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f83fa384ccb88e07574cef5c917f2354b6291f16","assignee":{"login":"cberner","id":842688,"avatar_url":"https://avatars.githubusercontent.com/u/842688?v=3","gravatar_id":"","url":"https://api.github.com/users/cberner","html_url":"https://github.com/cberner","followers_url":"https://api.github.com/users/cberner/followers","following_url":"https://api.github.com/users/cberner/following{/other_user}","gists_url":"https://api.github.com/users/cberner/gists{/gist_id}","starred_url":"https://api.github.com/users/cberner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cberner/subscriptions","organizations_url":"https://api.github.com/users/cberner/orgs","repos_url":"https://api.github.com/users/cberner/repos","events_url":"https://api.github.com/users/cberner/events{/privacy}","received_events_url":"https://api.github.com/users/cberner/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/prestodb/presto/pulls/5044/commits","review_comments_url":"https://api.github.com/repos/prestodb/presto/pulls/5044/comments","review_comment_url":"https://api.github.com/repos/prestodb/presto/pulls/comments{/number}","comments_url":"https://api.github.com/repos/prestodb/presto/issues/5044/comments","statuses_url":"https://api.github.com/repos/prestodb/presto/statuses/2b658a7b2448c2a911e68dfbd96791d2f7b783b0","head":{"label":"lacbs:row-constructor","ref":"row-constructor","sha":"2b658a7b2448c2a911e68dfbd96791d2f7b783b0","user":{"login":"lacbs","id":2650088,"avatar_url":"https://avatars.githubusercontent.com/u/2650088?v=3","gravatar_id":"","url":"https://api.github.com/users/lacbs","html_url":"https://github.com/lacbs","followers_url":"https://api.github.com/users/lacbs/followers","following_url":"https://api.github.com/users/lacbs/following{/other_user}","gists_url":"https://api.github.com/users/lacbs/gists{/gist_id}","starred_url":"https://api.github.com/users/lacbs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lacbs/subscriptions","organizations_url":"https://api.github.com/users/lacbs/orgs","repos_url":"https://api.github.com/users/lacbs/repos","events_url":"https://api.github.com/users/lacbs/events{/privacy}","received_events_url":"https://api.github.com/users/lacbs/received_events","type":"User","site_admin":false},"repo":{"id":52392846,"name":"presto","full_name":"lacbs/presto","owner":{"login":"lacbs","id":2650088,"avatar_url":"https://avatars.githubusercontent.com/u/2650088?v=3","gravatar_id":"","url":"https://api.github.com/users/lacbs","html_url":"https://github.com/lacbs","followers_url":"https://api.github.com/users/lacbs/followers","following_url":"https://api.github.com/users/lacbs/following{/other_user}","gists_url":"https://api.github.com/users/lacbs/gists{/gist_id}","starred_url":"https://api.github.com/users/lacbs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lacbs/subscriptions","organizations_url":"https://api.github.com/users/lacbs/orgs","repos_url":"https://api.github.com/users/lacbs/repos","events_url":"https://api.github.com/users/lacbs/events{/privacy}","received_events_url":"https://api.github.com/users/lacbs/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lacbs/presto","description":"Distributed SQL query engine for running interactive analytic queries against big data sources.","fork":true,"url":"https://api.github.com/repos/lacbs/presto","forks_url":"https://api.github.com/repos/lacbs/presto/forks","keys_url":"https://api.github.com/repos/lacbs/presto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lacbs/presto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lacbs/presto/teams","hooks_url":"https://api.github.com/repos/lacbs/presto/hooks","issue_events_url":"https://api.github.com/repos/lacbs/presto/issues/events{/number}","events_url":"https://api.github.com/repos/lacbs/presto/events","assignees_url":"https://api.github.com/repos/lacbs/presto/assignees{/user}","branches_url":"https://api.github.com/repos/lacbs/presto/branches{/branch}","tags_url":"https://api.github.com/repos/lacbs/presto/tags","blobs_url":"https://api.github.com/repos/lacbs/presto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lacbs/presto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lacbs/presto/git/refs{/sha}","trees_url":"https://api.github.com/repos/lacbs/presto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lacbs/presto/statuses/{sha}","languages_url":"https://api.github.com/repos/lacbs/presto/languages","stargazers_url":"https://api.github.com/repos/lacbs/presto/stargazers","contributors_url":"https://api.github.com/repos/lacbs/presto/contributors","subscribers_url":"https://api.github.com/repos/lacbs/presto/subscribers","subscription_url":"https://api.github.com/repos/lacbs/presto/subscription","commits_url":"https://api.github.com/repos/lacbs/presto/commits{/sha}","git_commits_url":"https://api.github.com/repos/lacbs/presto/git/commits{/sha}","comments_url":"https://api.github.com/repos/lacbs/presto/comments{/number}","issue_comment_url":"https://api.github.com/repos/lacbs/presto/issues/comments{/number}","contents_url":"https://api.github.com/repos/lacbs/presto/contents/{+path}","compare_url":"https://api.github.com/repos/lacbs/presto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lacbs/presto/merges","archive_url":"https://api.github.com/repos/lacbs/presto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lacbs/presto/downloads","issues_url":"https://api.github.com/repos/lacbs/presto/issues{/number}","pulls_url":"https://api.github.com/repos/lacbs/presto/pulls{/number}","milestones_url":"https://api.github.com/repos/lacbs/presto/milestones{/number}","notifications_url":"https://api.github.com/repos/lacbs/presto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lacbs/presto/labels{/name}","releases_url":"https://api.github.com/repos/lacbs/presto/releases{/id}","deployments_url":"https://api.github.com/repos/lacbs/presto/deployments","created_at":"2016-02-23T21:27:02Z","updated_at":"2016-02-23T21:27:13Z","pushed_at":"2016-04-30T08:34:37Z","git_url":"git://github.com/lacbs/presto.git","ssh_url":"git@github.com:lacbs/presto.git","clone_url":"https://github.com/lacbs/presto.git","svn_url":"https://github.com/lacbs/presto","homepage":"https://prestodb.io","size":59643,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"prestodb:master","ref":"master","sha":"4fc9d7d6d9aaddb2e7cffa8ec31b754bfa5f3d23","user":{"login":"prestodb","id":6882181,"avatar_url":"https://avatars.githubusercontent.com/u/6882181?v=3","gravatar_id":"","url":"https://api.github.com/users/prestodb","html_url":"https://github.com/prestodb","followers_url":"https://api.github.com/users/prestodb/followers","following_url":"https://api.github.com/users/prestodb/following{/other_user}","gists_url":"https://api.github.com/users/prestodb/gists{/gist_id}","starred_url":"https://api.github.com/users/prestodb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prestodb/subscriptions","organizations_url":"https://api.github.com/users/prestodb/orgs","repos_url":"https://api.github.com/users/prestodb/repos","events_url":"https://api.github.com/users/prestodb/events{/privacy}","received_events_url":"https://api.github.com/users/prestodb/received_events","type":"Organization","site_admin":false},"repo":{"id":5349565,"name":"presto","full_name":"prestodb/presto","owner":{"login":"prestodb","id":6882181,"avatar_url":"https://avatars.githubusercontent.com/u/6882181?v=3","gravatar_id":"","url":"https://api.github.com/users/prestodb","html_url":"https://github.com/prestodb","followers_url":"https://api.github.com/users/prestodb/followers","following_url":"https://api.github.com/users/prestodb/following{/other_user}","gists_url":"https://api.github.com/users/prestodb/gists{/gist_id}","starred_url":"https://api.github.com/users/prestodb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prestodb/subscriptions","organizations_url":"https://api.github.com/users/prestodb/orgs","repos_url":"https://api.github.com/users/prestodb/repos","events_url":"https://api.github.com/users/prestodb/events{/privacy}","received_events_url":"https://api.github.com/users/prestodb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/prestodb/presto","description":"Distributed SQL query engine for big data","fork":false,"url":"https://api.github.com/repos/prestodb/presto","forks_url":"https://api.github.com/repos/prestodb/presto/forks","keys_url":"https://api.github.com/repos/prestodb/presto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/prestodb/presto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/prestodb/presto/teams","hooks_url":"https://api.github.com/repos/prestodb/presto/hooks","issue_events_url":"https://api.github.com/repos/prestodb/presto/issues/events{/number}","events_url":"https://api.github.com/repos/prestodb/presto/events","assignees_url":"https://api.github.com/repos/prestodb/presto/assignees{/user}","branches_url":"https://api.github.com/repos/prestodb/presto/branches{/branch}","tags_url":"https://api.github.com/repos/prestodb/presto/tags","blobs_url":"https://api.github.com/repos/prestodb/presto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/prestodb/presto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/prestodb/presto/git/refs{/sha}","trees_url":"https://api.github.com/repos/prestodb/presto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/prestodb/presto/statuses/{sha}","languages_url":"https://api.github.com/repos/prestodb/presto/languages","stargazers_url":"https://api.github.com/repos/prestodb/presto/stargazers","contributors_url":"https://api.github.com/repos/prestodb/presto/contributors","subscribers_url":"https://api.github.com/repos/prestodb/presto/subscribers","subscription_url":"https://api.github.com/repos/prestodb/presto/subscription","commits_url":"https://api.github.com/repos/prestodb/presto/commits{/sha}","git_commits_url":"https://api.github.com/repos/prestodb/presto/git/commits{/sha}","comments_url":"https://api.github.com/repos/prestodb/presto/comments{/number}","issue_comment_url":"https://api.github.com/repos/prestodb/presto/issues/comments{/number}","contents_url":"https://api.github.com/repos/prestodb/presto/contents/{+path}","compare_url":"https://api.github.com/repos/prestodb/presto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/prestodb/presto/merges","archive_url":"https://api.github.com/repos/prestodb/presto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/prestodb/presto/downloads","issues_url":"https://api.github.com/repos/prestodb/presto/issues{/number}","pulls_url":"https://api.github.com/repos/prestodb/presto/pulls{/number}","milestones_url":"https://api.github.com/repos/prestodb/presto/milestones{/number}","notifications_url":"https://api.github.com/repos/prestodb/presto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/prestodb/presto/labels{/name}","releases_url":"https://api.github.com/repos/prestodb/presto/releases{/id}","deployments_url":"https://api.github.com/repos/prestodb/presto/deployments","created_at":"2012-08-09T01:03:37Z","updated_at":"2016-05-04T14:16:41Z","pushed_at":"2016-05-04T17:10:36Z","git_url":"git://github.com/prestodb/presto.git","ssh_url":"git@github.com:prestodb/presto.git","clone_url":"https://github.com/prestodb/presto.git","svn_url":"https://github.com/prestodb/presto","homepage":"https://prestodb.io","size":150263,"stargazers_count":4712,"watchers_count":4712,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1372,"mirror_url":null,"open_issues_count":546,"forks":1372,"open_issues":546,"watchers":4712,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/prestodb/presto/pulls/5044"},"html":{"href":"https://github.com/prestodb/presto/pull/5044"},"issue":{"href":"https://api.github.com/repos/prestodb/presto/issues/5044"},"comments":{"href":"https://api.github.com/repos/prestodb/presto/issues/5044/comments"},"review_comments":{"href":"https://api.github.com/repos/prestodb/presto/pulls/5044/comments"},"review_comment":{"href":"https://api.github.com/repos/prestodb/presto/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/prestodb/presto/pulls/5044/commits"},"statuses":{"href":"https://api.github.com/repos/prestodb/presto/statuses/2b658a7b2448c2a911e68dfbd96791d2f7b783b0"}}}}