gortiz commented on code in PR #12591:
URL: https://github.com/apache/pinot/pull/12591#discussion_r1526601060
##########
pinot-query-planner/src/main/java/org/apache/pinot/query/QueryEnvironment.java:
##########
@@ -344,6 +331,46 @@ private DispatchableSubPlan toDispatchableSubPlan(RelRoot
relRoot, PlannerContex
// utils
// --------------------------------------------------------------------------
+ private Prepare.CatalogReader getCatalog(@Nullable String schemaPath) {
+ Properties catalogReaderConfigProperties = new Properties();
+
catalogReaderConfigProperties.setProperty(CalciteConnectionProperty.CASE_SENSITIVE.camelName(),
"true");
+ CalciteSchema subSchema = schemaPath == null ? _rootSchema :
_rootSchema.getSubSchema(schemaPath, false);
+ if (subSchema != null) {
+ return new PinotCalciteCatalogReader(subSchema, subSchema.path(null),
_typeFactory,
+ new CalciteConnectionConfigImpl(catalogReaderConfigProperties));
+ } else {
+ throw new IllegalArgumentException("Cannot find schema with path: " +
schemaPath);
+ }
Review Comment:
I've just written this on GH comment, so it may have compilation or
indentation errors but I think this is easier to read:
```suggestion
CalciteSchema schema;
if (schemaPath == null) {
schema = _rootSchema;
} else {
schema = _rootSchema.getSubSchema(schemaPath, false);
if (schema == null) {
throw new IllegalArgumentException("Cannot find schema with path: "
+ schemaPath);
}
}
CalciteConnectionConfigImpl connConfig = new
CalciteConnectionConfigImpl(catalogReaderConfigProperties);
return new PinotCalciteCatalogReader(subSchema, subSchema.path(null),
_typeFactory, connConfig);
```
--
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]