DRILL-3988: Expose Drill built-in functions & UDFs in a system table (#1483)
This commit exposes available SQL functions in Drill and also detects UDFs that have been dynamically loaded into Drill.
An example is shown below for 2 UDFs dynamically loaded into the cluster, along side the existing built-in functions that come with Drill.
```
0: jdbc:drill:schema=sys> select source, count(*) as functionCount from sys.functions group by source;
+-----------------------------------------+----------------+
| source | functionCount |
+-----------------------------------------+----------------+
| built-in | 2704 |
| simple-drill-function-1.0-SNAPSHOT.jar | 12 |
| drill-url-tools-1.0.jar | 1 |
+-----------------------------------------+----------------+
3 rows selected (0.209 seconds)
```
The system table exposes information as shown. The UDF is initialized, making the `returnType` available.
The `random(FLOAT8-REQUIRED,FLOAT8-REQUIRED)` function is an example of a UDF that has overloaded arguments (see `signature`).
The `url_parse(VARCHAR-REQUIRED)` function is another example of an initialized UDF.
Rest are built-in functions that meet the query's filter criteria.
```
0: jdbc:drill:schema=sys> select * from sys.functions where name like 'random' or name like '%url%';
+-------------+----------------------------------+-------------+-----------------------------------------+
| name | signature | returnType | source |
+-------------+----------------------------------+-------------+-----------------------------------------+
| parse_url | VARCHAR-REQUIRED | LATE | built-in |
| random | | FLOAT8 | built-in |
| random | FLOAT8-REQUIRED,FLOAT8-REQUIRED | FLOAT8 | simple-drill-function-1.0-SNAPSHOT.jar |
| url_decode | VARCHAR-REQUIRED | VARCHAR | built-in |
| url_encode | VARCHAR-REQUIRED | VARCHAR | built-in |
| url_parse | VARCHAR-REQUIRED | LATE | drill-url-tools-1.0.jar |
+-------------+----------------------------------+-------------+-----------------------------------------+
6 rows selected (0.619 seconds)
```