[GitHub] incubator-metron pull request #257: METRON-426: Stellar does not support sci...
Github user asfgit closed the pull request at: https://github.com/apache/incubator-metron/pull/257 --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] incubator-metron pull request #257: METRON-426: Stellar does not support sci...
Github user cestella commented on a diff in the pull request: https://github.com/apache/incubator-metron/pull/257#discussion_r79702619 --- Diff: metron-platform/metron-common/src/test/java/org/apache/metron/common/stellar/StellarTest.java --- @@ -173,6 +173,22 @@ public void testMapConstant() { } @Test + public void testArithmetic() { +{ + String query = "1 + 2"; + Assert.assertEquals(3, ((Number)run(query, ImmutableMap.of("casey", "casey"))).doubleValue(), 1e-3); +} +{ + String query = "1.2 + 2"; + Assert.assertEquals(3.2, ((Number)run(query, ImmutableMap.of("casey", "casey"))).doubleValue(), 1e-3); +} +{ + String query = "1.2e-3 + 2"; + Assert.assertEquals(1.2e-3 + 2, ((Number)run(query, ImmutableMap.of("casey", "casey"))).doubleValue(), 1e-3); +} --- End diff -- You got it. :) --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] incubator-metron pull request #257: METRON-426: Stellar does not support sci...
Github user nickwallen commented on a diff in the pull request: https://github.com/apache/incubator-metron/pull/257#discussion_r79698302 --- Diff: metron-platform/metron-common/src/test/java/org/apache/metron/common/stellar/StellarTest.java --- @@ -173,6 +173,22 @@ public void testMapConstant() { } @Test + public void testArithmetic() { +{ + String query = "1 + 2"; + Assert.assertEquals(3, ((Number)run(query, ImmutableMap.of("casey", "casey"))).doubleValue(), 1e-3); +} +{ + String query = "1.2 + 2"; + Assert.assertEquals(3.2, ((Number)run(query, ImmutableMap.of("casey", "casey"))).doubleValue(), 1e-3); +} +{ + String query = "1.2e-3 + 2"; + Assert.assertEquals(1.2e-3 + 2, ((Number)run(query, ImmutableMap.of("casey", "casey"))).doubleValue(), 1e-3); +} --- End diff -- The `ImmutableMap.of("casey","casey")`(besides promoting your global brand ;) ) do nothing for these tests, right? It'd be more clear, if we removed those. Everything else looks good. I'm a +1 if we can take care of this small issue. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] incubator-metron pull request #257: METRON-426: Stellar does not support sci...
Github user justinleet commented on a diff in the pull request: https://github.com/apache/incubator-metron/pull/257#discussion_r79204587 --- Diff: metron-platform/metron-common/src/main/java/org/apache/metron/common/math/stats/OnlineStatisticsProvider.java --- @@ -43,7 +43,7 @@ * 100 is a sensible default and the number of centroids retained (to construct the sketch) * is usually a smallish (usually < 10) multiple of the compression. */ - public static final int COMPRESSION = 100; + public static final int COMPRESSION = 150; --- End diff -- Could you update the comment to reflect the compression default change? --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] incubator-metron pull request #257: METRON-426: Stellar does not support sci...
GitHub user cestella opened a pull request: https://github.com/apache/incubator-metron/pull/257 METRON-426: Stellar does not support scientific notation as a literal Stellar does not support scientific notation for expressing literal doubles. It should. This is exercised in the unit tests for `StellarStatisticsTest` and `StellarTest` directly You can merge this pull request into a Git repository by running: $ git pull https://github.com/cestella/incubator-metron statistics_test_nondeterminism Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-metron/pull/257.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #257 commit 03420b8e309deb7262d122e3ed4a7972d1fe58b6 Author: cstellaDate: 2016-09-16T13:56:18Z METRON-426: Stellar does not support scientific notation as a literal --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---