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

Kunal Khatua commented on DRILL-6937:
-------------------------------------

[~khfaraaz] the {{/int}} function name is correct. See 
https://github.com/apache/drill/blame/master/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/IntervalNumericArithmetic.java#L133

That said, I'm not sure if this is really a bug, since there have been other 
functions, like {{$sum0}} around as well:
https://github.com/apache/drill/blame/master/exec/java-exec/src/main/codegen/templates/SumZeroAggr.java#L48

Not all functions in the {{sys.functions}} table are necessarily utilized by 
users in their alphabetical representation, and are exposed to mathematical 
symbols as operators.

For example, the _less than_  or _greater than_ operator can be seen here in 
multiple forms.
{code}
0: jdbc:drill:drillbit=kk127> select * from sys.functions where returnType = 
'BIT' and signature = 'BIGINT-REQUIRED,BIGINT-REQUIRED'  limit 15;
+---------------------------+----------------------------------+-------------+-----------+-----------+
|           name            |            signature             | returnType  |  
source   | internal  |
+---------------------------+----------------------------------+-------------+-----------+-----------+
| !=                        | BIGINT-REQUIRED,BIGINT-REQUIRED  | BIT         | 
built-in  | false     |
| <                         | BIGINT-REQUIRED,BIGINT-REQUIRED  | BIT         | 
built-in  | false     |
| <=                        | BIGINT-REQUIRED,BIGINT-REQUIRED  | BIT         | 
built-in  | false     |
| <>                        | BIGINT-REQUIRED,BIGINT-REQUIRED  | BIT         | 
built-in  | false     |
| =                         | BIGINT-REQUIRED,BIGINT-REQUIRED  | BIT         | 
built-in  | false     |
| ==                        | BIGINT-REQUIRED,BIGINT-REQUIRED  | BIT         | 
built-in  | false     |
| >                         | BIGINT-REQUIRED,BIGINT-REQUIRED  | BIT         | 
built-in  | false     |
| >=                        | BIGINT-REQUIRED,BIGINT-REQUIRED  | BIT         | 
built-in  | false     |
| equal                     | BIGINT-REQUIRED,BIGINT-REQUIRED  | BIT         | 
built-in  | false     |
| greater_than              | BIGINT-REQUIRED,BIGINT-REQUIRED  | BIT         | 
built-in  | false     |
| greater_than_or_equal_to  | BIGINT-REQUIRED,BIGINT-REQUIRED  | BIT         | 
built-in  | false     |
| less_than                 | BIGINT-REQUIRED,BIGINT-REQUIRED  | BIT         | 
built-in  | false     |
| less_than_or_equal_to     | BIGINT-REQUIRED,BIGINT-REQUIRED  | BIT         | 
built-in  | false     |
| not_equal                 | BIGINT-REQUIRED,BIGINT-REQUIRED  | BIT         | 
built-in  | false     |
+---------------------------+----------------------------------+-------------+-----------+-----------+
14 rows selected (0.282 seconds)
{code}

So, I'm not sure this would qualify as a bug. 
[~arina] do you agree?

> 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: Minor
>             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