配置单元:从配置单元脚本调用shell命令会引发错误



我有一个配置单元脚本,它执行一些DML和删除一些表,并执行一些shell删除文件。我正在使用hive -f myscript.hql启动脚本
在脚本中,我需要从本地目录中删除文件。我尝试使用!rm /home/myuser/temp_table_id_*;抛出错误:

rm: cannot remove ‘/home/myuser/temp_table_id_*’: No such file or directory
Command failed with exit code = 1

*不工作
这是一个示例脚本:

--My HQL File--
INSERT OVERWRITE ....
...
..;
DROP TABLE TEMP_TABLE;
!hadoop fs -rm -r /user/myuser/ext_tables/temp_table;
!rm /home/myuser/temp_table_id_*;
CREATE TABLE NEW_TABLE(
....
...
;

我正在使用以下命令调用脚本:hive -f myscript.hql脚本运行良好,直到找到一行:!rm /home/myuser/temp_table_id_*;,其中正在咒骂*
当我提供单独的文件名而不是*时,它就起作用了
但我想用*

尝试

dfs -rm /home/myuser/temp_table_id_*;

在HQL中。通配符与hive-dfs命令配合使用效果良好。

从配置单元文档

dfs <dfs command> -Executes a dfs command from the Hive shell.

最新更新