{"action":"created","comment":{"url":"https://api.github.com/repos/apache/beam/pulls/comments/174321131","pull_request_review_id":103655807,"id":174321131,"diff_hunk":"@@ -53,10 +54,8 @@ protected BeamSqlArithmeticExpression(List<BeamSqlExpression> operands, SqlTypeN\n \n   @Override public BeamSqlPrimitive<? extends Number> evaluate(Row inputRow,\n       BoundedWindow window) {\n-    BigDecimal left = BigDecimal.valueOf(\n-        Double.valueOf(opValueEvaluated(0, inputRow, window).toString()));\n-    BigDecimal right = BigDecimal.valueOf(\n-        Double.valueOf(opValueEvaluated(1, inputRow, window).toString()));\n+    BigDecimal left = SqlFunctions.toBigDecimal((Number) opValueEvaluated(0, inputRow, window));","path":"sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/interpreter/operator/arithmetic/BeamSqlArithmeticExpression.java","position":16,"original_position":16,"commit_id":"29a5160b08b8da1c166faf18933c3fc61325eae9","original_commit_id":"29a5160b08b8da1c166faf18933c3fc61325eae9","user":{"login":"akedin","id":33067037,"avatar_url":"https://avatars0.githubusercontent.com/u/33067037?v=4","gravatar_id":"","url":"https://api.github.com/users/akedin","html_url":"https://github.com/akedin","followers_url":"https://api.github.com/users/akedin/followers","following_url":"https://api.github.com/users/akedin/following{/other_user}","gists_url":"https://api.github.com/users/akedin/gists{/gist_id}","starred_url":"https://api.github.com/users/akedin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akedin/subscriptions","organizations_url":"https://api.github.com/users/akedin/orgs","repos_url":"https://api.github.com/users/akedin/repos","events_url":"https://api.github.com/users/akedin/events{/privacy}","received_events_url":"https://api.github.com/users/akedin/received_events","type":"User","site_admin":false},"body":"Why not use the [`toBigDecimal(Object)`](https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java#L1673) overload","created_at":"2018-03-14T00:03:51Z","updated_at":"2018-03-14T00:03:51Z","html_url":"https://github.com/apache/beam/pull/4865#discussion_r174321131","pull_request_url":"https://api.github.com/repos/apache/beam/pulls/4865","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/apache/beam/pulls/comments/174321131"},"html":{"href":"https://github.com/apache/beam/pull/4865#discussion_r174321131"},"pull_request":{"href":"https://api.github.com/repos/apache/beam/pulls/4865"}}},"pull_request":{"url":"https://api.github.com/repos/apache/beam/pulls/4865","id":174816099,"html_url":"https://github.com/apache/beam/pull/4865","diff_url":"https://github.com/apache/beam/pull/4865.diff","patch_url":"https://github.com/apache/beam/pull/4865.patch","issue_url":"https://api.github.com/repos/apache/beam/issues/4865","number":4865,"state":"open","locked":false,"title":"[BEAM-2281][Sql] Use SqlFunctions.toBigDecimal not toString","user":{"login":"apilloud","id":5972627,"avatar_url":"https://avatars2.githubusercontent.com/u/5972627?v=4","gravatar_id":"","url":"https://api.github.com/users/apilloud","html_url":"https://github.com/apilloud","followers_url":"https://api.github.com/users/apilloud/followers","following_url":"https://api.github.com/users/apilloud/following{/other_user}","gists_url":"https://api.github.com/users/apilloud/gists{/gist_id}","starred_url":"https://api.github.com/users/apilloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apilloud/subscriptions","organizations_url":"https://api.github.com/users/apilloud/orgs","repos_url":"https://api.github.com/users/apilloud/repos","events_url":"https://api.github.com/users/apilloud/events{/privacy}","received_events_url":"https://api.github.com/users/apilloud/received_events","type":"User","site_admin":false},"body":"Instead of using BigDecimal(object.toString()) to convert, use SqlFunctions.toBigDecimal which converts directly between numeric types. This speeds up the Nexmark Query 2 parDo by 2x.\r\n\r\n------------------------\r\n\r\nFollow this checklist to help us incorporate your contribution quickly and easily:\r\n\r\n - [X] Make sure there is a [JIRA issue](https://issues.apache.org/jira/projects/BEAM/issues/) filed for the change (usually before you start working on it).  Trivial changes like typos do not require a JIRA issue.  Your pull request should address just this issue, without pulling in other changes.\r\n - [X] Format the pull request title like `[BEAM-XXX] Fixes bug in ApproximateQuantiles`, where you replace `BEAM-XXX` with the appropriate JIRA issue.\r\n - [X] Write a pull request description that is detailed enough to understand:\r\n   - [X] What the pull request does\r\n   - [X] Why it does it\r\n   - [X] How it does it\r\n   - [X] Why this approach\r\n - [X] Each commit in the pull request should have a meaningful subject line and body.\r\n - [X] Run `mvn clean verify` to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.","created_at":"2018-03-13T23:19:00Z","updated_at":"2018-03-14T00:03:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5352cd6e99a570176f37f4807e05590d6e3a8026","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/beam/pulls/4865/commits","review_comments_url":"https://api.github.com/repos/apache/beam/pulls/4865/comments","review_comment_url":"https://api.github.com/repos/apache/beam/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/beam/issues/4865/comments","statuses_url":"https://api.github.com/repos/apache/beam/statuses/29a5160b08b8da1c166faf18933c3fc61325eae9","head":{"label":"apilloud:sqlperf","ref":"sqlperf","sha":"29a5160b08b8da1c166faf18933c3fc61325eae9","user":{"login":"apilloud","id":5972627,"avatar_url":"https://avatars2.githubusercontent.com/u/5972627?v=4","gravatar_id":"","url":"https://api.github.com/users/apilloud","html_url":"https://github.com/apilloud","followers_url":"https://api.github.com/users/apilloud/followers","following_url":"https://api.github.com/users/apilloud/following{/other_user}","gists_url":"https://api.github.com/users/apilloud/gists{/gist_id}","starred_url":"https://api.github.com/users/apilloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apilloud/subscriptions","organizations_url":"https://api.github.com/users/apilloud/orgs","repos_url":"https://api.github.com/users/apilloud/repos","events_url":"https://api.github.com/users/apilloud/events{/privacy}","received_events_url":"https://api.github.com/users/apilloud/received_events","type":"User","site_admin":false},"repo":{"id":119748403,"name":"beam","full_name":"apilloud/beam","owner":{"login":"apilloud","id":5972627,"avatar_url":"https://avatars2.githubusercontent.com/u/5972627?v=4","gravatar_id":"","url":"https://api.github.com/users/apilloud","html_url":"https://github.com/apilloud","followers_url":"https://api.github.com/users/apilloud/followers","following_url":"https://api.github.com/users/apilloud/following{/other_user}","gists_url":"https://api.github.com/users/apilloud/gists{/gist_id}","starred_url":"https://api.github.com/users/apilloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apilloud/subscriptions","organizations_url":"https://api.github.com/users/apilloud/orgs","repos_url":"https://api.github.com/users/apilloud/repos","events_url":"https://api.github.com/users/apilloud/events{/privacy}","received_events_url":"https://api.github.com/users/apilloud/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/apilloud/beam","description":"Apache Beam","fork":true,"url":"https://api.github.com/repos/apilloud/beam","forks_url":"https://api.github.com/repos/apilloud/beam/forks","keys_url":"https://api.github.com/repos/apilloud/beam/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apilloud/beam/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apilloud/beam/teams","hooks_url":"https://api.github.com/repos/apilloud/beam/hooks","issue_events_url":"https://api.github.com/repos/apilloud/beam/issues/events{/number}","events_url":"https://api.github.com/repos/apilloud/beam/events","assignees_url":"https://api.github.com/repos/apilloud/beam/assignees{/user}","branches_url":"https://api.github.com/repos/apilloud/beam/branches{/branch}","tags_url":"https://api.github.com/repos/apilloud/beam/tags","blobs_url":"https://api.github.com/repos/apilloud/beam/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apilloud/beam/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apilloud/beam/git/refs{/sha}","trees_url":"https://api.github.com/repos/apilloud/beam/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apilloud/beam/statuses/{sha}","languages_url":"https://api.github.com/repos/apilloud/beam/languages","stargazers_url":"https://api.github.com/repos/apilloud/beam/stargazers","contributors_url":"https://api.github.com/repos/apilloud/beam/contributors","subscribers_url":"https://api.github.com/repos/apilloud/beam/subscribers","subscription_url":"https://api.github.com/repos/apilloud/beam/subscription","commits_url":"https://api.github.com/repos/apilloud/beam/commits{/sha}","git_commits_url":"https://api.github.com/repos/apilloud/beam/git/commits{/sha}","comments_url":"https://api.github.com/repos/apilloud/beam/comments{/number}","issue_comment_url":"https://api.github.com/repos/apilloud/beam/issues/comments{/number}","contents_url":"https://api.github.com/repos/apilloud/beam/contents/{+path}","compare_url":"https://api.github.com/repos/apilloud/beam/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apilloud/beam/merges","archive_url":"https://api.github.com/repos/apilloud/beam/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apilloud/beam/downloads","issues_url":"https://api.github.com/repos/apilloud/beam/issues{/number}","pulls_url":"https://api.github.com/repos/apilloud/beam/pulls{/number}","milestones_url":"https://api.github.com/repos/apilloud/beam/milestones{/number}","notifications_url":"https://api.github.com/repos/apilloud/beam/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apilloud/beam/labels{/name}","releases_url":"https://api.github.com/repos/apilloud/beam/releases{/id}","deployments_url":"https://api.github.com/repos/apilloud/beam/deployments","created_at":"2018-01-31T21:54:20Z","updated_at":"2018-01-31T21:54:33Z","pushed_at":"2018-03-13T23:17:00Z","git_url":"git://github.com/apilloud/beam.git","ssh_url":"git@github.com:apilloud/beam.git","clone_url":"https://github.com/apilloud/beam.git","svn_url":"https://github.com/apilloud/beam","homepage":"","size":54795,"stargazers_count":0,"watchers_count":0,"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,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"c41521ab68ebfa6457ce5a4fbe89383e888e4e59","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":50904245,"name":"beam","full_name":"apache/beam","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/beam","description":"Apache Beam","fork":false,"url":"https://api.github.com/repos/apache/beam","forks_url":"https://api.github.com/repos/apache/beam/forks","keys_url":"https://api.github.com/repos/apache/beam/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/beam/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/beam/teams","hooks_url":"https://api.github.com/repos/apache/beam/hooks","issue_events_url":"https://api.github.com/repos/apache/beam/issues/events{/number}","events_url":"https://api.github.com/repos/apache/beam/events","assignees_url":"https://api.github.com/repos/apache/beam/assignees{/user}","branches_url":"https://api.github.com/repos/apache/beam/branches{/branch}","tags_url":"https://api.github.com/repos/apache/beam/tags","blobs_url":"https://api.github.com/repos/apache/beam/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/beam/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/beam/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/beam/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/beam/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/beam/languages","stargazers_url":"https://api.github.com/repos/apache/beam/stargazers","contributors_url":"https://api.github.com/repos/apache/beam/contributors","subscribers_url":"https://api.github.com/repos/apache/beam/subscribers","subscription_url":"https://api.github.com/repos/apache/beam/subscription","commits_url":"https://api.github.com/repos/apache/beam/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/beam/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/beam/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/beam/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/beam/contents/{+path}","compare_url":"https://api.github.com/repos/apache/beam/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/beam/merges","archive_url":"https://api.github.com/repos/apache/beam/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/beam/downloads","issues_url":"https://api.github.com/repos/apache/beam/issues{/number}","pulls_url":"https://api.github.com/repos/apache/beam/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/beam/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/beam/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/beam/labels{/name}","releases_url":"https://api.github.com/repos/apache/beam/releases{/id}","deployments_url":"https://api.github.com/repos/apache/beam/deployments","created_at":"2016-02-02T08:00:06Z","updated_at":"2018-03-13T20:26:57Z","pushed_at":"2018-03-13T23:36:10Z","git_url":"git://github.com/apache/beam.git","ssh_url":"git@github.com:apache/beam.git","clone_url":"https://github.com/apache/beam.git","svn_url":"https://github.com/apache/beam","homepage":"","size":55010,"stargazers_count":1742,"watchers_count":1742,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1052,"mirror_url":null,"archived":false,"open_issues_count":107,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":1052,"open_issues":107,"watchers":1742,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/beam/pulls/4865"},"html":{"href":"https://github.com/apache/beam/pull/4865"},"issue":{"href":"https://api.github.com/repos/apache/beam/issues/4865"},"comments":{"href":"https://api.github.com/repos/apache/beam/issues/4865/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/beam/pulls/4865/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/beam/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/beam/pulls/4865/commits"},"statuses":{"href":"https://api.github.com/repos/apache/beam/statuses/29a5160b08b8da1c166faf18933c3fc61325eae9"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"akedin"}}