protected GetCatalogsOperation(HiveSession parentSession) { super(parentSession, OperationType.GET_CATALOGS); rowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion(), false); LOG.info("Starting GetCatalogsOperation"); }
protected GetTypeInfoOperation(HiveSession parentSession) { super(parentSession, OperationType.GET_TYPE_INFO); rowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion(), false); LOG.info("Starting GetTypeInfoOperation"); }
public GetPrimaryKeysOperation(HiveSession parentSession, String catalogName, String schemaName, String tableName) { super(parentSession, OperationType.GET_FUNCTIONS); this.catalogName = catalogName; this.schemaName = schemaName; this.tableName = tableName; this.rowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion(), false); LOG.info( "Starting GetPrimaryKeysOperation with the following parameters: catalogName={}, schemaName={}, tableName={}", catalogName, schemaName, tableName); }
protected GetSchemasOperation(HiveSession parentSession, String catalogName, String schemaName) { super(parentSession, OperationType.GET_SCHEMAS); this.catalogName = catalogName; this.schemaName = schemaName; this.rowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion(), false); LOG.info( "Starting GetSchemasOperation with the following parameters: catalogName={}, schemaName={}", catalogName, schemaName); }
protected GetColumnsOperation(HiveSession parentSession, String catalogName, String schemaName, String tableName, String columnName) { super(parentSession, OperationType.GET_COLUMNS); this.catalogName = catalogName; this.schemaName = schemaName; this.tableName = tableName; this.columnName = columnName; this.rowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion(), false); LOG.info("Starting GetColumnsOperation with the following parameters: " + "catalogName={}, schemaName={}, tableName={}, columnName={}", catalogName, schemaName, tableName, columnName); }
public GetFunctionsOperation(HiveSession parentSession, String catalogName, String schemaName, String functionName) { super(parentSession, OperationType.GET_FUNCTIONS); this.catalogName = catalogName; this.schemaName = schemaName; this.functionName = functionName; this.rowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion(), false); LOG.info( "Starting GetFunctionsOperation with the following parameters: catalogName={}, schemaName={}, functionName={}", catalogName, schemaName, functionName); }
public GetCrossReferenceOperation(HiveSession parentSession, String parentCatalogName, String parentSchemaName, String parentTableName, String foreignCatalog, String foreignSchema, String foreignTable) { super(parentSession, OperationType.GET_FUNCTIONS); this.parentCatalogName = parentCatalogName; this.parentSchemaName = parentSchemaName; this.parentTableName = parentTableName; this.foreignCatalogName = foreignCatalog; this.foreignSchemaName = foreignSchema; this.foreignTableName = foreignTable; this.rowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion(), false); LOG.info("Starting GetCrossReferenceOperation with the following parameters:" + " parentCatalogName={}, parentSchemaName={}, parentTableName={}, foreignCatalog={}, " + "foreignSchema={}, foreignTable={}", parentCatalogName, parentSchemaName, parentTableName, foreignCatalog, foreignSchema, foreignTable); }
protected GetTablesOperation(HiveSession parentSession, String catalogName, String schemaName, String tableName, List<String> tableTypes) { super(parentSession, OperationType.GET_TABLES); this.catalogName = catalogName; this.schemaName = schemaName; this.tableName = tableName; String tableMappingStr = getParentSession().getHiveConf(). getVar(HiveConf.ConfVars.HIVE_SERVER2_TABLE_TYPE_MAPPING); tableTypeMapping = TableTypeMappingFactory.getTableTypeMapping(tableMappingStr); if (tableTypes != null) { tableTypeList = new ArrayList<String>(); for (String tableType : tableTypes) { tableTypeList.addAll(Arrays.asList(tableTypeMapping.mapToHiveType(tableType.trim()))); } } else { tableTypeList = null; } this.rowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion(), false); LOG.info("Starting GetTablesOperation with the following parameters: " + "catalogName={}, schemaName={}, tableName={}, tableTypes={}", catalogName, schemaName, tableName, tableTypeList != null ? tableTypeList.toString() : "null"); }
protected GetTableTypesOperation(HiveSession parentSession) { super(parentSession, OperationType.GET_TABLE_TYPES); String tableMappingStr = getParentSession().getHiveConf().getVar(HiveConf.ConfVars.HIVE_SERVER2_TABLE_TYPE_MAPPING); tableTypeMapping = TableTypeMappingFactory.getTableTypeMapping(tableMappingStr); rowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion(), false); LOG.info("Starting GetTableTypesOperation"); }
fetchedRows = RowSetFactory.create(results, protocol); fetchedRowsItr = fetchedRows.iterator();
rowSet = RowSetFactory.create(tFetchResultsResp.getResults(), connection.getProtocol()); for (Object[] row : rowSet) { logs.add(String.valueOf(row[0]));
@Override public RowSet getNextRowSet(FetchOrientation orientation, long maxRows) throws HiveSQLException { validateDefaultFetchOrientation(orientation); if (orientation.equals(FetchOrientation.FETCH_FIRST)) { resetResultReader(); } List<String> rows = readResults((int) maxRows); RowSet rowSet = RowSetFactory.create(resultSchema, getProtocolVersion(), false); // cannot do delimited split for some commands like "dfs -cat" that prints the contents of file which may have // different delimiter. so we will split only when the resultSchema has more than 1 column if (resultSchema != null && resultSchema.getSize() > 1) { for (String row : rows) { rowSet.addRow(row.split("\\t")); } } else { for (String row : rows) { rowSet.addRow(new String[]{row}); } } return rowSet; }
RowSet rowSet = RowSetFactory.create(getResultSetSchema(), getProtocolVersion(), isBlobBased); try {
public RowSet getOperationLogRowSet(OperationHandle opHandle, FetchOrientation orientation, long maxRows, HiveConf hConf) throws HiveSQLException { TableSchema tableSchema = new TableSchema(getLogSchema()); RowSet rowSet = RowSetFactory.create(tableSchema, getOperation(opHandle).getProtocolVersion(), false); if (hConf.getBoolVar(ConfVars.HIVE_SERVER2_LOGGING_OPERATION_ENABLED) == false) { LOG.warn("Try to get operation log when hive.server2.logging.operation.enabled is false, no log will be returned. "); return rowSet; } // get the OperationLog object from the operation OperationLog operationLog = getOperation(opHandle).getOperationLog(); if (operationLog == null) { throw new HiveSQLException("Couldn't find log associated with operation handle: " + opHandle); } // read logs List<String> logs; try { logs = operationLog.readOperationLog(isFetchFirst(orientation), maxRows); } catch (SQLException e) { throw new HiveSQLException(e.getMessage(), e.getCause()); } // convert logs to RowSet for (String log : logs) { rowSet.addRow(new String[] { log }); } return rowSet; }
@Override public RowSet fetchResults(OperationHandle opHandle, FetchOrientation orientation, long maxRows, FetchType fetchType) throws HiveSQLException { try { TFetchResultsReq req = new TFetchResultsReq(); req.setOperationHandle(opHandle.toTOperationHandle()); req.setOrientation(orientation.toTFetchOrientation()); req.setMaxRows(maxRows); req.setFetchType(fetchType.toTFetchType()); TFetchResultsResp resp = cliService.FetchResults(req); checkStatus(resp.getStatus()); return RowSetFactory.create(resp.getResults(), opHandle.getProtocolVersion()); } catch (HiveSQLException e) { throw e; } catch (Exception e) { throw new HiveSQLException(e); } }
protected GetSchemasOperation(HiveSession parentSession, String catalogName, String schemaName) { super(parentSession, OperationType.GET_SCHEMAS); this.catalogName = catalogName; this.schemaName = schemaName; this.rowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion(), false); }
public GetFunctionsOperation(HiveSession parentSession, String catalogName, String schemaName, String functionName) { super(parentSession, OperationType.GET_FUNCTIONS); this.catalogName = catalogName; this.schemaName = schemaName; this.functionName = functionName; this.rowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion(), false); }
protected GetColumnsOperation(HiveSession parentSession, String catalogName, String schemaName, String tableName, String columnName) { super(parentSession, OperationType.GET_COLUMNS); this.catalogName = catalogName; this.schemaName = schemaName; this.tableName = tableName; this.columnName = columnName; this.rowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion()); }
protected GetSchemasOperation(HiveSession parentSession, String catalogName, String schemaName) { super(parentSession, OperationType.GET_SCHEMAS); this.catalogName = catalogName; this.schemaName = schemaName; this.rowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion()); }
public GetCrossReferenceOperation(HiveSession parentSession, String parentCatalogName, String parentSchemaName, String parentTableName, String foreignCatalog, String foreignSchema, String foreignTable) { super(parentSession, OperationType.GET_FUNCTIONS); this.parentCatalogName = parentCatalogName; this.parentSchemaName = parentSchemaName; this.parentTableName = parentTableName; this.foreignCatalogName = foreignCatalog; this.foreignSchemaName = foreignSchema; this.foreignTableName = foreignTable; this.rowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion(), false); }