Xikui Wang created ASTERIXDB-2739:
-------------------------------------

             Summary: Hint is not working properly in functions
                 Key: ASTERIXDB-2739
                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-2739
             Project: Apache AsterixDB
          Issue Type: Bug
            Reporter: Xikui Wang
            Assignee: Dmitry Lychagin


The indexnl hint causes a parsing error.
{code:sql}
DROP DATAVERSE test IF EXISTS;
CREATE DATAVERSE test;
USE test;

CREATE TYPE Tweet AS OPEN {
 tid: bigint,
 area_code: string,
 text: string,
 location: point,
 timestamp: datetime
};

CREATE TYPE OfficerLocation AS {
  oid: int,
  location: point,
  vehicle: string
};

CREATE DATASET Tweets(Tweet) PRIMARY KEY tid;
CREATE DATASET OfficerLocations(OfficerLocation) PRIMARY KEY oid;

CREATE INDEX s_location ON Tweets(location) type RTREE;
CREATE INDEX o_location ON OfficerLocations(location) type RTREE;

CREATE FUNCTION NearbyTweets(oid)
{
 SELECT t FROM Tweets t, OfficerLocations o
 WHERE /*+ indexnl */ spatial_intersect(create_circle(t.location, 100.0), 
o.location) AND o.oid = oid
  AND t.hateful_flag = true
};

NearbyTweets("01");
{code}




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to