final List<String> schemaList = Arrays.asList(schema);
Class.forName("net.hydromatic.optiq.jdbc.Driver");
String suffix = schemaList.contains("spark") ? "spark=true" : "";
Connection connection =
DriverManager.getConnection("jdbc:optiq:" + suffix);
OptiqConnection optiqConnection =
connection.unwrap(OptiqConnection.class);
SchemaPlus rootSchema = optiqConnection.getRootSchema();
if (schemaList.contains("hr")) {
addSchema(rootSchema, SchemaSpec.HR);
}
if (schemaList.contains("foodmart")) {
addSchema(rootSchema, SchemaSpec.REFLECTIVE_FOODMART);