asterixdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Taewoo Kim <wangs...@gmail.com>
Subject Re: Undefined behavior for substring-before() and substring-after() in match-not-found case
Date Tue, 29 Sep 2015 01:10:33 GMT
Perhaps we can start from here:
https://docs.google.com/spreadsheets/d/1j6_YSCc_8gEReAWFP84geI30wlnsz7uMFq4TCm7GRz8/edit?usp=sharing


Best,
Taewoo

On Mon, Sep 28, 2015 at 6:05 PM, Mike Carey <dtabass@gmail.com> wrote:

> At times like this it's useful to take a quick look at what other systems
> do, if they have such functions - e.g., are there precedents we should base
> our answer on?  (In Java, Postgres, MySQL, ...)
>
>
> On 9/28/15 6:03 PM, Jianfeng Jia wrote:
>
>> Hi Devs,
>>
>> Another question about the string functions.
>>
>> The example code on the
>> http://asterixdb.ics.uci.edu/documentation/aql/functions.html#StringFunctions
>> <
>> http://asterixdb.ics.uci.edu/documentation/aql/functions.html#StringFunctions>
>> shows that these two function are suppose to be called after contains(). I
>> wonder what is the expected behavior if the they can't find the match
>> pattern?
>>
>> The current result is confusing.
>>
>> e.g.
>> let $x := "substring"
>> return [ substring-before($x, "subx"), substring-after($x, “subx”)]
>>
>> it will return
>> [ [ "subst", "" ]
>>   ]
>> Should we always return an empty string in such case, or throw an
>> exception like “you shall filter the result by contain() first” ?
>> IMHO, I’d like to return a null string. Any opinion?
>>
>>
>> Best,
>>
>> Jianfeng Jia
>> PhD Candidate of Computer Science
>> University of California, Irvine
>>
>>
>>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message