Skip to content

Commit

Permalink
undo
Browse files Browse the repository at this point in the history
  • Loading branch information
kgyrtkirk committed May 16, 2024
1 parent 93892b6 commit 688611e
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@

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;

Expand All @@ -31,9 +34,6 @@
*/
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";
Expand All @@ -44,7 +44,7 @@ public void configure(Binder binder)
binder.bind(String.class).annotatedWith(DruidSchemaName.class).toInstance(DRUID_SCHEMA_NAME);

// Should only be used by the information schema
binder.bind(DruidSchemaCatalog.class)
binder.bind(DruidSchemaCatalog.class)
.annotatedWith(Names.named(INCOMPLETE_SCHEMA))
.toProvider(RootSchemaProvider.class)
.in(Scopes.SINGLETON);
Expand All @@ -64,11 +64,11 @@ public void configure(Binder binder)
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;
}
}

0 comments on commit 688611e

Please sign in to comment.