On 3/13/2014 12:54 PM, cpk wrote:
We're seeing the same behavior with Solr 4.6.0 and 4.7. DataInputHandler
loads documents, but the updates to the replica fail because of the limited
support for the BigDecimal type in SolrCloud.
We've successfully worked around the issue by setting convertType=true in
the DIH config. This tells DIH to convert the BigDecimal to the supported
Solr type (float, double, etc) defined in your schema.xml for the field
before submitting to Solr.
In my opinion, this is more of a issue with DIH, than SolrCloud. DIH
shouldn't try to submit the BigDecimal type, if its not well supported by
Solr. SolrCloud should try to support BigDecimal, but that suggestion has
been pending for a while.
The real problem here is not DIH, but the JDBC driver. The convertType
parameter that you have set is for your JDBC driver. For most people,
these details don't matter, because they are writing Java code
themselves and can adjust according to the peculiarities of a specific
JDBC driver. DIH is a *generic* solution that can only deal with
standard types.
BigDecimal is not a standard java data type. Although it is included in
the standard JVM, it is part of the *math* package, it is not built into
Java.
http://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html
You might wonder why DIH doesn't convert the data. The answer is that
without the programmer explicitly providing code to detect each
nonstandard type, it won't know *HOW* to convert it. Solr and Lucene
can't be expected to support every data type, especially if the data
type is not even available until you import a class.
Thanks,
Shawn