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 >> Use Hive reflect() method to call non-static JDK fuctions


+
David Lee 2013-03-19, 00:00
Copy link to this message
-
Re: Use Hive reflect() method to call non-static JDK fuctions
It's implemented in trunk, named as reflect2.

https://issues.apache.org/jira/browse/HIVE-4025

2013/3/19 David Lee <[EMAIL PROTECTED]>:
>
>
> It's relatively straight forward to call static functions in JDK using
> reflect.  For example,
>
> select reflect("java.lang.Math", "max", 2, 3) from mytable limit 1;
>
> However,  how do I use reflect to call non-static functions (e.g., indexOf()
> method in java.lang.String class)?
> None of the following usage of reflect is correct.  Assuming that mytable
> has column called text.
>
> select text, reflect('java.lang.String', 'indexOf', 'school today'),
> reflect('java.lang.String', 'indexOf', text, 'school today'),
> reflect('java.lang.String', 'indexOf', 'school today', text)
> from mytable
> limit 1;
>
>
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