public Builder mergeFrom(com.dremio.exec.proto.UserProtos.GetCatalogsResp other) { if (other == com.dremio.exec.proto.UserProtos.GetCatalogsResp.getDefaultInstance()) return this; if (other.hasStatus()) { setStatus(other.getStatus());
@Test public void catalogs() throws Exception { // test("SELECT * FROM INFORMATION_SCHEMA.CATALOGS"); // SQL equivalent GetCatalogsResp resp = client.getCatalogs(null).get(); assertEquals(RequestStatus.OK, resp.getStatus()); List<CatalogMetadata> catalogs = resp.getCatalogsList(); assertEquals(1, catalogs.size()); CatalogMetadata c = catalogs.get(0); assertEquals(IS_CATALOG_NAME, c.getCatalogName()); assertEquals(IS_CATALOG_DESCR, c.getDescription()); assertEquals(IS_CATALOG_CONNECT, c.getConnect()); }
@Test public void catalogsWithFilter() throws Exception { // test("SELECT * FROM INFORMATION_SCHEMA.CATALOGS " + // "WHERE CATALOG_NAME LIKE '%DRE%' ESCAPE '\\'"); // SQL equivalent GetCatalogsResp resp = client.getCatalogs(LikeFilter.newBuilder().setPattern("%DRE%").setEscape("\\").build()).get(); assertEquals(RequestStatus.OK, resp.getStatus()); List<CatalogMetadata> catalogs = resp.getCatalogsList(); assertEquals(1, catalogs.size()); CatalogMetadata c = catalogs.get(0); assertEquals(IS_CATALOG_NAME, c.getCatalogName()); assertEquals(IS_CATALOG_DESCR, c.getDescription()); assertEquals(IS_CATALOG_CONNECT, c.getConnect()); }
@Override protected RequestStatus getStatus(GetCatalogsResp response) { return response.getStatus(); }
public void writeTo(io.protostuff.Output output, com.dremio.exec.proto.UserProtos.GetCatalogsResp message) throws java.io.IOException { if(message.hasStatus()) output.writeEnum(1, message.getStatus().getNumber(), false); for(com.dremio.exec.proto.UserProtos.CatalogMetadata catalogs : message.getCatalogsList()) output.writeObject(2, catalogs, com.dremio.exec.proto.SchemaUserProtos.CatalogMetadata.WRITE, true); if(message.hasError()) output.writeObject(3, message.getError(), com.dremio.exec.proto.SchemaUserBitShared.DremioPBError.WRITE, false); if(message.hasQueryId()) output.writeObject(13, message.getQueryId(), com.dremio.exec.proto.SchemaUserBitShared.QueryId.WRITE, false); } public boolean isInitialized(com.dremio.exec.proto.UserProtos.GetCatalogsResp message)
@Test public void catalogsWithFilterNegative() throws Exception { // test("SELECT * FROM INFORMATION_SCHEMA.CATALOGS // WHERE CATALOG_NAME LIKE '%DRIj\\\\hgjh%' ESCAPE '\\'"); // SQL equivalent GetCatalogsResp resp = client.getCatalogs(LikeFilter.newBuilder().setPattern("%DRIj\\%hgjh%").setEscape("\\").build()).get(); assertEquals(RequestStatus.OK, resp.getStatus()); List<CatalogMetadata> catalogs = resp.getCatalogsList(); assertEquals(0, catalogs.size()); }