asolimando commented on code in PR #4100:
URL: https://github.com/apache/calcite/pull/4100#discussion_r1950436221
##########
core/src/main/java/org/apache/calcite/schema/Schema.java:
##########
@@ -56,9 +59,30 @@
* {@link Schema#getSubSchema(String)}.
*/
public interface Schema {
+
+ /**
+ * Returns a lookup object to find tables.
+ *
+ * @return Lookup
+ */
+ default Lookup<Table> tables() {
+ return new CompatibilityLookup<>(this::getTable, this::getTableNames);
+ }
+
+ /**
+ * Returns a lookup object to find sub schemas.
+ *
+ * @return Lookup
+ */
+ default Lookup<? extends Schema> subSchemas() {
+ return new CompatibilityLookup<>(this::getSubSchema,
this::getSubSchemaNames);
+ }
+
/**
* Returns a table with a given name, or null if not found.
*
+ * <p>Please use {@link Schema#tables()} and {@link Lookup#get(String)}
instead.
Review Comment:
If there is consensus that the method should be deprecated I see no problem
in marking it as such, we do it on a regular basis already. Given the pervasive
use of Calcite in many downstream projects, we haven't removed any deprecated
method so far (there are several comments saying "to be removed before v2.0 in
the codebase"), but the fact that downstream projects are warned ahead of time
is exactly what we want.
--
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]