[Monetdb-developers] what should happen when appending to a nil bat?

Sjoerd Mullender sjoerd at acm.org
Wed Dec 21 13:55:53 CET 2005


Jan Rittinger wrote:
> In the current example the head is oid. The same question however
> arises with void|void bats. Both cases should be treated equally.
> 
> I therefore also vote for the second alternative as the sequence
> construction in XQuery e.g. uses append/insert and expects the
> behaviour of the second version. Otherwise values will get lost
> as their reference (1 at 0) is replaced by nil values.
> 
> Jan
> 
> PS: Is their a difference between append and insert in this scenario?

Most cases of append are implemented internally using the equivalent of
insert.  Hence my earlier reply which crossed yours.

I got to this because a problem I'm facing in my XML Update code.  The
problem I have is described in bug #1385067: "bug appending to
[void,void] bat".

>> I also vote for the second alternative.
>>
>> If/where desired the first result can then achieved by
>>     a.append(b.mark(nil));
>>
>> Stefan
>>
>> On Wed, Dec 21, 2005 at 01:26:08PM +0100, Ying Zhang wrote:
>>  
>>
>>> To me, the second possibility seems better, since the tail value of 'b'
>>> is preserved.
>>>
>>> But how about a third possibility: reject such 'append' and require a
>>> explicit type casting?
>>>
>>>
>>> Regards,
>>>
>>> Jennie
>>>
>>> On Wed, Dec 21, 2005 at 01:08:26PM +0100, Sjoerd Mullender wrote:
>>>   
>>>
>>>> Consider this scenario:
>>>> mil>var a := new(oid,void).insert(0 at 0,nil);
>>>> mil>a.print();
>>>> #-----------------#
>>>> # h     t         # name
>>>> # oid   void      # type
>>>> #-----------------#
>>>> [ 0 at 0,    nil     ]
>>>> mil>var b := new(oid,oid).insert(0 at 0,1 at 0);
>>>> mil>b.print();
>>>> #-----------------#
>>>> # h     t         # name
>>>> # oid   oid       # type
>>>> #-----------------#
>>>> [ 0 at 0,    1 at 0     ]
>>>> mil>a.append(b);
>>>> mil>a.print();
>>>>
>>>> The question is, what should the result be?
>>>>
>>>> As I see it, there are two possibilities:
>>>> #-----------------#
>>>> # h     t         # name
>>>> # oid   void      # type
>>>> #-----------------#
>>>> [ 0 at 0,    nil     ]
>>>> [ 1 at 0,    nil     ]
>>>> or
>>>> #-----------------#
>>>> # h     t         # name
>>>> # oid   oid       # type
>>>> #-----------------#
>>>> [ 0 at 0,    nil     ]
>>>> [ 1 at 0,    1 at 0     ]
>>>>
>>>> The former keeps the nil tail (the tail of a was void without seqbase
>>>> and stays that way), whereas the latter materializes the tail so that
>>>> the tail value of b gets inserted.
>>>>
>>>> Opinions?
>>>>
>>>> -- 
>>>> Sjoerd Mullender
>>>>     
>>>
>>>
>>>
>>> -------------------------------------------------------
>>> This SF.net email is sponsored by: Splunk Inc. Do you grep through
>>> log files
>>> for problems?  Stop!  Download the new AJAX search engine that makes
>>> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
>>> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
>>> _______________________________________________
>>> Monetdb-developers mailing list
>>> Monetdb-developers at lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/monetdb-developers
>>>
>>>   
>>
>>
>>  
>>
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log
> files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> _______________________________________________
> Monetdb-developers mailing list
> Monetdb-developers at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/monetdb-developers


-- 
Sjoerd Mullender
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 369 bytes
Desc: OpenPGP digital signature
URL: <http://www.monetdb.org/pipermail/developers-list/attachments/20051221/efd388d6/attachment.sig>


More information about the developers-list mailing list