Outer joins add the placeholder '---' that is used as some sort of NULL
value.
However select operations on such relations would always fail, because
relations are supposed to only contain values of class rstring, and
the placeholder was added as a regular string.
As a consequence, automatic casting would always fail, and the select
would always raise an exception.
Added a new test case with this specific case in mind.
This is more Pythonic and makes the code more readable.
Backwards compatibility is provided by giving an alias with the
previous name of the class.
It will not be broken until the next major release.
Operations are possible even when the order of the attributes is
not the same. Because ordering is just an implementation detail and
not an actual part of relational algebra.
A _rearrange() function exists to convert relations to have a similar
format and be able to operate on them.
The function would perform a projection in any case, which would cause
the creation of a new temporary relation, even when the relations where
already using the same order of attributes.
This commit fixes the issue by making it return an identity if the
operation is not necessary.
When doing a selection, a new context (in the form of a dictionary)
is created.
Instead of re-using the same dictionary re-assigning the values, now
use a comprehension to avoid redundant reads.
In this way, checks are performed automatically on every tuple
and code is simplified.
This should make it safer to raise exceptions on files that are
not relations.
Rather than having a header class that contains a list of header,
change it to directly be an immutable tuple.
This simplifies the code because header can now be compared and
indexed like any other tuple.
Code had to be changed all over the place to cope with this new
datatype.
rstring now has an autocast() function that returns the automatic casting
for that value.
The casting is cached so is really performed only once, at most, during
the lifetime of the object.
Since rstrings are faster and provide some caching features,
keep the same rstring objects from the beginning rather than
continuously casting strings.
- Date type recognition is more robust, now using a combination of regexp plus date object
- Parsing of strings representing dates is now cached, eliminating the need for double parse
git-svn-id: http://galileo.dmi.unict.it/svn/relational/trunk@270 014f5005-505e-4b48-8d0a-63407b615a7c