Hi all I recently rewrote our SOLR 4.8 dataimport to read from a set of denormalised DB tables, in an attempt to increase full indexing speed. When I tried it out however, indexing broke telling me that "java.lang.Long cannot be cast to java.lang.Integer" (full stack below, with the document elided). From googling, this tends to be some field that is being selected out as a long, where it should probably be cast as a string.
Unfortunately, our documents have some 400+ fields and over 100 entities; is there another way to determine which field could not be cast from Long to Integer other than disabling each integer field in turn? Cheers Tom Exception while processing: variant document : SolrInputDocument(fields: [(removed)]): org.apache.solr.handler.dataimport.DataImportHandlerException: java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer at org.apache.solr.handler.dataimport.DataImportHandlerException.wrapAndThrow(DataImportHandlerException.java:63) at org.apache.solr.handler.dataimport.EntityProcessorWrapper.nextRow(EntityProcessorWrapper.java:246) at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:477) at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:503) at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:503) at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:503) at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:416) at org.apache.solr.handler.dataimport.DocBuilder.doFullDump(DocBuilder.java:331) at org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java:239) at org.apache.solr.handler.dataimport.DataImporter.doFullImport(DataImporter.java:411) at org.apache.solr.handler.dataimport.DataImporter.runCmd(DataImporter.java:483) at org.apache.solr.handler.dataimport.DataImporter$1.run(DataImporter.java:464) Caused by: java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer at java.lang.Integer.compareTo(Integer.java:52) at java.util.TreeMap.getEntry(TreeMap.java:346) at java.util.TreeMap.get(TreeMap.java:273) at org.apache.solr.handler.dataimport.SortedMapBackedCache.iterator(SortedMapBackedCache.java:147) at org.apache.solr.handler.dataimport.DIHCacheSupport.getIdCacheData(DIHCacheSupport.java:179) at org.apache.solr.handler.dataimport.DIHCacheSupport.getCacheData(DIHCacheSupport.java:145) at org.apache.solr.handler.dataimport.EntityProcessorBase.getNext(EntityProcessorBase.java:129) at org.apache.solr.handler.dataimport.SqlEntityProcessor.nextRow(SqlEntityProcessor.java:75) at org.apache.solr.handler.dataimport.EntityProcessorWrapper.nextRow(EntityProcessorWrapper.java:243) ... 10 more