This commit is contained in:
Zoltan Haindrich 2024-05-16 11:11:55 +00:00
parent 93892b6524
commit 688611eab3
1 changed files with 11 additions and 11 deletions

View File

@ -21,8 +21,11 @@ package org.apache.druid.sql.calcite.schema;
import com.google.inject.Binder;
import com.google.inject.Module;
import com.google.inject.Provides;
import com.google.inject.Scopes;
import com.google.inject.name.Named;
import com.google.inject.name.Names;
import org.apache.druid.guice.LazySingleton;
import org.apache.druid.guice.LifecycleModule;
import org.apache.druid.sql.guice.SqlBindings;
@ -31,9 +34,6 @@ import org.apache.druid.sql.guice.SqlBindings;
*/
public class DruidCalciteSchemaModule implements Module
{
public DruidCalciteSchemaModule(){
}
private static final String DRUID_SCHEMA_NAME = "druid";
private static final String INFORMATION_SCHEMA_NAME = "INFORMATION_SCHEMA";
static final String INCOMPLETE_SCHEMA = "INCOMPLETE_SCHEMA";
@ -64,11 +64,11 @@ public class DruidCalciteSchemaModule implements Module
SqlBindings.addSchema(binder, NamedViewSchema.class);
}
// @Provides
// @LazySingleton
// private DruidSchemaCatalog getRootSchema(@Named(INCOMPLETE_SCHEMA) DruidSchemaCatalog rootSchema, InformationSchema informationSchema)
// {
// rootSchema.getRootSchema().add(INFORMATION_SCHEMA_NAME, informationSchema);
// return rootSchema;
// }
@Provides
@LazySingleton
private DruidSchemaCatalog getRootSchema(@Named(INCOMPLETE_SCHEMA) DruidSchemaCatalog rootSchema, InformationSchema informationSchema)
{
rootSchema.getRootSchema().add(INFORMATION_SCHEMA_NAME, informationSchema);
return rootSchema;
}
}