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

Support additional filters #36

Closed
akshaisarma opened this issue Jul 17, 2018 · 4 comments
Closed

Support additional filters #36

akshaisarma opened this issue Jul 17, 2018 · 4 comments

Comments

@akshaisarma
Copy link
Member

sizeOf
contains - containsKey, containsValue?
compare to other fields

@akshaisarma
Copy link
Member Author

akshaisarma commented Aug 3, 2018

Comparing to other fields requires us to address casting (see #37):

  1. We should make the filter clause values, a List[String] to a List[Object] (we can support List[String] for backward compatible)
  2. When we see List[String], we make it into:
{
   "value": "the string value"
}

as below.
3. The Object in the List[Object] is now a new object:

{
   "kind": "VALUE | CAST | FIELD"
   "value": "a string value as before",
   "type": "BOOLEAN, STRING, LONG, INTEGER, DOUBLE, FLOAT"
}

If the kind is:
a. VALUE or is not present, we treat it as a string as before.
b. CAST, we use type to cast the value to the requisite type
c. FIELD, we treat value as a field and extract from the object to compare it the field. If types don't match, we convert the value to the type of the other field (the LHS)

@akshaisarma
Copy link
Member Author

For c, we're going to follow Java's widening conventions. If the LHS is narrower than the RHS, then the cast will fail but since it's a field also, the query can always be rewritten to swap the RHS with the LHS (making the RHS the narrower one now)

@akshaisarma
Copy link
Member Author

@hbxie Let's keep this open till casting is implemented too.

@akshaisarma akshaisarma modified the milestone: 0.4.3 Sep 6, 2018
@hbxie hbxie closed this as completed Sep 14, 2018
@akshaisarma
Copy link
Member Author

akshaisarma commented Sep 14, 2018

Instead of having a CAST kind, a new field called type was added instead, if when specified is used to cast

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants