protected Path getStagingPathRoot(ConnectorOutputTableHandle outputTableHandle) { HiveOutputTableHandle handle = (HiveOutputTableHandle) outputTableHandle; return getLocationService() .getQueryWriteInfo(handle.getLocationHandle()) .getWritePath(); }
.collect(toList()); WriteInfo writeInfo = locationService.getQueryWriteInfo(handle.getLocationHandle()); Table table = buildTableObject( session.getQueryId(),
database, tableName.getTableName(), locationService.getTableWriteInfo(((HiveOutputTableHandle) outputHandle).getLocationHandle()).getTargetPath().toString());
private void rollbackCreateTable(ConnectorOutputTableHandle tableHandle) { HiveOutputTableHandle handle = checkType(tableHandle, HiveOutputTableHandle.class, "tableHandle"); cleanupTempDirectory(locationService.writePathRoot(handle.getLocationHandle()).get().toString(), handle.getFilePrefix(), "create table"); // Note: there is no need to cleanup the target directory as it will only be written // to during the commit call and the commit call cleans up after failures. }
protected Set<String> listAllDataFiles(ConnectorOutputTableHandle tableHandle) throws IOException { HiveOutputTableHandle hiveOutputTableHandle = (HiveOutputTableHandle) tableHandle; Path writePath = new Path(getLocationService(hiveOutputTableHandle.getSchemaName()).writePathRoot(hiveOutputTableHandle.getLocationHandle()).get().toString()); return listAllDataFiles(writePath); }
protected Path getStagingPathRoot(ConnectorOutputTableHandle outputTableHandle) { HiveOutputTableHandle handle = (HiveOutputTableHandle) outputTableHandle; return getLocationService() .getQueryWriteInfo(handle.getLocationHandle()) .getWritePath(); }
.collect(toList()); Path targetPath = locationService.targetPathRoot(handle.getLocationHandle()); Path writePath = locationService.writePathRoot(handle.getLocationHandle()).get();
metastoreClient.updateTableLocation(database, tableName.getTableName(), locationService.writePath(outputHandle.getLocationHandle(), Optional.empty()).get().toString());
database, tableName.getTableName(), locationService.getTableWriteInfo(((HiveOutputTableHandle) outputHandle).getLocationHandle()).getTargetPath().toString());