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

Simplify grounding by removing joins with var ID tables #110

Merged
merged 2 commits into from Dec 29, 2016

Conversation

alldefector
Copy link
Contributor

dd_predicate_V extends variable table V with two additional columns (copied from the var ID table): dd_id (var ID) and dd_part (partition ID).

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.3%) to 93.85% when pulling 717b100 on faster_join into 2c37703 on master.

Copy link
Contributor

@netj netj left a comment

Choose a reason for hiding this comment

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

Looks great other than the minor inline comments. Changes to the test examples made things a lot clearer how it'd reduce the # joins

val fakeCQ = stmt.q.copy(bodies = List(fakeBody))

// TODO XXX: Fix the `internal` hack below
val qc = new QueryCompiler(fakeCQ, internalVarTables, internalVarJoinConds)
val qc = new QueryCompiler(fakeCQ)
Copy link
Contributor

Choose a reason for hiding this comment

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

can you remove the TODO XXX comment since they're gone now?

@@ -116,8 +116,9 @@ class DeepDiveLogCompiler( program : DeepDiveLog.Program, config : DeepDiveLog.C
// odd has happened.
def resolveName( v : Variable ) : String = {
v match { case Variable(v,relName,i) =>
if(attrNameForRelationAndPosition contains (relName,i)) {
attrNameForRelationAndPosition(relName,i)
val realRel = relName.replaceAll("^" + deepdivePrefixForVariablesWithIdsTable, "")
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not comfortable with stitching regex like this.. Looks like stripPrefix will do a cleaner job?

@@ -685,7 +673,7 @@ object DeepDiveLogCompiler extends DeepDiveLogHandler {
val deepdiveVariableIdColumn = "dd_id"
val deepdiveVariableLabelColumn = "dd_label"
val deepdiveVariableLabelTruthinessColumn = "dd_truthiness"
val deepdivePrefixForVariablesIdsTable = "dd_variables_"
val deepdivePrefixForVariablesWithIdsTable = "dd_predicate_"
Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, could you elaborate a bit on the naming of this table? "predicate" isn't very intuitive IMO. I think it's still a materialized variable, so maybe something straightforward as dd_variable_copy_ or dd_variable_with_id_?

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 93.973% when pulling ea41bc5 on faster_join into 2c37703 on master.

@alldefector alldefector merged commit f1a5fa7 into master Dec 29, 2016
@netj netj deleted the faster_join branch January 23, 2017 23:43
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

4 participants