private String fetchFilesNotInLocalFilesystem(String cmd) { SessionState ss = SessionState.get(); String progName = getScriptProgName(cmd); if (!ResourceDownloader.isFileUri(progName)) { String filePath = ss.add_resource(ResourceType.FILE, progName, true); Path p = new Path(filePath); String fileName = p.getName(); String scriptArgs = getScriptArgs(cmd); String finalCmd = fileName + scriptArgs; return finalCmd; } return cmd; }
private String fetchFilesNotInLocalFilesystem(String cmd) { SessionState ss = SessionState.get(); String progName = getScriptProgName(cmd); if (!ResourceDownloader.isFileUri(progName)) { String filePath = ss.add_resource(ResourceType.FILE, progName, true); Path p = new Path(filePath); String fileName = p.getName(); String scriptArgs = getScriptArgs(cmd); String finalCmd = fileName + scriptArgs; return finalCmd; } return cmd; }
private void checkLocalFunctionResources(Hive db, List<ResourceUri> resources) throws HiveException { // If this is a non-local warehouse, then adding resources from the local filesystem // may mean that other clients will not be able to access the resources. // So disallow resources from local filesystem in this case. if (resources != null && resources.size() > 0) { try { String localFsScheme = FileSystem.getLocal(db.getConf()).getUri().getScheme(); String configuredFsScheme = FileSystem.get(db.getConf()).getUri().getScheme(); if (configuredFsScheme.equals(localFsScheme)) { // Configured warehouse FS is local, don't need to bother checking. return; } for (ResourceUri res : resources) { String resUri = res.getUri(); if (ResourceDownloader.isFileUri(resUri)) { throw new HiveException("Hive warehouse is non-local, but " + res.getUri() + " specifies file on local filesystem. " + "Resources on non-local warehouse should specify a non-local scheme/path"); } } } catch (HiveException e) { throw e; } catch (Exception e) { LOG.error("Exception caught in checkLocalFunctionResources", e); throw new HiveException(e); } } }
private void checkLocalFunctionResources(Hive db, List<ResourceUri> resources) throws HiveException { // If this is a non-local warehouse, then adding resources from the local filesystem // may mean that other clients will not be able to access the resources. // So disallow resources from local filesystem in this case. if (resources != null && resources.size() > 0) { try { String localFsScheme = FileSystem.getLocal(db.getConf()).getUri().getScheme(); String configuredFsScheme = FileSystem.get(db.getConf()).getUri().getScheme(); if (configuredFsScheme.equals(localFsScheme)) { // Configured warehouse FS is local, don't need to bother checking. return; } for (ResourceUri res : resources) { String resUri = res.getUri(); if (ResourceDownloader.isFileUri(resUri)) { throw new HiveException("Hive warehouse is non-local, but " + res.getUri() + " specifies file on local filesystem. " + "Resources on non-local warehouse should specify a non-local scheme/path"); } } } catch (HiveException e) { throw e; } catch (Exception e) { LOG.error("Exception caught in checkLocalFunctionResources", e); throw new HiveException(e); } } }
String scriptCmd = getScriptProgName(stripQuotes(trfm.getChild(execPos).getText())); getInputs().add(new ReadEntity(new Path(scriptCmd), ResourceDownloader.isFileUri(scriptCmd)));
String scriptCmd = getScriptProgName(stripQuotes(trfm.getChild(execPos).getText())); getInputs().add(new ReadEntity(new Path(scriptCmd), ResourceDownloader.isFileUri(scriptCmd)));