I think it's a Calcite data type that is used as a placeholder by Drill in late binding scenarios, i.e. when Drill doesn't yet know the actual type.  If you run

select typeOf(employee_id) from foodmart limit 1

you should see the resolved data type.  This data type is the one that will be matched against the AVG function.


On 2022/04/05 07:09, Wes Peng wrote:
what does ANY data type mean?

apache drill (dfs.pyh)> desc foodmart;
+-----------------+-----------+-------------+
|   COLUMN_NAME   | DATA_TYPE | IS_NULLABLE |
+-----------------+-----------+-------------+
| employee_id     | ANY       | YES         |
| full_name       | ANY       | YES         |
| position_title  | ANY       | YES         |
| birth_date      | ANY       | YES         |
| salary          | ANY       | YES         |
| education_level | ANY       | YES         |
+-----------------+-----------+-------------+
6 rows selected (0.534 seconds)


I saw this type can be used in aggregate functions. doesn't it need a cast() translation?

apache drill (dfs.pyh)> select avg(salary) as avgsal from foodmart;
+--------------------+
|       avgsal       |
+--------------------+
| 4019.6017316017314 |
+--------------------+
1 row selected (0.452 seconds)


Thanks

Reply via email to