Comparator functions doesn't work correctly for the string type with the facets

Moved from GitHub dgraph/5843

Posted by ahsanbarkati:

What version of Dgraph are you using?

v20.07.0-beta.Jun22-7-g73a9dd

Have you tried reproducing the issue with the latest release?

No

What is the hardware spec (RAM, OS)?

Not Relevant

Steps to reproduce the issue (command/config used to run Dgraph).

Make the following mutation:

{
  set{
      <0x1a>  <testRel>  <0x1c>  (rational="abc",rational2=30,rational3=50) .
  }
}

The following query produces empty result:

{ 
    path as shortest( from:0x1a, to:0x1c, depth:6, numpaths:50 ){
          testRel @facets(eq(rational,"abc"))   @facets(rational)
    }    
    all (func:uid(path)){
         uid
         testRel @facets{
          uid
        }
    }
}

Expected behaviour and actual result.

The query should have returned the path as it does for the following query in which we apply eq() on non-string type facets:

{ 
    path as shortest( from:0x1a, to:0x1c, depth:6, numpaths:50 ){
          testRel @facets(eq(rational2, 30))   @facets(rational2)
    }    
    all (func:uid(path)){
         uid
         testRel @facets{
          uid
        }
    }
}