@Override public GetInfoValue getInfo(GetInfoType getInfoType) throws HiveSQLException { acquire(true, true); try { switch (getInfoType) { case CLI_SERVER_NAME: return new GetInfoValue("Hive"); case CLI_DBMS_NAME: return new GetInfoValue("Apache Hive"); case CLI_DBMS_VER: return new GetInfoValue(HiveVersionInfo.getVersion()); case CLI_MAX_COLUMN_NAME_LEN: return new GetInfoValue(128); case CLI_MAX_SCHEMA_NAME_LEN: return new GetInfoValue(128); case CLI_MAX_TABLE_NAME_LEN: return new GetInfoValue(128); case CLI_ODBC_KEYWORDS: return new GetInfoValue(ParseUtils.getKeywords(ODBC_KEYWORDS)); case CLI_TXN_CAPABLE: default: throw new HiveSQLException("Unrecognized GetInfoType value: " + getInfoType.toString()); } } finally { release(true, true); } }
@Override public TGetInfoResp GetInfo(TGetInfoReq req) throws TException { TGetInfoResp resp = new TGetInfoResp(); try { GetInfoValue getInfoValue = cliService.getInfo(new SessionHandle(req.getSessionHandle()), GetInfoType.getGetInfoType(req.getInfoType())); resp.setInfoValue(getInfoValue.toTGetInfoValue()); resp.setStatus(OK_STATUS); } catch (Exception e) { LOG.warn("Error getting info: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; }
@Test public void testGetInfo() throws Exception { SessionHandle sessionHandle = client.openSession( "tom", "password", Collections.<String, String>emptyMap()); assertNotNull(sessionHandle); GetInfoValue value = client.getInfo(sessionHandle, GetInfoType.CLI_DBMS_NAME); System.out.println(value.getStringValue()); value = client.getInfo(sessionHandle, GetInfoType.CLI_SERVER_NAME); System.out.println(value.getStringValue()); value = client.getInfo(sessionHandle, GetInfoType.CLI_DBMS_VER); System.out.println(value.getStringValue()); client.closeSession(sessionHandle); }
return new MetaDataInfo(val.getStringValue(), val.getShortValue(), val.getIntValue(), val.getLongValue()); } finally { closeInternal(getQueryHandle(sessionConf), new ReadOnlyOperationInfo(sessionHandle, null, sessionConf, "", ""));
return new MetaDataInfo(val.getStringValue(), val.getShortValue(), val.getIntValue(), val.getLongValue()); } finally { closeInternal(getQueryHandle(sessionConf), new ReadOnlyOperationInfo(sessionHandle, null, sessionConf, "", ""));
@Override public GetInfoValue getInfo(SessionHandle sessionHandle, GetInfoType infoType) throws HiveSQLException { try { // FIXME extract the right info type TGetInfoReq req = new TGetInfoReq(sessionHandle.toTSessionHandle(), infoType.toTGetInfoType()); TGetInfoResp resp = cliService.GetInfo(req); checkStatus(resp.getStatus()); return new GetInfoValue(resp.getInfoValue()); } catch (HiveSQLException e) { throw e; } catch (Exception e) { throw new HiveSQLException(e); } }
@Override public TGetInfoResp GetInfo(TGetInfoReq req) throws TException { TGetInfoResp resp = new TGetInfoResp(); try { GetInfoValue getInfoValue = cliService.getInfo(new SessionHandle(req.getSessionHandle()), GetInfoType.getGetInfoType(req.getInfoType())); resp.setInfoValue(getInfoValue.toTGetInfoValue()); resp.setStatus(OK_STATUS); } catch (Exception e) { LOG.warn("Error getting info: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; }
@Override public GetInfoValue getInfo(GetInfoType getInfoType) throws HiveSQLException { acquire(true); try { switch (getInfoType) { case CLI_SERVER_NAME: return new GetInfoValue("Hive"); case CLI_DBMS_NAME: return new GetInfoValue("Apache Hive"); case CLI_DBMS_VER: return new GetInfoValue(HiveVersionInfo.getVersion()); case CLI_MAX_COLUMN_NAME_LEN: return new GetInfoValue(128); case CLI_MAX_SCHEMA_NAME_LEN: return new GetInfoValue(128); case CLI_MAX_TABLE_NAME_LEN: return new GetInfoValue(128); case CLI_TXN_CAPABLE: default: throw new HiveSQLException("Unrecognized GetInfoType value: " + getInfoType.toString()); } } finally { release(true); } }
@Override public TGetInfoResp GetInfo(TGetInfoReq req) throws TException { TGetInfoResp resp = new TGetInfoResp(); try { GetInfoValue getInfoValue = cliService.getInfo(new SessionHandle(req.getSessionHandle()), GetInfoType.getGetInfoType(req.getInfoType())); resp.setInfoValue(getInfoValue.toTGetInfoValue()); resp.setStatus(OK_STATUS); } catch (Exception e) { LOG.warn("Error getting info: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; }
@Override public GetInfoValue getInfo(GetInfoType getInfoType) throws HiveSQLException { acquire(true); try { switch (getInfoType) { case CLI_SERVER_NAME: return new GetInfoValue("Hive"); case CLI_DBMS_NAME: return new GetInfoValue("Apache Hive"); case CLI_DBMS_VER: return new GetInfoValue(HiveVersionInfo.getVersion()); case CLI_MAX_COLUMN_NAME_LEN: return new GetInfoValue(128); case CLI_MAX_SCHEMA_NAME_LEN: return new GetInfoValue(128); case CLI_MAX_TABLE_NAME_LEN: return new GetInfoValue(128); case CLI_TXN_CAPABLE: default: throw new HiveSQLException("Unrecognized GetInfoType value: " + getInfoType.toString()); } } finally { release(true); } }
@Override public TGetInfoResp GetInfo(TGetInfoReq req) throws TException { TGetInfoResp resp = new TGetInfoResp(); try { GetInfoValue getInfoValue = cliService.getInfo(new SessionHandle(req.getSessionHandle()), GetInfoType.getGetInfoType(req.getInfoType())); resp.setInfoValue(getInfoValue.toTGetInfoValue()); resp.setStatus(OK_STATUS); } catch (Exception e) { LOG.warn("Error getting info: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; }
@Override public GetInfoValue getInfo(GetInfoType getInfoType) throws HiveSQLException { acquire(true); try { switch (getInfoType) { case CLI_SERVER_NAME: return new GetInfoValue("Hive"); case CLI_DBMS_NAME: return new GetInfoValue("Apache Hive"); case CLI_DBMS_VER: return new GetInfoValue(HiveVersionInfo.getVersion()); case CLI_MAX_COLUMN_NAME_LEN: return new GetInfoValue(128); case CLI_MAX_SCHEMA_NAME_LEN: return new GetInfoValue(128); case CLI_MAX_TABLE_NAME_LEN: return new GetInfoValue(128); case CLI_TXN_CAPABLE: default: throw new HiveSQLException("Unrecognized GetInfoType value: " + getInfoType.toString()); } } finally { release(true); } }
@Override public TGetInfoResp GetInfo(TGetInfoReq req) throws TException { TGetInfoResp resp = new TGetInfoResp(); try { GetInfoValue getInfoValue = cliService.getInfo(new SessionHandle(req.getSessionHandle()), GetInfoType.getGetInfoType(req.getInfoType())); resp.setInfoValue(getInfoValue.toTGetInfoValue()); resp.setStatus(OK_STATUS); } catch (Exception e) { LOG.warn("Error getting info: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; }
@Override public GetInfoValue getInfo(GetInfoType getInfoType) throws HiveSQLException { acquire(true); try { switch (getInfoType) { case CLI_SERVER_NAME: return new GetInfoValue("Hive"); case CLI_DBMS_NAME: return new GetInfoValue("Apache Hive"); case CLI_DBMS_VER: return new GetInfoValue(HiveVersionInfo.getVersion()); case CLI_MAX_COLUMN_NAME_LEN: return new GetInfoValue(128); case CLI_MAX_SCHEMA_NAME_LEN: return new GetInfoValue(128); case CLI_MAX_TABLE_NAME_LEN: return new GetInfoValue(128); case CLI_TXN_CAPABLE: default: throw new HiveSQLException("Unrecognized GetInfoType value: " + getInfoType.toString()); } } finally { release(true); } }
@Override public TGetInfoResp GetInfo(TGetInfoReq req) throws TException { TGetInfoResp resp = new TGetInfoResp(); try { GetInfoValue getInfoValue = cliService.getInfo(new SessionHandle(req.getSessionHandle()), GetInfoType.getGetInfoType(req.getInfoType())); resp.setInfoValue(getInfoValue.toTGetInfoValue()); resp.setStatus(OK_STATUS); } catch (Exception e) { LOG.warn("Error getting info: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; }
@Override public GetInfoValue getInfo(GetInfoType getInfoType) throws HiveSQLException { acquire(true, true); try { switch (getInfoType) { case CLI_SERVER_NAME: return new GetInfoValue("Hive"); case CLI_DBMS_NAME: return new GetInfoValue("Apache Hive"); case CLI_DBMS_VER: return new GetInfoValue(HiveVersionInfo.getVersion()); case CLI_MAX_COLUMN_NAME_LEN: return new GetInfoValue(128); case CLI_MAX_SCHEMA_NAME_LEN: return new GetInfoValue(128); case CLI_MAX_TABLE_NAME_LEN: return new GetInfoValue(128); case CLI_ODBC_KEYWORDS: return new GetInfoValue(ParseUtils.getKeywords(ODBC_KEYWORDS)); case CLI_TXN_CAPABLE: default: throw new HiveSQLException("Unrecognized GetInfoType value: " + getInfoType.toString()); } } finally { release(true, true); } }
@Override public GetInfoValue getInfo(SessionHandle sessionHandle, GetInfoType infoType) throws HiveSQLException { try { // FIXME extract the right info type TGetInfoReq req = new TGetInfoReq(sessionHandle.toTSessionHandle(), infoType.toTGetInfoType()); TGetInfoResp resp = cliService.GetInfo(req); checkStatus(resp.getStatus()); return new GetInfoValue(resp.getInfoValue()); } catch (HiveSQLException e) { throw e; } catch (Exception e) { throw new HiveSQLException(e); } }
@Override public GetInfoValue getInfo(SessionHandle sessionHandle, GetInfoType infoType) throws HiveSQLException { try { // FIXME extract the right info type TGetInfoReq req = new TGetInfoReq(sessionHandle.toTSessionHandle(), infoType.toTGetInfoType()); TGetInfoResp resp = cliService.GetInfo(req); checkStatus(resp.getStatus()); return new GetInfoValue(resp.getInfoValue()); } catch (HiveSQLException e) { throw e; } catch (Exception e) { throw new HiveSQLException(e); } }
@Override public GetInfoValue getInfo(SessionHandle sessionHandle, GetInfoType infoType) throws HiveSQLException { try { // FIXME extract the right info type TGetInfoReq req = new TGetInfoReq(sessionHandle.toTSessionHandle(), infoType.toTGetInfoType()); TGetInfoResp resp = cliService.GetInfo(req); checkStatus(resp.getStatus()); return new GetInfoValue(resp.getInfoValue()); } catch (HiveSQLException e) { throw e; } catch (Exception e) { throw new HiveSQLException(e); } }
@Override public GetInfoValue getInfo(SessionHandle sessionHandle, GetInfoType infoType) throws HiveSQLException { try { // FIXME extract the right info type TGetInfoReq req = new TGetInfoReq(sessionHandle.toTSessionHandle(), infoType.toTGetInfoType()); TGetInfoResp resp = cliService.GetInfo(req); checkStatus(resp.getStatus()); return new GetInfoValue(resp.getInfoValue()); } catch (HiveSQLException e) { throw e; } catch (Exception e) { throw new HiveSQLException(e); } }