nathanmarz/cascalog — Issue #16: Empty Cascading taps don't work in ?-, union, combine
Author: sritchie
Created: 2011-12-06 02:50:53+00:00
State: open

This is because it currently infers the schema by plucking a tuple from the tap, so if there's no tuples it throws an exception.

The solution is to support a "nil" generator, which means that it's a generator that represents no tuples. Need to support the following cases:

1. Used in union/combine: just filter it out. If everything is filtered, return nil generator
2. Used in ?- : create an empty output (use .openWrite and .close on the tap)
3. Used in another subquery: At this point, you have the vars declaration, so you can make a proper generator that sources 0 tuples.