use of org.apache.calcite.avatica.jdbc.JdbcMeta in project phoenix by apache.
the class PhoenixMetaFactoryImpl method create.
@Override
public Meta create(List<String> args) {
Configuration conf = Preconditions.checkNotNull(getConf(), "Configuration must not be null.");
Properties info = new Properties();
info.putAll(conf.getValByRegex("avatica.*"));
try {
final String url;
if (args.size() == 0) {
url = QueryUtil.getConnectionUrl(info, conf);
} else if (args.size() == 1) {
url = args.get(0);
} else {
throw new RuntimeException("0 or 1 argument expected. Received " + Arrays.toString(args.toArray()));
}
// TODO: what about -D configs passed in from cli? How do they get pushed down?
return new JdbcMeta(url, info);
} catch (SQLException | ClassNotFoundException e) {
throw new RuntimeException(e);
}
}
Aggregations