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

HPCC-15749 Add new EPlikelihood property #8804

Merged
merged 1 commit into from
Jun 22, 2016

Conversation

shamser
Copy link
Contributor

@shamser shamser commented Jun 17, 2016

Signed-off-by: Shamser Ahmed shamser.ahmed@lexisnexis.co.uk

@hpcc-jirabot
Copy link

@@ -789,7 +789,8 @@ enum ExprPropKind
EPunadorned,
EPlocationIndependent,
EPmeta,
EPmax
EPmax,
Copy link
Member

Choose a reason for hiding this comment

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

EPmax needs to be the last one - we often use an enumeration like this at the end of a list to indicate the number of elements.

@shamser
Copy link
Contributor Author

shamser commented Jun 21, 2016

@ghalliday Please can you review.

return value->getRealValue();
}

double likelihoodValue = -1.0;
Copy link
Member

Choose a reason for hiding this comment

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

Efficiency. I would move the declaration of likelihoodExpr above the case statement, and only set it from the value if it is non null

@ghalliday
Copy link
Member

@shamser that is looking much closer. A lot of the comments are related to avoiding creating IHqlExpressions to represent doubles - since that is a fairly expensive operation.

if (match)
{
IHqlExpression * likelihoodExpr = static_cast<IHqlExpression *>(match);
IValue * value = likelihoodExpr->queryChild(0)->queryValue();
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure the queryChild(0) is correct. Try calling the function multiple times and check the same results is returned

@shamser shamser force-pushed the issue15747c branch 2 times, most recently from 21b9c41 to dfdc48a Compare June 22, 2016 09:43
@shamser
Copy link
Contributor Author

shamser commented Jun 22, 2016

@ghalliday Please can you check it over again.

@@ -12159,6 +12174,27 @@ extern IHqlExpression *createConstant(IValue * constant)
return CHqlConstant::makeConstant(constant);
}

extern IHqlExpression *createConstantLikelihoodUnknown()
Copy link
Member

Choose a reason for hiding this comment

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

These should either be query... or return the expression linked.

@shamser
Copy link
Contributor Author

shamser commented Jun 22, 2016

@ghalliday Please can you review

likelihoodExpr.set(queryConstantLikelihoodFalse());
break;
default:
likelihoodExpr.set(queryConstantLikelihoodUnknown());
Copy link
Member

Choose a reason for hiding this comment

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

minor: Should have a break; for consistency.


double queryLikelihood(IHqlExpression * expr)
{
LinkedHqlExpr likelihoodExpr = queryLikelihoodExpr(expr);
Copy link
Member

Choose a reason for hiding this comment

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

minor: more efficient to assign to an IHqlExpression *

Signed-off-by: Shamser Ahmed <shamser.ahmed@lexisnexis.co.uk>
@HPCCSmoketest
Copy link
Contributor

Automated Smoketest
Sha: 30820de
Build: success
Install hpccsystems-platform-community_6.1.0-trunk0.el6.x86_64.rpm
HPCC Start: OK
HPCC Stop: OK
HPCC Uninstall: OK

@ghalliday
Copy link
Member

I might revisit the format of the graph attribute, but fine as it stands.

@ghalliday ghalliday merged commit ef23edd into hpcc-systems:master Jun 22, 2016
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.

4 participants