【问题标题】:Pentaho Kettle (Data Intergration) MongoDB AggregationPentaho Kettle(数据集成)MongoDB 聚合
【发布时间】:2014-12-04 17:10:49
【问题描述】:

我正在使用kettle v5.2,它支持MongoDB中的聚合管道 使用 MongoDB 输入时,查询适用于小数据集,但我需要使用选项 allowDiskUse 到查询无法弄清楚如何在 pentaho 中添加它 虽然我在 mongo shell 中测试了这个选项并且它按预期工作

http://docs.mongodb.org/manual/reference/method/db.collection.aggregate/

http://wiki.pentaho.com/display/EAI/MongoDB+Input#MongoDBInput-queryaggpipeline

这行得通

[ {$unwind: "$friends"}, {$group : { '_id' : '$friends.id', name: {'$first': '$friends.name'} ,count: {$sum:1} } } ,{$sort: {count: -1}}, {$limit: 100} ]

这不是

[ {$unwind: "$friends"}, {$group : { '_id' : '$friends.id', name: {'$first': '$friends.name'} ,count: {$sum:1} } } ,{$sort: {count: -1}}, {$limit: 100} ] , {allowDiskUse: true}

【问题讨论】:

    标签: mongodb pentaho aggregation-framework


    【解决方案1】:

    如果你查看class who parse the pipeline,你可以上去看到 Pentaho 使用 MongoDB class java DBCollection with a deprecated function 而不是这个聚合:

    public Cursor aggregate(List<DBObject> pipeline,
                            AggregationOptions options)
    

    很遗憾,Pentaho Mongo Input 中没有可用的选项。

    【讨论】:

      【解决方案2】:

      您是否尝试在 MongoDB 输入步骤的“查询”选项卡中选中“查询是聚合管道”框?

      【讨论】:

        【解决方案3】:

        选中“查询是聚合管道”选项

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2018-07-03
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2020-10-30
          相关资源
          最近更新 更多