{"action":"created","issue":{"url":"https://api.github.com/repos/druid-io/druid/issues/3270","repository_url":"https://api.github.com/repos/druid-io/druid","labels_url":"https://api.github.com/repos/druid-io/druid/issues/3270/labels{/name}","comments_url":"https://api.github.com/repos/druid-io/druid/issues/3270/comments","events_url":"https://api.github.com/repos/druid-io/druid/issues/3270/events","html_url":"https://github.com/druid-io/druid/pull/3270","id":166707508,"number":3270,"title":"Add numeric StringComparator","user":{"login":"jon-wei","id":8729063,"avatar_url":"https://avatars.githubusercontent.com/u/8729063?v=3","gravatar_id":"","url":"https://api.github.com/users/jon-wei","html_url":"https://github.com/jon-wei","followers_url":"https://api.github.com/users/jon-wei/followers","following_url":"https://api.github.com/users/jon-wei/following{/other_user}","gists_url":"https://api.github.com/users/jon-wei/gists{/gist_id}","starred_url":"https://api.github.com/users/jon-wei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jon-wei/subscriptions","organizations_url":"https://api.github.com/users/jon-wei/orgs","repos_url":"https://api.github.com/users/jon-wei/repos","events_url":"https://api.github.com/users/jon-wei/events{/privacy}","received_events_url":"https://api.github.com/users/jon-wei/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/druid-io/druid/labels/Feature","name":"Feature","color":"2ceefb"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/druid-io/druid/milestones/20","html_url":"https://github.com/druid-io/druid/milestones/0.9.2","labels_url":"https://api.github.com/repos/druid-io/druid/milestones/20/labels","id":1571409,"number":20,"title":"0.9.2","description":"","creator":{"login":"fjy","id":428325,"avatar_url":"https://avatars.githubusercontent.com/u/428325?v=3","gravatar_id":"","url":"https://api.github.com/users/fjy","html_url":"https://github.com/fjy","followers_url":"https://api.github.com/users/fjy/followers","following_url":"https://api.github.com/users/fjy/following{/other_user}","gists_url":"https://api.github.com/users/fjy/gists{/gist_id}","starred_url":"https://api.github.com/users/fjy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fjy/subscriptions","organizations_url":"https://api.github.com/users/fjy/orgs","repos_url":"https://api.github.com/users/fjy/repos","events_url":"https://api.github.com/users/fjy/events{/privacy}","received_events_url":"https://api.github.com/users/fjy/received_events","type":"User","site_admin":false},"open_issues":29,"closed_issues":76,"state":"open","created_at":"2016-02-08T22:01:21Z","updated_at":"2016-07-22T16:07:38Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2016-07-20T23:44:21Z","updated_at":"2016-07-22T22:47:19Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/druid-io/druid/pulls/3270","html_url":"https://github.com/druid-io/druid/pull/3270","diff_url":"https://github.com/druid-io/druid/pull/3270.diff","patch_url":"https://github.com/druid-io/druid/pull/3270.patch"},"body":"This PR adds a pure numeric StringComparator (supports decimals, negative numbers), used by the BoundFilter and GroupBy/TopN/Search queries.\r\n\r\nThe comparator will attempt to parse and compare Strings as BigDecimals.\r\n\r\nUnparseable strings are treated as nulls, and nulls precede numbers. When comparing two strings that cannot be parsed as numbers, the comparator will order them lexicographically.\r\n\r\nThe BoundDimFilter interface has also been changed, deprecating \"alphanumeric\" in favor of an \"ordering\" String field.\r\n\r\nFixes https://github.com/druid-io/druid/issues/2989\r\n\r\n===========\r\n\r\nThe following benchmarks show the performance difference between using this numeric comparator and the existing alphanumeric comparator on a long column (__time).\r\n\r\nThe `basic` data set spans an interval from (0,1000000) milliseconds.\r\n\r\n`timeFilter` runs a timeseries query on the entire interval, using a filtered aggregator long sum with a BoundFilter for the __time interval (200000, 300000). The BoundFilter uses the newly introduced numeric comparator.\r\n\r\n`timeFilterAlphanumeric` is the same as the previous query, but using the existing alphanumeric comparator instead.\r\n\r\n`timeFilterByInterval` is a timeseries query on the interval (200000, 300000) with a long sum. This query is meant to provide a baseline comparison (interval based filtering vs. boundfilter on __time column). The interval based filtering is faster since the IncrementalIndex/QueryableIndex have optimizations that allow exclusion of rows using the interval (the boundfilter applied to the whole interval still has to read all of the rows)\r\n\r\n```\r\nTimeseriesBenchmark.queryMultiQueryableIndex                       1            750000              basic.timeFilter  avgt   50    19433.259 ±    66.505  us/op\r\nTimeseriesBenchmark.queryMultiQueryableIndex                       1            750000  basic.timeFilterAlphanumeric  avgt   50   108962.170 ±  1877.408  us/op\r\nTimeseriesBenchmark.queryMultiQueryableIndex                       1            750000    basic.timeFilterByInterval  avgt   50     7578.105 ±    20.135  us/op\r\n\r\nTimeseriesBenchmark.querySingleIncrementalIndex                    1            750000              basic.timeFilter  avgt   50    69655.796 ±  2193.242  us/op\r\nTimeseriesBenchmark.querySingleIncrementalIndex                    1            750000  basic.timeFilterAlphanumeric  avgt   50   144758.532 ±  3640.986  us/op\r\nTimeseriesBenchmark.querySingleIncrementalIndex                    1            750000    basic.timeFilterByInterval  avgt   50    14898.808 ±   467.090  us/op\r\n\r\nTimeseriesBenchmark.querySingleQueryableIndex                      1            750000              basic.timeFilter  avgt   50    19668.441 ±    60.053  us/op\r\nTimeseriesBenchmark.querySingleQueryableIndex                      1            750000  basic.timeFilterAlphanumeric  avgt   50   101008.642 ±  1595.471  us/op\r\nTimeseriesBenchmark.querySingleQueryableIndex                      1            750000    basic.timeFilterByInterval  avgt   50     7490.932 ±    15.981  us/op\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/druid-io/druid/issues/comments/234675210","html_url":"https://github.com/druid-io/druid/pull/3270#issuecomment-234675210","issue_url":"https://api.github.com/repos/druid-io/druid/issues/3270","id":234675210,"user":{"login":"jon-wei","id":8729063,"avatar_url":"https://avatars.githubusercontent.com/u/8729063?v=3","gravatar_id":"","url":"https://api.github.com/users/jon-wei","html_url":"https://github.com/jon-wei","followers_url":"https://api.github.com/users/jon-wei/followers","following_url":"https://api.github.com/users/jon-wei/following{/other_user}","gists_url":"https://api.github.com/users/jon-wei/gists{/gist_id}","starred_url":"https://api.github.com/users/jon-wei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jon-wei/subscriptions","organizations_url":"https://api.github.com/users/jon-wei/orgs","repos_url":"https://api.github.com/users/jon-wei/repos","events_url":"https://api.github.com/users/jon-wei/events{/privacy}","received_events_url":"https://api.github.com/users/jon-wei/received_events","type":"User","site_admin":false},"created_at":"2016-07-22T22:47:19Z","updated_at":"2016-07-22T22:47:19Z","body":"@gianm added benchmarks to main comment"}}
{"actor":{"display_login":"jon-wei"}}