Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Plain View
Hive >> mail # user >> Re: documentation issue for RLIKE/REGEXP


+
Lefty Leverenz 2013-08-10, 00:02
Copy link to this message
-
Re: documentation issue for RLIKE/REGEXP
I just confirmed that for Hive v0.10 (and probably all versions)  "foobar"
rlike "foo" returns true, just to be clear. In other words, the Java
regular expression does NOT have to match the whole string.

The wiki should be changed. If someone wants to give me permission, I'll do
it ;)

dean

On Fri, Aug 9, 2013 at 7:02 PM, Lefty Leverenz <[EMAIL PROTECTED]>wrote:

> 1) Did you miss the first word?  ("NULL if A or B is NULL")
> 2) Darren Yin posted a similar message to the user list<http://mail-archives.apache.org/mod_mbox/hive-user/201308.mbox/%3cCAPWDJtUZRaPgeP=0XNSbaOs7+[EMAIL PROTECTED]%3e>on August 1st (or July 31st in some time zones):
>
> ===========> from here:
> https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF#LanguageManualUDF-RelationalOperators
>  A RLIKE B strings NULL if A or B is NULL, TRUE if any (possibly empty)
> substring of A matches the Java regular expression B, otherwise FALSE. E.g.
> 'foobar' RLIKE 'foo' evaluates to FALSE whereas 'foobar' RLIKE '^f.*r$'
> evaluates to TRUE.
> 'foobar' RLIKE 'foo' evaluates to TRUE doesn't it?
> ===========>
>
> The page history shows this:
>
> *June 24, 2011 (first version, unchanged until July 4 this year):*
> NULL if A or B is NULL, TRUE if string A matches the Java regular
> expression B(See Java regular expressions syntax), otherwise FALSE e.g.
> 'foobar' rlike 'foo' evaluates to FALSE where as 'foobar' rlike '^f.*r$'
> evaluates to TRUE
>
> *July 4, 2013 (version 47 changed by Siyang Chen<https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=27362046&selectedPageVersions=47&selectedPageVersions=46>
> )*
> NULL if A or B is NULL, TRUE if any (possibly empty) substring of A
> matches the Java regular expression B, otherwise FALSE. E.g. 'foobar' RLIKE
> 'foo' evaluates to FALSE whereas 'foobar' RLIKE '^f.*r$' evaluates to TRUE.
>
>
> -- Lefty Leverenz
>
>
>
> On Thu, Aug 8, 2013 at 7:28 PM, Sergey Shelukhin <[EMAIL PROTECTED]>wrote:
>
>> Double checking before I try to edit.
>>
>> The page here:
>> https://cwiki.apache.org/Hive/languagemanual-udf.html
>>
>> says:
>>
>> A RLIKE B
>>  if A or B is NULL, TRUE if any (possibly empty) substring of A
>> matches the Java regular expression B, otherwise FALSE. E.g. 'foobar'
>> RLIKE 'foo' evaluates to FALSE whereas 'foobar' RLIKE '^f.*r$'
>> evaluates to TRUE.
>>
>> 1) "if A or B is NULL" seems like an unfinished part.
>> 2) "any (possibly empty) substring of A [that] matches the Java
>> regular expression B" should be "foo" at 0 for 'foobar' RLIKE 'foo',
>> and result in TRUE, right?
>>
>
>
>
> --
> Lefty
>

--
Dean Wampler, Ph.D.
@deanwampler
http://polyglotprogramming.com
+
Lefty Leverenz 2013-08-11, 20:21
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB