有没有办法在Pig脚本中使用这种语法?
命令:
/* some pig latin code here */
mv /user/test/folder_pattern* /path/to/move
/* some pig latin code here */
错误:
[main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 2997: Encountered IOException. File or directory /user/test/folder_pattern* does not exist.
当我将完整路径指向带有'*'的文件夹时,它将起作用。
我怎样才能通过hdfs fs或bash中的模式来制作mv,cp,rm文件?
最佳答案
您可以尝试使用“sh”从grunt shell和pig脚本中运行shell命令。
语法:-sh子命令subcommand_parameters
对于您提供的代码,它看起来像这样-
/* some pig latin code here */
sh mv /user/test/folder_pattern* /path/to/move
/* some pig latin code here */
希望这可以帮助 !!!
关于bash - PIG-如何将Shell命令用于模式文件/文件夹名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45187765/