Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
0.9.4
-
None
-
None
-
None
Description
Given query cannot be executed as in a function body, but can be executed as a plain query. There is some issue with the variable counter in the language rewriting process which causes different variables has the same varId. This further causes mappings are overwritten in the variable substitution phase.
use Starbucks; create function StarbucksFriends(user_id){ ( select * from Starbucks sb, (select * from Tweets tw let dumb = (select * from Tweets f where f.user.id_str in (select value fw.followers from Followers fw where fw.twitter_id= user_id )) where tw.user.id_str = user_id) t order by spatial_distance(sb.location,create_point(0,0)) limit 1 ) }; use Starbucks; StarbucksFriends("123"); use Starbucks; select * from Starbucks sb, (select * from Tweets tw let dumb = (select * from Tweets f where f.user.id_str in (select value fw.followers from Followers fw where fw.twitter_id= "123" )) where tw.user.id_str = "123") t order by spatial_distance(sb.location,create_point(0,0)) limit 1;