[ 
https://issues.apache.org/jira/browse/DRILL-6937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16730499#comment-16730499
 ] 

Kunal Khatua edited comment on DRILL-6937 at 12/28/18 11:28 PM:
----------------------------------------------------------------

[~khfaraaz] Drill operators are also implicitly functions, which is why they 
appear in the listing. That is how Drill is able to enforce data type 
compatibility, because those operators get translated to functions with valid 
arguments.

That said, some functions are internal in nature, e.g.
{code}
0: jdbc:drill:drillbit=10.10.100.127> select distinct name from sys.functions 
where internal limit 3;
+---------------------------------------------------+
| name |
+---------------------------------------------------+
| castEmptyStringNullableVar16CharToNULLABLEBIGINT |
| castEmptyStringNullableVar16CharToNULLABLEDATE |
| castEmptyStringNullableVar16CharToNULLABLEFLOAT4 |
+---------------------------------------------------+
3 rows selected (0.408 seconds)
{code}
 
However, the {{$sum0}} and {{/int}} are operators I've not seen before and 
might be part of some new UDFs. 

Looking at the signatures, it seems that {{$sum0}} is a duplicate of the 
{{sum}} function.
{code}
0: jdbc:drill:drillbit=10.10.100.127> select $sum0(1.2) from (values(1));
+---------+
| EXPR$0  |
+---------+
| 1.2     |
+---------+
1 row selected (0.191 seconds)
{code}

As for {{/int}}, it appears to be part of the time/timestamp class of 
functions. There have been recent commits related to timestamp intervals, so 
this might have come from there. 
{code}
0: jdbc:drill:drillbit=10.10.100.127> select * from sys.functions where name 
like '/int' limit 20;
+-------+-------------------------------------+-------------+-----------+-----------+
| name  |              signature              | returnType  |  source   | 
internal  |
+-------+-------------------------------------+-------------+-----------+-----------+
| /int  | INTERVAL-REQUIRED,INT-REQUIRED      | INTERVAL    | built-in  | false 
    |
| /int  | INTERVALDAY-REQUIRED,INT-REQUIRED   | INTERVAL    | built-in  | false 
    |
| /int  | INTERVALYEAR-REQUIRED,INT-REQUIRED  | INTERVAL    | built-in  | false 
    |
+-------+-------------------------------------+-------------+-----------+-----------+
3 rows selected (0.222 seconds)
{code}

I'll take a look at it and update the JIRA with the appropriate resolution.
 


was (Author: kkhatua):
[~khfaraaz] Drill operators are also implicitly functions, which is why they 
appear in the listing. That is how Drill is able to enforce data type 
compatibility, because those operators get translated to functions with valid 
arguments.

That said, some functions are internal in nature, e.g.
{code}
0: jdbc:drill:drillbit=10.10.100.127> select distinct name from sys.functions 
where internal limit 3;
+---------------------------------------------------+
| name |
+---------------------------------------------------+
| castEmptyStringNullableVar16CharToNULLABLEBIGINT |
| castEmptyStringNullableVar16CharToNULLABLEDATE |
| castEmptyStringNullableVar16CharToNULLABLEFLOAT4 |
+---------------------------------------------------+
3 rows selected (0.408 seconds)
{code}
 
However, the {{$sum0}} and {{/int}} are operators I've not seen before and 
might be part of some new UDFs. I'll take a look at it and update the JIRA with 
the appropriate resolution.
 

> sys.functions table needs a fix in the names column
> ---------------------------------------------------
>
>                 Key: DRILL-6937
>                 URL: https://issues.apache.org/jira/browse/DRILL-6937
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Execution - Flow
>    Affects Versions: 1.15.0
>            Reporter: Khurram Faraaz
>            Assignee: Kunal Khatua
>            Priority: Major
>             Fix For: 1.16.0
>
>
> The function names in the name column of sys.functions in some cases, are the 
> operators, this is not the expected behavior, the name column should have 
> actual names and not the operators.
> I am on Drill 1.15.0 commit : 8743e8f1e8d5bca4d67c94d07a8560ad356ff2b6
> {noformat}
> Apache Drill 1.15.0
> "Data is the new oil. Ready to Drill some?"
> 0: jdbc:drill:schema=dfs.tmp> select count(*) from sys.functions;
> +---------+
> | EXPR$0 |
> +---------+
> | 2846 |
> +---------+
> 1 row selected (0.327 seconds)
> 0: jdbc:drill:schema=dfs.tmp>
> {noformat}
> {noformat}
> 0: jdbc:drill:schema=dfs.tmp> select distinct name from sys.functions limit 
> 12;
> +--------+
> | name |
> +--------+
> | != |
> | $sum0 |
> | && |
> | - |
> | /int |
> | < |
> | <= |
> | <> |
> | = |
> | == |
> | > |
> | >= |
> +--------+
> 12 rows selected (0.175 seconds)
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to