Akil Sevim created ASTERIXDB-2987:
-------------------------------------

             Summary: Projection issue when spatial or interval merge join are 
used
                 Key: ASTERIXDB-2987
                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-2987
             Project: Apache AsterixDB
          Issue Type: Bug
          Components: RT - Runtime
            Reporter: Akil Sevim
         Attachments: interval_join_example.txt, spatial_join_example.txt

If the projected fields do not yield the same schema for both sides of the 
join, the results return empty.

For instance, the query below does not trigger spatial join so that we can 
project the field "name."
{code:sql}
SELECT r1.name 
FROM RectangleDataset r1, RectangleDataset r2 
WHERE spatial_intersect(r1.g, r2.g) = true;{code}
However, If the spatial join is triggered to process the below query, we have 
an empty result.
{code:sql}
SELECT r1.name 
FROM RectangleDataset r1, RectangleDataset r2 
WHERE spatial_intersect(r1.g, r2.g);{code}
We have the same problem for the interval merge join too. The query below does 
not trigger the optimization so that we can project the field.
{code:sql}
SELECT i1.name 
FROM IntervalDataset i1, IntervalDataset i2 
WHERE interval_overlapping(i1.i, i2.i);{code}
However, If the interval merge is triggered, we have an empty result.
{code:sql}
SELECT i1.name 
FROM IntervalDataset i1, IntervalDataset i2 
WHERE /*+ range [date("2020-11-06"), date("2021-11-22")] */ 
interval_overlapping(i1.i, i2.i);{code}
 



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to