zachjsh commented on code in PR #14378:
URL: https://github.com/apache/druid/pull/14378#discussion_r1226834478
##########
sql/src/main/java/org/apache/druid/sql/calcite/schema/InformationSchema.java:
##########
@@ -469,6 +487,66 @@ public Object[] apply(final RelDataTypeField field)
}
}
+ static class RoutinesTable extends AbstractTable implements ScannableTable
+ {
+ private static final String FUNCTION = "FUNCTION";
+ private final DruidOperatorTable operatorTable;
+
+ public RoutinesTable(
+ DruidOperatorTable operatorTable
+ )
+ {
+ this.operatorTable = operatorTable;
+ }
+
+
+ @Override
+ public RelDataType getRowType(RelDataTypeFactory typeFactory)
+ {
+ return ROUTINES_SIGNATURE;
+ }
+
+ @Override
+ public Statistic getStatistic()
+ {
+ return Statistics.UNKNOWN;
+ }
+
+ @Override
+ public TableType getJdbcTableType()
+ {
+ return TableType.SYSTEM_TABLE;
+ }
+
+ @Override
+ public Enumerable<Object[]> scan(DataContext root)
+ {
+ final List<Object[]> rows = new ArrayList<>();
+ List<SqlOperator> operatorList = operatorTable.getOperatorList();
+
+ for (SqlOperator sqlOperator : operatorList) {
+ if (sqlOperator.getSyntax() != SqlSyntax.FUNCTION &&
Review Comment:
Curious, how did you come up with this list of sqlSyntax types to filter
against? I see that the
org.apache.druid.sql.calcite.planner.DruidOperatorTable#normalizeSyntax seems
to treat anything that is not `PREFIX`, `BINARY`, or `POSTFIX` as `FUNCTION`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]