Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Parse with morphline and store to Solr preserving field type

Parse with morphline and store to Solr preserving field type

Expert Contributor

Hi, I'm still trying to store data to Solr using morphline. I've met another problem.

My field declared as "long" in SOLR schema.xml

 

<field name="applicationId" type="string" indexed="true" stored="true" required="false" multiValued="false" />

 

And I do get an exception while flume Solr sink tries to send data&colon;

 

Unable to deliver event. Exception follows. org.apache.flume.EventDeliveryException: Failed to send events at org.apache.flume.sink.solr.morphline.MorphlineSink.process(MorphlineSink.java:187) at org.apache.flume.sink.DefaultSinkProcessor.process(DefaultSinkProcessor.java:68) at org.apache.flume.SinkRunner$PollingRunner.run(SinkRunner.java:147) at java.lang.Thread.run(Thread.java:662) Caused by: org.apache.solr.client.solrj.impl.HttpSolrServer$RemoteSolrException: ERROR: [doc=8d56da4d-f4fd-4e92-8a49-65e8ec2a64e6] Error adding field 'applicationId'='4000050438' msg=For input string: "4000050438" at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:518) at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:207) at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:202) at org.apache.solr.client.solrj.impl.LBHttpSolrServer.doRequest(LBHttpSolrServer.java:312) at org.apache.solr.client.solrj.impl.LBHttpSolrServer.request(LBHttpSolrServer.java:273) at org.apache.solr.client.solrj.impl.CloudSolrServer.request(CloudSolrServer.java:310) at org.apache.solr.client.solrj.request.AbstractUpdateRequest.process(AbstractUpdateRequest.java:117) at org.apache.solr.client.solrj.SolrServer.add(SolrServer.java:68) at org.apache.solr.client.solrj.SolrServer.add(SolrServer.java:54) at com.cloudera.cdk.morphline.solr.SolrServerDocumentLoader.loadBatch(SolrServerDocumentLoader.java:90) at com.cloudera.cdk.morphline.solr.SolrServerDocumentLoader.commitTransaction(SolrServerDocumentLoader.java:78) at com.cloudera.cdk.morphline.solr.LoadSolrBuilder$LoadSolr.doNotify(LoadSolrBuilder.java:94) at com.cloudera.cdk.morphline.base.AbstractCommand.notify(AbstractCommand.java:135) at com.cloudera.cdk.morphline.base.Connector.notify(Connector.java:54) at com.cloudera.cdk.morphline.base.AbstractCommand.doNotify(AbstractCommand.java:150) at com.cloudera.cdk.morphline.base.AbstractCommand.notify(AbstractCommand.java:135) at com.cloudera.cdk.morphline.base.Connector.notify(Connector.java:54) at com.cloudera.cdk.morphline.base.AbstractCommand.doNotify(AbstractCommand.java:150) at com.cloudera.cdk.morphline.base.AbstractCommand.notify(AbstractCommand.java:135) at com.cloudera.cdk.morphline.base.Connector.notify(Connector.java:54) at com.cloudera.cdk.morphline.base.AbstractCommand.doNotify(AbstractCommand.java:150) at com.cloudera.cdk.morphline.base.AbstractCommand.notify(AbstractCommand.java:135) at com.cloudera.cdk.morphline.base.AbstractCommand.doNotify(AbstractCommand.java:150) at com.cloudera.cdk.morphline.base.AbstractCommand.notify(AbstractCommand.java:135) at com.cloudera.cdk.morphline.base.Notifications.notify(Notifications.java:57) at com.cloudera.cdk.morphline.base.Notifications.notifyCommitTransaction(Notifications.java:39) at org.apache.flume.sink.solr.morphline.MorphlineHandlerImpl.commitTransaction(MorphlineHandlerImpl.java:148) at org.apache.flume.sink.solr.morphline.MorphlineSink.process(MorphlineSink.java:158) ... 3 more

 

Are there any chances to tell MorphlineSink that applicationId has type long?

Don't have an account?
Coming from Hortonworks? Activate your account here