When a source table is empty, the following operations will throw an error:
Join (except nested loop join)
Cross product
Sort
This is caused by the implementation in their respective scans (ie. SortScan, ProductScan, IndexJoinScan)
For MergeJoinScan, it uses SortScan as an intermediate step. Hence, it should be fixed when SortScan is resolved.
Sample queries:
1: Sort scan
select sname from student where sname='mary' order by sname
2: Product scan
select sname from student, enroll where sname='mary'
3: Joins (ie. merge join)
select eid, sectid from enroll, section where sectionid=sectid and prof='abc'
Index-join (may need to comment out other joins due to bug in #14 )
select sname from student, enroll where studentid=sid and sname='mary'
Sample error:
SQL> select eid, sectid from enroll, section where sectionid=sectid and prof='abc'
Running sort merge
eid sectid
-----------
SQL Exception: java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
When a source table is empty, the following operations will throw an error:
This is caused by the implementation in their respective scans (ie.
SortScan
,ProductScan
,IndexJoinScan
)For
MergeJoinScan
, it usesSortScan
as an intermediate step. Hence, it should be fixed whenSortScan
is resolved.Sample queries: 1: Sort scan
2: Product scan
3: Joins (ie. merge join)
Sample error: