{"action":"created","comment":{"url":"https://api.github.com/repos/mldbai/mldb/pulls/comments/48265898","id":48265898,"diff_hunk":"@@ -178,6 +198,30 @@ template<typename FieldType> struct PlainColumnSelect\n     }\n };\n \n+\n+inline bool containsNamedSubSelect(const InputQuery& query, const std::string& name) \n+{\n+\n+    auto getComputedVariable = [] (const std::shared_ptr<SqlRowExpression> expression)\n+        -> std::shared_ptr<const ComputedVariable>\n+        {\n+            return std::dynamic_pointer_cast<const ComputedVariable>(expression);\n+        };\n+\n+    if (query.stm) {\n+        auto & select = query.stm->select;\n+        for (const auto & clause : select.clauses) {\n+            \n+            auto computedVariable = getComputedVariable(clause);\n+            if (computedVariable) {\n+                if (computedVariable->alias ==  name)","path":"plugins/sql_config_validator.h","position":59,"original_position":59,"commit_id":"78a89502b175531a0476d2ee2fe3ed18aa4979da","original_commit_id":"78a89502b175531a0476d2ee2fe3ed18aa4979da","user":{"login":"guyd","id":683788,"avatar_url":"https://avatars.githubusercontent.com/u/683788?v=3","gravatar_id":"","url":"https://api.github.com/users/guyd","html_url":"https://github.com/guyd","followers_url":"https://api.github.com/users/guyd/followers","following_url":"https://api.github.com/users/guyd/following{/other_user}","gists_url":"https://api.github.com/users/guyd/gists{/gist_id}","starred_url":"https://api.github.com/users/guyd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guyd/subscriptions","organizations_url":"https://api.github.com/users/guyd/orgs","repos_url":"https://api.github.com/users/guyd/repos","events_url":"https://api.github.com/users/guyd/events{/privacy}","received_events_url":"https://api.github.com/users/guyd/received_events","type":"User","site_admin":false},"body":"I missed that spot from the previous comment in another PR!  Will do.","created_at":"2015-12-22T15:51:20Z","updated_at":"2015-12-22T15:51:20Z","html_url":"https://github.com/mldbai/mldb/pull/31#discussion_r48265898","pull_request_url":"https://api.github.com/repos/mldbai/mldb/pulls/31","_links":{"self":{"href":"https://api.github.com/repos/mldbai/mldb/pulls/comments/48265898"},"html":{"href":"https://github.com/mldbai/mldb/pull/31#discussion_r48265898"},"pull_request":{"href":"https://api.github.com/repos/mldbai/mldb/pulls/31"}}},"pull_request":{"url":"https://api.github.com/repos/mldbai/mldb/pulls/31","id":54377949,"html_url":"https://github.com/mldbai/mldb/pull/31","diff_url":"https://github.com/mldbai/mldb/pull/31.diff","patch_url":"https://github.com/mldbai/mldb/pull/31.patch","issue_url":"https://api.github.com/repos/mldbai/mldb/issues/31","number":31,"state":"open","locked":false,"title":"[MLDB-1104] folded score and weight into the sql query","user":{"login":"guyd","id":683788,"avatar_url":"https://avatars.githubusercontent.com/u/683788?v=3","gravatar_id":"","url":"https://api.github.com/users/guyd","html_url":"https://github.com/guyd","followers_url":"https://api.github.com/users/guyd/followers","following_url":"https://api.github.com/users/guyd/following{/other_user}","gists_url":"https://api.github.com/users/guyd/gists{/gist_id}","starred_url":"https://api.github.com/users/guyd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guyd/subscriptions","organizations_url":"https://api.github.com/users/guyd/orgs","repos_url":"https://api.github.com/users/guyd/repos","events_url":"https://api.github.com/users/guyd/events{/privacy}","received_events_url":"https://api.github.com/users/guyd/received_events","type":"User","site_admin":false},"body":"- modified accuracy to take a score in its testingData expression\r\n- modified accuracy and classifier to take a weight in its input data\r\n- adapted experiment accordingly\r\n- updated test cases","created_at":"2015-12-22T14:57:37Z","updated_at":"2015-12-22T15:51:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f617f6c49432296c70af69869e3c54f6bc76b07c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mldbai/mldb/pulls/31/commits","review_comments_url":"https://api.github.com/repos/mldbai/mldb/pulls/31/comments","review_comment_url":"https://api.github.com/repos/mldbai/mldb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mldbai/mldb/issues/31/comments","statuses_url":"https://api.github.com/repos/mldbai/mldb/statuses/78a89502b175531a0476d2ee2fe3ed18aa4979da","head":{"label":"mldbai:MLDB-1104-combined-sql-and-dataset","ref":"MLDB-1104-combined-sql-and-dataset","sha":"78a89502b175531a0476d2ee2fe3ed18aa4979da","user":{"login":"mldbai","id":11510172,"avatar_url":"https://avatars.githubusercontent.com/u/11510172?v=3","gravatar_id":"","url":"https://api.github.com/users/mldbai","html_url":"https://github.com/mldbai","followers_url":"https://api.github.com/users/mldbai/followers","following_url":"https://api.github.com/users/mldbai/following{/other_user}","gists_url":"https://api.github.com/users/mldbai/gists{/gist_id}","starred_url":"https://api.github.com/users/mldbai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mldbai/subscriptions","organizations_url":"https://api.github.com/users/mldbai/orgs","repos_url":"https://api.github.com/users/mldbai/repos","events_url":"https://api.github.com/users/mldbai/events{/privacy}","received_events_url":"https://api.github.com/users/mldbai/received_events","type":"Organization","site_admin":false},"repo":{"id":47634692,"name":"mldb","full_name":"mldbai/mldb","owner":{"login":"mldbai","id":11510172,"avatar_url":"https://avatars.githubusercontent.com/u/11510172?v=3","gravatar_id":"","url":"https://api.github.com/users/mldbai","html_url":"https://github.com/mldbai","followers_url":"https://api.github.com/users/mldbai/followers","following_url":"https://api.github.com/users/mldbai/following{/other_user}","gists_url":"https://api.github.com/users/mldbai/gists{/gist_id}","starred_url":"https://api.github.com/users/mldbai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mldbai/subscriptions","organizations_url":"https://api.github.com/users/mldbai/orgs","repos_url":"https://api.github.com/users/mldbai/repos","events_url":"https://api.github.com/users/mldbai/events{/privacy}","received_events_url":"https://api.github.com/users/mldbai/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mldbai/mldb","description":"MLDB is the Machine Learning Database","fork":false,"url":"https://api.github.com/repos/mldbai/mldb","forks_url":"https://api.github.com/repos/mldbai/mldb/forks","keys_url":"https://api.github.com/repos/mldbai/mldb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mldbai/mldb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mldbai/mldb/teams","hooks_url":"https://api.github.com/repos/mldbai/mldb/hooks","issue_events_url":"https://api.github.com/repos/mldbai/mldb/issues/events{/number}","events_url":"https://api.github.com/repos/mldbai/mldb/events","assignees_url":"https://api.github.com/repos/mldbai/mldb/assignees{/user}","branches_url":"https://api.github.com/repos/mldbai/mldb/branches{/branch}","tags_url":"https://api.github.com/repos/mldbai/mldb/tags","blobs_url":"https://api.github.com/repos/mldbai/mldb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mldbai/mldb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mldbai/mldb/git/refs{/sha}","trees_url":"https://api.github.com/repos/mldbai/mldb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mldbai/mldb/statuses/{sha}","languages_url":"https://api.github.com/repos/mldbai/mldb/languages","stargazers_url":"https://api.github.com/repos/mldbai/mldb/stargazers","contributors_url":"https://api.github.com/repos/mldbai/mldb/contributors","subscribers_url":"https://api.github.com/repos/mldbai/mldb/subscribers","subscription_url":"https://api.github.com/repos/mldbai/mldb/subscription","commits_url":"https://api.github.com/repos/mldbai/mldb/commits{/sha}","git_commits_url":"https://api.github.com/repos/mldbai/mldb/git/commits{/sha}","comments_url":"https://api.github.com/repos/mldbai/mldb/comments{/number}","issue_comment_url":"https://api.github.com/repos/mldbai/mldb/issues/comments{/number}","contents_url":"https://api.github.com/repos/mldbai/mldb/contents/{+path}","compare_url":"https://api.github.com/repos/mldbai/mldb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mldbai/mldb/merges","archive_url":"https://api.github.com/repos/mldbai/mldb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mldbai/mldb/downloads","issues_url":"https://api.github.com/repos/mldbai/mldb/issues{/number}","pulls_url":"https://api.github.com/repos/mldbai/mldb/pulls{/number}","milestones_url":"https://api.github.com/repos/mldbai/mldb/milestones{/number}","notifications_url":"https://api.github.com/repos/mldbai/mldb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mldbai/mldb/labels{/name}","releases_url":"https://api.github.com/repos/mldbai/mldb/releases{/id}","created_at":"2015-12-08T16:34:16Z","updated_at":"2015-12-17T18:07:05Z","pushed_at":"2015-12-22T15:44:18Z","git_url":"git://github.com/mldbai/mldb.git","ssh_url":"git@github.com:mldbai/mldb.git","clone_url":"https://github.com/mldbai/mldb.git","svn_url":"https://github.com/mldbai/mldb","homepage":"http://mldb.ai","size":8721,"stargazers_count":7,"watchers_count":7,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":7,"default_branch":"master"}},"base":{"label":"mldbai:master","ref":"master","sha":"3ae92bad0e454050e143e3f4da5def3002d394d0","user":{"login":"mldbai","id":11510172,"avatar_url":"https://avatars.githubusercontent.com/u/11510172?v=3","gravatar_id":"","url":"https://api.github.com/users/mldbai","html_url":"https://github.com/mldbai","followers_url":"https://api.github.com/users/mldbai/followers","following_url":"https://api.github.com/users/mldbai/following{/other_user}","gists_url":"https://api.github.com/users/mldbai/gists{/gist_id}","starred_url":"https://api.github.com/users/mldbai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mldbai/subscriptions","organizations_url":"https://api.github.com/users/mldbai/orgs","repos_url":"https://api.github.com/users/mldbai/repos","events_url":"https://api.github.com/users/mldbai/events{/privacy}","received_events_url":"https://api.github.com/users/mldbai/received_events","type":"Organization","site_admin":false},"repo":{"id":47634692,"name":"mldb","full_name":"mldbai/mldb","owner":{"login":"mldbai","id":11510172,"avatar_url":"https://avatars.githubusercontent.com/u/11510172?v=3","gravatar_id":"","url":"https://api.github.com/users/mldbai","html_url":"https://github.com/mldbai","followers_url":"https://api.github.com/users/mldbai/followers","following_url":"https://api.github.com/users/mldbai/following{/other_user}","gists_url":"https://api.github.com/users/mldbai/gists{/gist_id}","starred_url":"https://api.github.com/users/mldbai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mldbai/subscriptions","organizations_url":"https://api.github.com/users/mldbai/orgs","repos_url":"https://api.github.com/users/mldbai/repos","events_url":"https://api.github.com/users/mldbai/events{/privacy}","received_events_url":"https://api.github.com/users/mldbai/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mldbai/mldb","description":"MLDB is the Machine Learning Database","fork":false,"url":"https://api.github.com/repos/mldbai/mldb","forks_url":"https://api.github.com/repos/mldbai/mldb/forks","keys_url":"https://api.github.com/repos/mldbai/mldb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mldbai/mldb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mldbai/mldb/teams","hooks_url":"https://api.github.com/repos/mldbai/mldb/hooks","issue_events_url":"https://api.github.com/repos/mldbai/mldb/issues/events{/number}","events_url":"https://api.github.com/repos/mldbai/mldb/events","assignees_url":"https://api.github.com/repos/mldbai/mldb/assignees{/user}","branches_url":"https://api.github.com/repos/mldbai/mldb/branches{/branch}","tags_url":"https://api.github.com/repos/mldbai/mldb/tags","blobs_url":"https://api.github.com/repos/mldbai/mldb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mldbai/mldb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mldbai/mldb/git/refs{/sha}","trees_url":"https://api.github.com/repos/mldbai/mldb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mldbai/mldb/statuses/{sha}","languages_url":"https://api.github.com/repos/mldbai/mldb/languages","stargazers_url":"https://api.github.com/repos/mldbai/mldb/stargazers","contributors_url":"https://api.github.com/repos/mldbai/mldb/contributors","subscribers_url":"https://api.github.com/repos/mldbai/mldb/subscribers","subscription_url":"https://api.github.com/repos/mldbai/mldb/subscription","commits_url":"https://api.github.com/repos/mldbai/mldb/commits{/sha}","git_commits_url":"https://api.github.com/repos/mldbai/mldb/git/commits{/sha}","comments_url":"https://api.github.com/repos/mldbai/mldb/comments{/number}","issue_comment_url":"https://api.github.com/repos/mldbai/mldb/issues/comments{/number}","contents_url":"https://api.github.com/repos/mldbai/mldb/contents/{+path}","compare_url":"https://api.github.com/repos/mldbai/mldb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mldbai/mldb/merges","archive_url":"https://api.github.com/repos/mldbai/mldb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mldbai/mldb/downloads","issues_url":"https://api.github.com/repos/mldbai/mldb/issues{/number}","pulls_url":"https://api.github.com/repos/mldbai/mldb/pulls{/number}","milestones_url":"https://api.github.com/repos/mldbai/mldb/milestones{/number}","notifications_url":"https://api.github.com/repos/mldbai/mldb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mldbai/mldb/labels{/name}","releases_url":"https://api.github.com/repos/mldbai/mldb/releases{/id}","created_at":"2015-12-08T16:34:16Z","updated_at":"2015-12-17T18:07:05Z","pushed_at":"2015-12-22T15:44:18Z","git_url":"git://github.com/mldbai/mldb.git","ssh_url":"git@github.com:mldbai/mldb.git","clone_url":"https://github.com/mldbai/mldb.git","svn_url":"https://github.com/mldbai/mldb","homepage":"http://mldb.ai","size":8721,"stargazers_count":7,"watchers_count":7,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mldbai/mldb/pulls/31"},"html":{"href":"https://github.com/mldbai/mldb/pull/31"},"issue":{"href":"https://api.github.com/repos/mldbai/mldb/issues/31"},"comments":{"href":"https://api.github.com/repos/mldbai/mldb/issues/31/comments"},"review_comments":{"href":"https://api.github.com/repos/mldbai/mldb/pulls/31/comments"},"review_comment":{"href":"https://api.github.com/repos/mldbai/mldb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mldbai/mldb/pulls/31/commits"},"statuses":{"href":"https://api.github.com/repos/mldbai/mldb/statuses/78a89502b175531a0476d2ee2fe3ed18aa4979da"}}}}