【发布时间】:2013-05-23 13:54:45
【问题描述】:
我有一个映射到某个目录的配置单元外部表。 该目录包含多个文件。
我想在有用户“abc”的地方运行查询,例如查找文件名
select file_name , usr from usrs_tables where usr = "abc"
当然数据里面不包含文件名。
在 MapReduce 中我可以做到这一点
FileSplit fileSplit = (FileSplit)context.getInputSplit();
String filename = fileSplit.getPath().getName();
System.out.println("File name "+filename);
System.out.println("Directory and File name"+fileSplit.getPath().toString());
如何在 Hive 中做到这一点?
【问题讨论】: