hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ashish Thusoo (JIRA)" <>
Subject [jira] Commented: (HIVE-471) A UDF for simple reflection
Date Thu, 06 Aug 2009 09:45:14 GMT


Ashish Thusoo commented on HIVE-471:

Sorry in the delay in responding. Zheng would be able to give you better answers here.

For the error that you are getting I think you have to end up using ObjectInspectorConvertors
I think but Zheng can confirm. 

For different return type you could take a look at the and look at how
it defines ReturnObjectInspectorResolver. Similar to that you could have a ReflectionObjectInspectorResolver
which returns the proper ObjectInspector corresponding to the return type.

ObjectInspectors essentially encode the type and the in memory formats of the object. Let
us know if you  are able to make progress by following

> A UDF for simple reflection
> ---------------------------
>                 Key: HIVE-471
>                 URL:
>             Project: Hadoop Hive
>          Issue Type: New Feature
>          Components: Query Processor
>            Reporter: Edward Capriolo
>            Assignee: Edward Capriolo
>            Priority: Minor
>             Fix For: 0.4.0
>         Attachments: hive-471-gen.diff, hive-471.diff
> There are many methods in java that are static and have no arguments or can be invoked
with one simple parameter. More complicated functions will require a UDF but one generic one
can work as a poor-mans UDF.
> {noformat}
> SELECT reflect("java.lang.String", "valueOf", 1), reflect("java.lang.String", "isEmpty")
> FROM src LIMIT 1;
> {noformat}

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message