Skip to content

Issue #29: Query Rewriter Interface and Tests - #75

Merged
kishore-narendran merged 26 commits into
masterfrom
yoda-query-rewriter
Apr 29, 2016
Merged

kishore-narendran merged 26 commits into
masterfrom
yoda-query-rewriter

Conversation

@kishore-narendran

@kishore-narendran kishore-narendran commented Apr 25, 2016 •

Copy link
Copy Markdown
Contributor

Started off with the creation of an interface for the QueryRewriter.

  • Added a class for the QueryRewriter that implements IOperator
  • Added a class FuzzyTokenizer that is the core class, that will perform the tokenizations
  • Added a new field in the TestConstants for testing purposes
  • Added a test class for QueryRewriter

I am a little puzzled, about how the QueryRewriter will return a list of rewritten queries as strings, when the expected is an ITuple. How do I proceed @chenlica @JavierJia ?

@shiladityasen

@kishore-narendran

Copy link
Copy Markdown
Contributor Author

Also, the checks are failing because of the SpanTupleTest.

@chenlica

Copy link
Copy Markdown
Contributor

As the first step, you can include the rewritten queries as a list of strings.

If the test cases passed on the master, then it's your responsibility to look into the failed test cases in your branch.

Let's talk in person after the lecture today.

@kishore-narendran

Copy link
Copy Markdown
Contributor Author

I fixed the failure professor. So, in that scenario is it okay if the QueryRewriter class doesn't extend IOperator for now?

@chenlica

Copy link
Copy Markdown
Contributor

Per our discussion, we want all major features to be incorporated as an operator (by implementing the IOperator interface) in order to be a "good citizen" in the system to be used by other operators in a plan.

@kishore-narendran

Copy link
Copy Markdown
Contributor Author

I have made changes such that our QueryRewriter implements the IOperator interface as per our discussion.

@chenlica

Copy link
Copy Markdown
Contributor

Please first fix the "All checks have failed" problem.

@kishore-narendran

Copy link
Copy Markdown
Contributor Author

@chenlica @JavierJia The interface and the tests are now complete.

@chenlica

Copy link
Copy Markdown
Contributor

@sandeepreddy602 @rajesh9625 and @inkudo If you have time, can you review this PR?

*/
public class WordDictionary {

private static HashSet<String> wordDict;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why it is static?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Prof prefers Dictionary to Dict, could you change it to wordDictionary.

TEXT,

//A field that is the list of strings
STRING_LIST;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We need to use the generic list field here. Once our pull request #77 is merged into master, you can make these changes

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Do you mean a list with a template and it can be any data type? @sandeepreddy602

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@sandeepreddy602

Copy link
Copy Markdown
Contributor

@kishore-narendran .. Merged the pull request #77 to master. Please update this branch and make the changes accordingly.

@kishore-narendran

Copy link
Copy Markdown
Contributor Author

@sandeepreddy602, I have merged master into this branch. Pending your final review, this can be merged into master too. @chenlica @JavierJia

@sandeepreddy602

Copy link
Copy Markdown
Contributor

@kishore-narendran Looks good to me.

@chenlica

Copy link
Copy Markdown
Contributor

@kishore-narendran I will review it later today. After my approval, you can do the merge.

* try the query rewriting.
*
* This includes query strings like - "newyorkcity", "horseshoe" and other
* strings which stem from misppelt, missing spaces in search queries

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fix "misppelt".

@ss3n

ss3n commented Apr 29, 2016

Copy link
Copy Markdown
Contributor

@chenlica @JavierJia @sandeepreddy602 : We made the changes suggested after the last commit. Can you give our code another review to merge?

*/
@Override
public void close() throws Exception {
//Uncomment below line when FuzzyTokenizer has been created

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove all "FuzzyTokenizer"-related code from this PR completely since it doesn't belong here. Add it in your next PR.

@chenlica

Copy link
Copy Markdown
Contributor

@shiladityasen and @kishore-narendran I added more comments. Still the PR is NOT ready to merge.

General comments:

  • Remove all code NOT related to this PR (e.g., "FuzzyTokenizer"), even from the comments!
  • Be more careful about your comments;
  • This is your first major PR, and please be prepared for this type of rigorous reviews.


import java.util.List;

public class ListField<T> implements IField {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you remind me the reason to have this class of list of fields?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This will be used, to return an ITuple that has a list of strings, that is the list of rewritten query strings that our operator sends.

@chenlica

Copy link
Copy Markdown
Contributor

@kishore-narendran : I left a minor comment. After addressing it, you can go ahead to do the merge. Congratulations! :-)

* Created by kishorenarendran on 25/04/16.
* QueryRewriter is an operator that converts a query search string which
* has faults in space placement to a list of meaningful search queries
* QueryRewriter internally uses the FuzzyTokenizer class to fulfill

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove the sentence "QueryRewriter internally uses the FuzzyTokenizer class to fulfill its functionality" since it's related to the coming PR of implementation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in 9bd7d7a professor!

@kishore-narendran

Copy link
Copy Markdown
Contributor Author

@chenlica I have addressed the minor comment professor. Thank you! 😄
I am now merging.

@kishore-narendran
kishore-narendran merged commit cea37df into master Apr 29, 2016
@kishore-narendran
kishore-narendran deleted the yoda-query-rewriter branch April 29, 2016 06:56
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.

6 participants