Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expressions #74

Merged
merged 53 commits into from
Jun 5, 2020
Merged

Expressions #74

merged 53 commits into from
Jun 5, 2020

Conversation

0aix
Copy link
Member

@0aix 0aix commented Feb 22, 2019

No description provided.

@0aix 0aix requested a review from akshaisarma April 30, 2020 18:54
@0aix 0aix requested a review from akshaisarma May 20, 2020 05:07
@0aix
Copy link
Member Author

0aix commented May 20, 2020

ready for re-review. i've undoubtedly missed something

return null;
}

private static double[] generatePoints(double start, double end, double increment, int maxPoints, int rounding) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Share this with the code in QuantileSketch? Perhaps in utilities and make the signature have a function instead of the increment so we can generalize to logarithmic, exponential and whatever else point generation?

TypedObject leftValue = left.evaluate(record);
TypedObject rightValue = right.evaluate(record);
Type subType = leftValue.getType();
return new TypedObject(Type.BOOLEAN, ((List<? extends Serializable>) rightValue.getValue()).stream().anyMatch(o -> leftValue.compareTo(new TypedObject(subType, o)) > 0));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't remember but do these work properly for vacuous truth checks? X > ANY([]) or X > ALL([])? I remember having to do stuff to handle this properly.

@@ -90,6 +90,6 @@ public void testNumericExtraction() {
Assert.assertNull(Utilities.extractFieldAsNumber("id", record));
Assert.assertEquals(Utilities.extractFieldAsNumber("foo", record), ((Number) 1.20).doubleValue());
Assert.assertEquals(Utilities.extractFieldAsNumber("bar", record), ((Number) 42).longValue());
Assert.assertEquals(Utilities.extractFieldAsNumber("map_field.foo", record), ((Number) 21).doubleValue());
Assert.assertNull(Utilities.extractFieldAsNumber("map_field.foo", record));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just remove the addMap instead since this is functionality we no longer support?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I kept this test here to show that that functionality doesn't exist anymore.

src/test/java/com/yahoo/bullet/result/MetaTest.java Outdated Show resolved Hide resolved
src/test/java/com/yahoo/bullet/query/ProjectionUtils.java Outdated Show resolved Hide resolved
Assert.assertEquals(GroupData.getResultName(operation), GroupOperation.GroupOperationType.COUNT.getName() +
GroupData.NAME_SEPARATOR + "foo");
operation = new GroupOperation(GroupOperation.GroupOperationType.COUNT, null, "bar");
Assert.assertEquals(GroupData.getResultName(operation), "bar");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a test for the new fieldAliases added to GroupData?

return new TypedObject(record.extractField(identifier));
public static double[] generatePoints(double start, Function<Double, Double> generator, int numberOfPoints, int rounding) {
double[] points = new double[numberOfPoints];
double begin = start;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Call it value?

@Slf4j
public class GroupAll implements Strategy {
public class GroupStrategy implements Strategy {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GroupAllStrategy?

akshaisarma
akshaisarma previously approved these changes Jun 3, 2020
@coveralls
Copy link

coveralls commented Jun 4, 2020

Coverage Status

Coverage increased (+0.3%) to 99.937% when pulling 3ba073c on expressions into 3599b2e on master.

@0aix 0aix merged commit 375da8a into master Jun 5, 2020
@0aix 0aix deleted the expressions branch June 5, 2020 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants