English 中文(简体)
RavenDB 指数错误
原标题:RavenDB indexing errors

I m 刚刚从Raven开始,指数I ve制造的指数始终没有指数。 我发现拉文服务器上有许多错误,如:

{
    Index: "HomeBlurb/IncludeTotalCosts",
    Error: "Cannot implicitly convert type  double  to  int . An explicit conversion exists (are you missing a cast?)",
    Timestamp: "2012-01-14T15:40:40.8943226Z",
    Document: null
}

指数一的制定就是:

public class HomeBlurb_IncludeTotalCosts : AbstractIndexCreationTask<MPDocument, HomeBlurb_IncludeTotalCosts.ReduceResult>
{
    public class ReduceResult 
    {
        public string Name { get; set; }
        public string Constituency { get; set; }
        public decimal AmountPaid { get; set; }
    }

    public HomeBlurb_IncludeTotalCosts()
    {
        Map = mps => from mp in mps
                            from expense in mp.Expenses
                            select new
                            {
                                mp.Name,
                                mp.Constituency,
                                AmountPaid = expense.AmountPaid ?? 0M
                            };

        Reduce = results => from result in results
                            group result by new { result.Name, result.Constituency } 
                            into g
                            select new
                            {
                                g.Key.Name,
                                g.Key.Constituency,
                                AmountPaid = g.Sum(x => x.AmountPaid)
                            };
    }
}

该指数由Raven(通过Ravenudio)创建,看来是罚款。

我真心要说的是,Im使用的文件并不包含任何双重或ts,而我所储存的唯一数字是小错。

这个问题可能是什么?

最佳回答

问题在于:

              AmountPaid = g.Sum(x => x.AmountPaid)

改为:

              AmountPaid = g.Sum(x => (double)x.AmountPaid)
问题回答

暂无回答




相关问题
Error in Hadoop MapReduce

When I run a mapreduce program using Hadoop, I get the following error. 10/01/18 10:52:48 INFO mapred.JobClient: Task Id : attempt_201001181020_0002_m_000014_0, Status : FAILED java.io.IOException:...

Error in using Hadoop MapReduce in Eclipse

When I executed a MapReduce program in Eclipse using Hadoop, I got the below error. It has to be some change in path, but I m not able to figure it out. Any idea? 16:35:39 INFO mapred.JobClient: Task ...

Is MapReduce right for me?

I am working on a project that deals with analyzing a very large amount of data, so I discovered MapReduce fairly recently, and before i dive any further into it, i would like to make sure my ...

Hadoop or Hadoop Streaming for MapReduce on AWS

I m about to start a mapreduce project which will run on AWS and I am presented with a choice, to either use Java or C++. I understand that writing the project in Java would make more functionality ...

What default reducers are available in Elastic MapReduce?

I hope I m asking this in the right way. I m learning my way around Elastic MapReduce and I ve seen numerous references to the "Aggregate" reducer that can be used with "Streaming" job flows. In ...

Displaying access log analysis

I m doing some work to analyse the access logs from a Catalyst web application. The data is from the load balancers in front of the web farm and totals about 35Gb per day. It s stored in a Hadoop HDFS ...

热门标签