olivrlee commented on code in PR #3421:
URL: https://github.com/apache/calcite/pull/3421#discussion_r1323778271
##########
core/src/main/java/org/apache/calcite/jdbc/CalciteMetaImpl.java:
##########
@@ -263,23 +288,30 @@ private static ImmutableMap.Builder<DatabaseProperty,
Object> addProperty(
typeFilter = v1 -> typeList.contains(v1.tableType);
}
final Predicate1<MetaSchema> schemaMatcher = namedMatcher(schemaPattern);
- return createResultSet(schemas(catalog)
- .where(schemaMatcher)
- .selectMany(schema -> tables(schema, matcher(tableNamePattern)))
- .where(typeFilter),
- MetaTable.class,
- "TABLE_CAT",
- "TABLE_SCHEM",
- "TABLE_NAME",
- "TABLE_TYPE",
- "REMARKS",
- "TYPE_CAT",
- "TYPE_SCHEM",
- "TYPE_NAME",
- "SELF_REFERENCING_COL_NAME",
- "REF_GENERATION");
+ Enumerable<MetaTable> tables = schemas(catalog)
+ .where(schemaMatcher)
+ .selectMany(schema -> tables(schema, matcher(tableNamePattern)))
+ .where(typeFilter);
+ String[] columnNames = getColumnNames(this.metaTableClass);
+ return createResultSet(tables,
+ this.metaTableClass,
+ columnNames);
+ }
+
+ /** The provided subclass needs to overload getColumnNames() with the
expected columns in the
+ * enumerable.
+ * */
+ private String[] getColumnNames(Class<?> clazz) {
+ try {
+ Method m = clazz.getMethod("getColumnNames");
Review Comment:
I tried this modification: `getColumnNames(Class<? extends CalciteMetaTable>
clazz){...}` however it that `clazz` object still doesn't have direct access
to the interface function getColumnNames()
Also, if this change worked, I would need 2 functions for this, one for
`extends CalciteMetaTable` and one for `extends MetaColumn`
Thoughts?
--
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]