{"action":"created","comment":{"url":"https://api.github.com/repos/prestosql/presto/pulls/comments/263519444","pull_request_review_id":211952220,"id":263519444,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI2MzUxOTQ0NA==","diff_hunk":"@@ -867,29 +868,45 @@ protected Void visitSymbolReference(SymbolReference node, Void context)\n         return hasSymbolReferences.get();\n     }\n \n-    private Operator interpretedFilterProject(Optional<Expression> filter, Expression projection, Type expectedType, Session session)\n+    private Object interpret(Expression expression, Type expectedType, Session session)\n     {\n-        Optional<PageFilter> pageFilter = filter\n-                .map(expression -> new InterpretedPageFilter(\n-                        expression,\n-                        SYMBOL_TYPES,\n-                        INPUT_MAPPING,\n-                        metadata,\n-                        SQL_PARSER,\n-                        session));\n-\n-        PageProjection pageProjection = new InterpretedPageProjection(projection, SYMBOL_TYPES, INPUT_MAPPING, metadata, SQL_PARSER, session);\n-        assertEquals(pageProjection.getType(), expectedType);\n-\n-        PageProcessor processor = new PageProcessor(pageFilter, ImmutableList.of(pageProjection));\n-        OperatorFactory operatorFactory = new FilterAndProjectOperatorFactory(\n-                0,\n-                new PlanNodeId(\"test\"),\n-                () -> processor,\n-                ImmutableList.of(pageProjection.getType()),\n-                new DataSize(0, BYTE),\n-                0);\n-        return operatorFactory.createOperator(createDriverContext(session));\n+        Map<NodeRef<Expression>, Type> expressionTypes = getExpressionTypes(session, metadata, SQL_PARSER, SYMBOL_TYPES, expression, emptyList(), WarningCollector.NOOP);\n+        ExpressionInterpreter evaluator = ExpressionInterpreter.expressionInterpreter(expression, metadata, session, expressionTypes);\n+\n+        Object result = evaluator.evaluate(symbol -> {\n+            int position = 0;\n+            int channel = INPUT_MAPPING.get(symbol);\n+            Type type = SYMBOL_TYPES.get(symbol);\n+\n+            Block block = SOURCE_PAGE.getBlock(channel);\n+\n+            if (block.isNull(position)) {\n+                return null;\n+            }\n+\n+            Class<?> javaType = type.getJavaType();\n+            if (javaType == boolean.class) {\n+                return type.getBoolean(block, position);\n+            }\n+            else if (javaType == long.class) {\n+                return type.getLong(block, position);\n+            }\n+            else if (javaType == double.class) {\n+                return type.getDouble(block, position);\n+            }\n+            else if (javaType == Slice.class) {\n+                return type.getSlice(block, position);\n+            }\n+            else if (javaType == Block.class) {\n+                return type.getObject(block, position);\n+            }\n+            else {\n+                throw new UnsupportedOperationException(\"not yet implemented\");\n+            }\n+        });\n+\n+        Block block = Utils.nativeValueToBlock(expectedType, result);","path":"presto-main/src/test/java/io/prestosql/operator/scalar/FunctionAssertions.java","position":191,"original_position":123,"commit_id":"6773bb3fac19e8fd544e58d0b93771e55c0a10bc","original_commit_id":"8068a9fcd575557a003570c0f566fdb8b974e19c","user":{"login":"dain","id":58298,"node_id":"MDQ6VXNlcjU4Mjk4","avatar_url":"https://avatars0.githubusercontent.com/u/58298?v=4","gravatar_id":"","url":"https://api.github.com/users/dain","html_url":"https://github.com/dain","followers_url":"https://api.github.com/users/dain/followers","following_url":"https://api.github.com/users/dain/following{/other_user}","gists_url":"https://api.github.com/users/dain/gists{/gist_id}","starred_url":"https://api.github.com/users/dain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dain/subscriptions","organizations_url":"https://api.github.com/users/dain/orgs","repos_url":"https://api.github.com/users/dain/repos","events_url":"https://api.github.com/users/dain/events{/privacy}","received_events_url":"https://api.github.com/users/dain/received_events","type":"User","site_admin":false},"body":"add comment `// convert result from stack type to Type ObjectValue`","created_at":"2019-03-07T18:52:52Z","updated_at":"2019-03-07T18:54:01Z","html_url":"https://github.com/prestosql/presto/pull/363#discussion_r263519444","pull_request_url":"https://api.github.com/repos/prestosql/presto/pulls/363","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/prestosql/presto/pulls/comments/263519444"},"html":{"href":"https://github.com/prestosql/presto/pull/363#discussion_r263519444"},"pull_request":{"href":"https://api.github.com/repos/prestosql/presto/pulls/363"}}},"pull_request":{"url":"https://api.github.com/repos/prestosql/presto/pulls/363","id":257648309,"node_id":"MDExOlB1bGxSZXF1ZXN0MjU3NjQ4MzA5","html_url":"https://github.com/prestosql/presto/pull/363","diff_url":"https://github.com/prestosql/presto/pull/363.diff","patch_url":"https://github.com/prestosql/presto/pull/363.patch","issue_url":"https://api.github.com/repos/prestosql/presto/issues/363","number":363,"state":"open","locked":false,"title":"Hide table layouts from engine","user":{"login":"martint","id":14387,"node_id":"MDQ6VXNlcjE0Mzg3","avatar_url":"https://avatars3.githubusercontent.com/u/14387?v=4","gravatar_id":"","url":"https://api.github.com/users/martint","html_url":"https://github.com/martint","followers_url":"https://api.github.com/users/martint/followers","following_url":"https://api.github.com/users/martint/following{/other_user}","gists_url":"https://api.github.com/users/martint/gists{/gist_id}","starred_url":"https://api.github.com/users/martint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martint/subscriptions","organizations_url":"https://api.github.com/users/martint/orgs","repos_url":"https://api.github.com/users/martint/repos","events_url":"https://api.github.com/users/martint/events{/privacy}","received_events_url":"https://api.github.com/users/martint/received_events","type":"User","site_admin":false},"body":"In preparation for https://github.com/prestosql/presto/wiki/Pushdown-of-complex-operations, this change removes support for multiple layouts. It's a feature that's not used by any known connector, complicates the work of the optimizer and just gets in the way. In the future, we may add this functionality again but in a different form.","created_at":"2019-03-02T07:26:06Z","updated_at":"2019-03-07T18:54:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2bdbb384174a9d29d92964186c4c990ada39a1b9","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1202580151,"node_id":"MDU6TGFiZWwxMjAyNTgwMTUx","url":"https://api.github.com/repos/prestosql/presto/labels/cla-signed","name":"cla-signed","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/prestosql/presto/pulls/363/commits","review_comments_url":"https://api.github.com/repos/prestosql/presto/pulls/363/comments","review_comment_url":"https://api.github.com/repos/prestosql/presto/pulls/comments{/number}","comments_url":"https://api.github.com/repos/prestosql/presto/issues/363/comments","statuses_url":"https://api.github.com/repos/prestosql/presto/statuses/6773bb3fac19e8fd544e58d0b93771e55c0a10bc","head":{"label":"martint:tl-wip3","ref":"tl-wip3","sha":"6773bb3fac19e8fd544e58d0b93771e55c0a10bc","user":{"login":"martint","id":14387,"node_id":"MDQ6VXNlcjE0Mzg3","avatar_url":"https://avatars3.githubusercontent.com/u/14387?v=4","gravatar_id":"","url":"https://api.github.com/users/martint","html_url":"https://github.com/martint","followers_url":"https://api.github.com/users/martint/followers","following_url":"https://api.github.com/users/martint/following{/other_user}","gists_url":"https://api.github.com/users/martint/gists{/gist_id}","starred_url":"https://api.github.com/users/martint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martint/subscriptions","organizations_url":"https://api.github.com/users/martint/orgs","repos_url":"https://api.github.com/users/martint/repos","events_url":"https://api.github.com/users/martint/events{/privacy}","received_events_url":"https://api.github.com/users/martint/received_events","type":"User","site_admin":false},"repo":{"id":166516150,"node_id":"MDEwOlJlcG9zaXRvcnkxNjY1MTYxNTA=","name":"presto","full_name":"martint/presto","private":false,"owner":{"login":"martint","id":14387,"node_id":"MDQ6VXNlcjE0Mzg3","avatar_url":"https://avatars3.githubusercontent.com/u/14387?v=4","gravatar_id":"","url":"https://api.github.com/users/martint","html_url":"https://github.com/martint","followers_url":"https://api.github.com/users/martint/followers","following_url":"https://api.github.com/users/martint/following{/other_user}","gists_url":"https://api.github.com/users/martint/gists{/gist_id}","starred_url":"https://api.github.com/users/martint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martint/subscriptions","organizations_url":"https://api.github.com/users/martint/orgs","repos_url":"https://api.github.com/users/martint/repos","events_url":"https://api.github.com/users/martint/events{/privacy}","received_events_url":"https://api.github.com/users/martint/received_events","type":"User","site_admin":false},"html_url":"https://github.com/martint/presto","description":"Distributed SQL query engine for big data","fork":true,"url":"https://api.github.com/repos/martint/presto","forks_url":"https://api.github.com/repos/martint/presto/forks","keys_url":"https://api.github.com/repos/martint/presto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/martint/presto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/martint/presto/teams","hooks_url":"https://api.github.com/repos/martint/presto/hooks","issue_events_url":"https://api.github.com/repos/martint/presto/issues/events{/number}","events_url":"https://api.github.com/repos/martint/presto/events","assignees_url":"https://api.github.com/repos/martint/presto/assignees{/user}","branches_url":"https://api.github.com/repos/martint/presto/branches{/branch}","tags_url":"https://api.github.com/repos/martint/presto/tags","blobs_url":"https://api.github.com/repos/martint/presto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/martint/presto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/martint/presto/git/refs{/sha}","trees_url":"https://api.github.com/repos/martint/presto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/martint/presto/statuses/{sha}","languages_url":"https://api.github.com/repos/martint/presto/languages","stargazers_url":"https://api.github.com/repos/martint/presto/stargazers","contributors_url":"https://api.github.com/repos/martint/presto/contributors","subscribers_url":"https://api.github.com/repos/martint/presto/subscribers","subscription_url":"https://api.github.com/repos/martint/presto/subscription","commits_url":"https://api.github.com/repos/martint/presto/commits{/sha}","git_commits_url":"https://api.github.com/repos/martint/presto/git/commits{/sha}","comments_url":"https://api.github.com/repos/martint/presto/comments{/number}","issue_comment_url":"https://api.github.com/repos/martint/presto/issues/comments{/number}","contents_url":"https://api.github.com/repos/martint/presto/contents/{+path}","compare_url":"https://api.github.com/repos/martint/presto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/martint/presto/merges","archive_url":"https://api.github.com/repos/martint/presto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/martint/presto/downloads","issues_url":"https://api.github.com/repos/martint/presto/issues{/number}","pulls_url":"https://api.github.com/repos/martint/presto/pulls{/number}","milestones_url":"https://api.github.com/repos/martint/presto/milestones{/number}","notifications_url":"https://api.github.com/repos/martint/presto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/martint/presto/labels{/name}","releases_url":"https://api.github.com/repos/martint/presto/releases{/id}","deployments_url":"https://api.github.com/repos/martint/presto/deployments","created_at":"2019-01-19T06:51:51Z","updated_at":"2019-01-19T06:52:12Z","pushed_at":"2019-03-07T04:19:31Z","git_url":"git://github.com/martint/presto.git","ssh_url":"git@github.com:martint/presto.git","clone_url":"https://github.com/martint/presto.git","svn_url":"https://github.com/martint/presto","homepage":null,"size":74592,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"prestosql:master","ref":"master","sha":"3a1bd58d857e956b44115565c77fee687478595a","user":{"login":"prestosql","id":34147222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0MTQ3MjIy","avatar_url":"https://avatars3.githubusercontent.com/u/34147222?v=4","gravatar_id":"","url":"https://api.github.com/users/prestosql","html_url":"https://github.com/prestosql","followers_url":"https://api.github.com/users/prestosql/followers","following_url":"https://api.github.com/users/prestosql/following{/other_user}","gists_url":"https://api.github.com/users/prestosql/gists{/gist_id}","starred_url":"https://api.github.com/users/prestosql/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prestosql/subscriptions","organizations_url":"https://api.github.com/users/prestosql/orgs","repos_url":"https://api.github.com/users/prestosql/repos","events_url":"https://api.github.com/users/prestosql/events{/privacy}","received_events_url":"https://api.github.com/users/prestosql/received_events","type":"Organization","site_admin":false},"repo":{"id":166515022,"node_id":"MDEwOlJlcG9zaXRvcnkxNjY1MTUwMjI=","name":"presto","full_name":"prestosql/presto","private":false,"owner":{"login":"prestosql","id":34147222,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0MTQ3MjIy","avatar_url":"https://avatars3.githubusercontent.com/u/34147222?v=4","gravatar_id":"","url":"https://api.github.com/users/prestosql","html_url":"https://github.com/prestosql","followers_url":"https://api.github.com/users/prestosql/followers","following_url":"https://api.github.com/users/prestosql/following{/other_user}","gists_url":"https://api.github.com/users/prestosql/gists{/gist_id}","starred_url":"https://api.github.com/users/prestosql/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prestosql/subscriptions","organizations_url":"https://api.github.com/users/prestosql/orgs","repos_url":"https://api.github.com/users/prestosql/repos","events_url":"https://api.github.com/users/prestosql/events{/privacy}","received_events_url":"https://api.github.com/users/prestosql/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/prestosql/presto","description":"Official home of Presto, the distributed SQL query engine for big data","fork":false,"url":"https://api.github.com/repos/prestosql/presto","forks_url":"https://api.github.com/repos/prestosql/presto/forks","keys_url":"https://api.github.com/repos/prestosql/presto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/prestosql/presto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/prestosql/presto/teams","hooks_url":"https://api.github.com/repos/prestosql/presto/hooks","issue_events_url":"https://api.github.com/repos/prestosql/presto/issues/events{/number}","events_url":"https://api.github.com/repos/prestosql/presto/events","assignees_url":"https://api.github.com/repos/prestosql/presto/assignees{/user}","branches_url":"https://api.github.com/repos/prestosql/presto/branches{/branch}","tags_url":"https://api.github.com/repos/prestosql/presto/tags","blobs_url":"https://api.github.com/repos/prestosql/presto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/prestosql/presto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/prestosql/presto/git/refs{/sha}","trees_url":"https://api.github.com/repos/prestosql/presto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/prestosql/presto/statuses/{sha}","languages_url":"https://api.github.com/repos/prestosql/presto/languages","stargazers_url":"https://api.github.com/repos/prestosql/presto/stargazers","contributors_url":"https://api.github.com/repos/prestosql/presto/contributors","subscribers_url":"https://api.github.com/repos/prestosql/presto/subscribers","subscription_url":"https://api.github.com/repos/prestosql/presto/subscription","commits_url":"https://api.github.com/repos/prestosql/presto/commits{/sha}","git_commits_url":"https://api.github.com/repos/prestosql/presto/git/commits{/sha}","comments_url":"https://api.github.com/repos/prestosql/presto/comments{/number}","issue_comment_url":"https://api.github.com/repos/prestosql/presto/issues/comments{/number}","contents_url":"https://api.github.com/repos/prestosql/presto/contents/{+path}","compare_url":"https://api.github.com/repos/prestosql/presto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/prestosql/presto/merges","archive_url":"https://api.github.com/repos/prestosql/presto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/prestosql/presto/downloads","issues_url":"https://api.github.com/repos/prestosql/presto/issues{/number}","pulls_url":"https://api.github.com/repos/prestosql/presto/pulls{/number}","milestones_url":"https://api.github.com/repos/prestosql/presto/milestones{/number}","notifications_url":"https://api.github.com/repos/prestosql/presto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/prestosql/presto/labels{/name}","releases_url":"https://api.github.com/repos/prestosql/presto/releases{/id}","deployments_url":"https://api.github.com/repos/prestosql/presto/deployments","created_at":"2019-01-19T06:38:14Z","updated_at":"2019-03-07T17:17:02Z","pushed_at":"2019-03-07T16:10:12Z","git_url":"git://github.com/prestosql/presto.git","ssh_url":"git@github.com:prestosql/presto.git","clone_url":"https://github.com/prestosql/presto.git","svn_url":"https://github.com/prestosql/presto","homepage":"https://prestosql.io","size":74773,"stargazers_count":274,"watchers_count":274,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":90,"mirror_url":null,"archived":false,"open_issues_count":108,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":90,"open_issues":108,"watchers":274,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/prestosql/presto/pulls/363"},"html":{"href":"https://github.com/prestosql/presto/pull/363"},"issue":{"href":"https://api.github.com/repos/prestosql/presto/issues/363"},"comments":{"href":"https://api.github.com/repos/prestosql/presto/issues/363/comments"},"review_comments":{"href":"https://api.github.com/repos/prestosql/presto/pulls/363/comments"},"review_comment":{"href":"https://api.github.com/repos/prestosql/presto/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/prestosql/presto/pulls/363/commits"},"statuses":{"href":"https://api.github.com/repos/prestosql/presto/statuses/6773bb3fac19e8fd544e58d0b93771e55c0a10bc"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"dain"}}