我正在尝试对sql查询建模,比如select distinct(col1)from table where col2=value2 in map reduce。我使用的逻辑是,每个Map器将检查where子句,如果找到匹配项,它将发出where子句值作为键,col1作为值。基于默认的散列函数,所有的输出都将和where子句中的key used值放在同一个reducer中。在reducer中,我可以排除重复并发出不同的值。这是正确的方法吗?
这是实现这一目标的正确方法吗?
注意:此查询的数据在csv文件中。
1条答案
按热度按时间30byixjq1#