{"action":"created","comment":{"url":"https://api.github.com/repos/apache/metron/pulls/comments/147258452","pull_request_review_id":72330849,"id":147258452,"diff_hunk":"@@ -218,6 +218,25 @@ public void testVariablesUsed() {\n     }\n   }\n \n+  @Test\n+  public void testConditionalsAsMapKeys() {\n+    {\n+      String query = \"{ ( RET_TRUE() && y < 50 ) : 'info', y >= 50 : 'warn'}\";\n+      Map<Boolean, String> ret = (Map)run(query, ImmutableMap.of(\"y\", 50));\n+      Assert.assertEquals(ret.size(), 2);\n+      Assert.assertEquals(\"warn\", ret.get(true));\n+      Assert.assertEquals(\"info\", ret.get(false));\n+    }\n+  }\n+\n+\n+  @Test\n+  public void testConditionalsAsFunctionArgs() {\n+    {\n+      String query = \"RET_TRUE(y < 10)\";\n+      Assert.assertTrue((boolean)run(query, ImmutableMap.of(\"y\", 50)));\n+    }\n+  }\n ","path":"metron-stellar/stellar-common/src/test/java/org/apache/metron/stellar/dsl/functions/BasicStellarTest.java","position":23,"original_position":23,"commit_id":"9a40bde3954958f963683dbfc89bf92fcf97931f","original_commit_id":"9a40bde3954958f963683dbfc89bf92fcf97931f","user":{"login":"cestella","id":540359,"avatar_url":"https://avatars0.githubusercontent.com/u/540359?v=4","gravatar_id":"","url":"https://api.github.com/users/cestella","html_url":"https://github.com/cestella","followers_url":"https://api.github.com/users/cestella/followers","following_url":"https://api.github.com/users/cestella/following{/other_user}","gists_url":"https://api.github.com/users/cestella/gists{/gist_id}","starred_url":"https://api.github.com/users/cestella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cestella/subscriptions","organizations_url":"https://api.github.com/users/cestella/orgs","repos_url":"https://api.github.com/users/cestella/repos","events_url":"https://api.github.com/users/cestella/events{/privacy}","received_events_url":"https://api.github.com/users/cestella/received_events","type":"User","site_admin":false},"body":"I wouldn't be opposed to adding the case, mind you.  I'll go ahead and add it to be explicit.","created_at":"2017-10-26T20:31:33Z","updated_at":"2017-10-26T20:31:33Z","html_url":"https://github.com/apache/metron/pull/801#discussion_r147258452","pull_request_url":"https://api.github.com/repos/apache/metron/pulls/801","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/apache/metron/pulls/comments/147258452"},"html":{"href":"https://github.com/apache/metron/pull/801#discussion_r147258452"},"pull_request":{"href":"https://api.github.com/repos/apache/metron/pulls/801"}},"in_reply_to_id":147239180},"pull_request":{"url":"https://api.github.com/repos/apache/metron/pulls/801","id":147077063,"html_url":"https://github.com/apache/metron/pull/801","diff_url":"https://github.com/apache/metron/pull/801.diff","patch_url":"https://github.com/apache/metron/pull/801.patch","issue_url":"https://api.github.com/repos/apache/metron/issues/801","number":801,"state":"open","locked":false,"title":"METRON-1254: Conditionals as map keys do not function in Stellar","user":{"login":"cestella","id":540359,"avatar_url":"https://avatars0.githubusercontent.com/u/540359?v=4","gravatar_id":"","url":"https://api.github.com/users/cestella","html_url":"https://github.com/cestella","followers_url":"https://api.github.com/users/cestella/followers","following_url":"https://api.github.com/users/cestella/following{/other_user}","gists_url":"https://api.github.com/users/cestella/gists{/gist_id}","starred_url":"https://api.github.com/users/cestella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cestella/subscriptions","organizations_url":"https://api.github.com/users/cestella/orgs","repos_url":"https://api.github.com/users/cestella/repos","events_url":"https://api.github.com/users/cestella/events{/privacy}","received_events_url":"https://api.github.com/users/cestella/received_events","type":"User","site_admin":false},"body":"## Contributor Comments\r\nWe currently cannot represent map literals in stellar where the keys are conditionals. For instance, the expression `{ x < 10 : 'info' }` cannot be parsed currently and it should do. Having this enables a switch-style statement: `MAP_GET(true, { x < 10 : 'info', x >= 10 : 'warn' })`\r\n\r\n\r\n## Pull Request Checklist\r\n\r\nThank you for submitting a contribution to Apache Metron.  \r\nPlease refer to our [Development Guidelines](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=61332235) for the complete guide to follow for contributions.  \r\nPlease refer also to our [Build Verification Guidelines](https://cwiki.apache.org/confluence/display/METRON/Verifying+Builds?show-miniview) for complete smoke testing guides.  \r\n\r\n\r\nIn order to streamline the review of the contribution we ask you follow these guidelines and ask you to double check the following:\r\n\r\n### For all changes:\r\n- [x] Is there a JIRA ticket associated with this PR? If not one needs to be created at [Metron Jira](https://issues.apache.org/jira/browse/METRON/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel). \r\n- [x] Does your PR title start with METRON-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen \"-\" character.\r\n- [x] Has your PR been rebased against the latest commit within the target branch (typically master)?\r\n\r\n\r\n### For code changes:\r\n- [x] Have you included steps to reproduce the behavior or problem that is being changed or addressed?\r\n- [x] Have you included steps or a guide to how the change may be verified and tested manually?\r\n- [x] Have you ensured that the full suite of tests and checks have been executed in the root metron folder via:\r\n  ```\r\n  mvn -q clean integration-test install && build_utils/verify_licenses.sh \r\n  ```\r\n\r\n- [x] Have you written or updated unit tests and or integration tests to verify your changes?\r\n- [x] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? \r\n- [x] Have you verified the basic functionality of the build by building and running locally with Vagrant full-dev environment or the equivalent?\r\n\r\n### For documentation related changes:\r\n- [x] Have you ensured that format looks appropriate for the output in which it is rendered by building and verifying the site-book? If not then run the following commands and the verify changes via `site-book/target/site/index.html`:\r\n\r\n  ```\r\n  cd site-book\r\n  mvn site\r\n  ```\r\n\r\n#### Note:\r\nPlease ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.\r\nIt is also recommended that [travis-ci](https://travis-ci.org) is set up for your personal repository such that your branches are built there before submitting a pull request.\r\n\r\n","created_at":"2017-10-17T15:38:21Z","updated_at":"2017-10-26T20:31:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d6538efa6f95fd6b3ff35cd21fdb4702379bf5a1","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/metron/pulls/801/commits","review_comments_url":"https://api.github.com/repos/apache/metron/pulls/801/comments","review_comment_url":"https://api.github.com/repos/apache/metron/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/metron/issues/801/comments","statuses_url":"https://api.github.com/repos/apache/metron/statuses/9a40bde3954958f963683dbfc89bf92fcf97931f","head":{"label":"cestella:conditionals_as_map_keys","ref":"conditionals_as_map_keys","sha":"9a40bde3954958f963683dbfc89bf92fcf97931f","user":{"login":"cestella","id":540359,"avatar_url":"https://avatars0.githubusercontent.com/u/540359?v=4","gravatar_id":"","url":"https://api.github.com/users/cestella","html_url":"https://github.com/cestella","followers_url":"https://api.github.com/users/cestella/followers","following_url":"https://api.github.com/users/cestella/following{/other_user}","gists_url":"https://api.github.com/users/cestella/gists{/gist_id}","starred_url":"https://api.github.com/users/cestella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cestella/subscriptions","organizations_url":"https://api.github.com/users/cestella/orgs","repos_url":"https://api.github.com/users/cestella/repos","events_url":"https://api.github.com/users/cestella/events{/privacy}","received_events_url":"https://api.github.com/users/cestella/received_events","type":"User","site_admin":false},"repo":{"id":47701789,"name":"incubator-metron","full_name":"cestella/incubator-metron","owner":{"login":"cestella","id":540359,"avatar_url":"https://avatars0.githubusercontent.com/u/540359?v=4","gravatar_id":"","url":"https://api.github.com/users/cestella","html_url":"https://github.com/cestella","followers_url":"https://api.github.com/users/cestella/followers","following_url":"https://api.github.com/users/cestella/following{/other_user}","gists_url":"https://api.github.com/users/cestella/gists{/gist_id}","starred_url":"https://api.github.com/users/cestella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cestella/subscriptions","organizations_url":"https://api.github.com/users/cestella/orgs","repos_url":"https://api.github.com/users/cestella/repos","events_url":"https://api.github.com/users/cestella/events{/privacy}","received_events_url":"https://api.github.com/users/cestella/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cestella/incubator-metron","description":"Mirror of Apache Metron (Incubating)","fork":true,"url":"https://api.github.com/repos/cestella/incubator-metron","forks_url":"https://api.github.com/repos/cestella/incubator-metron/forks","keys_url":"https://api.github.com/repos/cestella/incubator-metron/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cestella/incubator-metron/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cestella/incubator-metron/teams","hooks_url":"https://api.github.com/repos/cestella/incubator-metron/hooks","issue_events_url":"https://api.github.com/repos/cestella/incubator-metron/issues/events{/number}","events_url":"https://api.github.com/repos/cestella/incubator-metron/events","assignees_url":"https://api.github.com/repos/cestella/incubator-metron/assignees{/user}","branches_url":"https://api.github.com/repos/cestella/incubator-metron/branches{/branch}","tags_url":"https://api.github.com/repos/cestella/incubator-metron/tags","blobs_url":"https://api.github.com/repos/cestella/incubator-metron/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cestella/incubator-metron/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cestella/incubator-metron/git/refs{/sha}","trees_url":"https://api.github.com/repos/cestella/incubator-metron/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cestella/incubator-metron/statuses/{sha}","languages_url":"https://api.github.com/repos/cestella/incubator-metron/languages","stargazers_url":"https://api.github.com/repos/cestella/incubator-metron/stargazers","contributors_url":"https://api.github.com/repos/cestella/incubator-metron/contributors","subscribers_url":"https://api.github.com/repos/cestella/incubator-metron/subscribers","subscription_url":"https://api.github.com/repos/cestella/incubator-metron/subscription","commits_url":"https://api.github.com/repos/cestella/incubator-metron/commits{/sha}","git_commits_url":"https://api.github.com/repos/cestella/incubator-metron/git/commits{/sha}","comments_url":"https://api.github.com/repos/cestella/incubator-metron/comments{/number}","issue_comment_url":"https://api.github.com/repos/cestella/incubator-metron/issues/comments{/number}","contents_url":"https://api.github.com/repos/cestella/incubator-metron/contents/{+path}","compare_url":"https://api.github.com/repos/cestella/incubator-metron/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cestella/incubator-metron/merges","archive_url":"https://api.github.com/repos/cestella/incubator-metron/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cestella/incubator-metron/downloads","issues_url":"https://api.github.com/repos/cestella/incubator-metron/issues{/number}","pulls_url":"https://api.github.com/repos/cestella/incubator-metron/pulls{/number}","milestones_url":"https://api.github.com/repos/cestella/incubator-metron/milestones{/number}","notifications_url":"https://api.github.com/repos/cestella/incubator-metron/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cestella/incubator-metron/labels{/name}","releases_url":"https://api.github.com/repos/cestella/incubator-metron/releases{/id}","deployments_url":"https://api.github.com/repos/cestella/incubator-metron/deployments","created_at":"2015-12-09T15:57:23Z","updated_at":"2017-02-07T03:31:44Z","pushed_at":"2017-10-26T19:47:31Z","git_url":"git://github.com/cestella/incubator-metron.git","ssh_url":"git@github.com:cestella/incubator-metron.git","clone_url":"https://github.com/cestella/incubator-metron.git","svn_url":"https://github.com/cestella/incubator-metron","homepage":null,"size":62850,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"fef8833c153fabef597084f4aace8303d9f7116e","user":{"login":"apache","id":47359,"avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":47607561,"name":"metron","full_name":"apache/metron","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/metron","description":"Mirror of Apache Metron","fork":false,"url":"https://api.github.com/repos/apache/metron","forks_url":"https://api.github.com/repos/apache/metron/forks","keys_url":"https://api.github.com/repos/apache/metron/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/metron/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/metron/teams","hooks_url":"https://api.github.com/repos/apache/metron/hooks","issue_events_url":"https://api.github.com/repos/apache/metron/issues/events{/number}","events_url":"https://api.github.com/repos/apache/metron/events","assignees_url":"https://api.github.com/repos/apache/metron/assignees{/user}","branches_url":"https://api.github.com/repos/apache/metron/branches{/branch}","tags_url":"https://api.github.com/repos/apache/metron/tags","blobs_url":"https://api.github.com/repos/apache/metron/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/metron/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/metron/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/metron/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/metron/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/metron/languages","stargazers_url":"https://api.github.com/repos/apache/metron/stargazers","contributors_url":"https://api.github.com/repos/apache/metron/contributors","subscribers_url":"https://api.github.com/repos/apache/metron/subscribers","subscription_url":"https://api.github.com/repos/apache/metron/subscription","commits_url":"https://api.github.com/repos/apache/metron/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/metron/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/metron/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/metron/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/metron/contents/{+path}","compare_url":"https://api.github.com/repos/apache/metron/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/metron/merges","archive_url":"https://api.github.com/repos/apache/metron/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/metron/downloads","issues_url":"https://api.github.com/repos/apache/metron/issues{/number}","pulls_url":"https://api.github.com/repos/apache/metron/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/metron/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/metron/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/metron/labels{/name}","releases_url":"https://api.github.com/repos/apache/metron/releases{/id}","deployments_url":"https://api.github.com/repos/apache/metron/deployments","created_at":"2015-12-08T08:00:05Z","updated_at":"2017-10-25T03:20:35Z","pushed_at":"2017-10-26T19:54:19Z","git_url":"git://github.com/apache/metron.git","ssh_url":"git@github.com:apache/metron.git","clone_url":"https://github.com/apache/metron.git","svn_url":"https://github.com/apache/metron","homepage":"","size":57645,"stargazers_count":367,"watchers_count":367,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":296,"mirror_url":"git://git.apache.org/metron.git","archived":false,"open_issues_count":27,"forks":296,"open_issues":27,"watchers":367,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/metron/pulls/801"},"html":{"href":"https://github.com/apache/metron/pull/801"},"issue":{"href":"https://api.github.com/repos/apache/metron/issues/801"},"comments":{"href":"https://api.github.com/repos/apache/metron/issues/801/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/metron/pulls/801/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/metron/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/metron/pulls/801/commits"},"statuses":{"href":"https://api.github.com/repos/apache/metron/statuses/9a40bde3954958f963683dbfc89bf92fcf97931f"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"cestella"}}