Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Drill, mail # dev - Thread for discussing CAST functionality


Copy link to this message
-
Re: Thread for discussing CAST functionality
Timothy Chen 2013-11-15, 21:20
Hi Julian,

So Does Optiq use a standard order  of types to test to enforce precedence then?

Tim

Sent from my iPhone

On Nov 15, 2013, at 8:59 AM, Julian Hyde <[EMAIL PROTECTED]> wrote:

>>
>>> On Nov 15, 2013, at 1:42 AM, Yash Sharma <[EMAIL PROTECTED]> wrote:
>>>
>>> One idea is to have categorized precedence maps. Different maps for subsets of datatypes. Only allowed datatypes will be present in each submap.
>>> Other Idea is to have a separate small  map for invalid/restricted type casts. Code will first check this map, only then it will go for implicit/explicit cast. This code can be put in the getCost() function in DrillFunctionHolder class.
>
> FYI, this stuff is in Optiq already. Take a look at https://github.com/julianhyde/optiq/blob/master/core/src/main/java/org/eigenbase/sql/type/SqlTypeAssignmentRules.java.
>
> Julian