Have you tried select <concatenated fields> as id, name, age ?

On Thu, Apr 16, 2015 at 3:34 PM, Vishal Swaroop <vishal....@gmail.com>
wrote:

> Just wondering if there is a way to generate uuid/ id in data-config
> without using combination of fields in query...
>
> data-config.xml
> <?xml version="1.0" encoding="UTF-8" ?>
> <dataConfig>
> <dataSource
>   batchSize="2000"
>   name="test"
>   type="JdbcDataSource"
>   driver="oracle.jdbc.OracleDriver"
>   url="jdbc:oracle:thin:@ldap:...."
>   user="myUser"
>   password="pwd"/>
> <document>
> <entity name="test_entity"
>   docRoot="true"
>   dataSource="test"
>   query="select name, age from test_user">
> </entity>
> </document>
> </dataConfig>
>
> On Thu, Apr 16, 2015 at 3:18 PM, Vishal Swaroop <vishal....@gmail.com>
> wrote:
>
> > Thanks Kaushik & Erick..
> >
> > Though I can populate uuid by using combination of fields but need to
> > change the type to "string" else it throws "Invalid UUID String"
> > <field name="uuid" type="string" indexed="true" stored="true"
> > required="true" multiValued="false"/>
> >
> > a) I will have ~80 millions records and wondering if performance might be
> > issue
> > b) So, during update I can still use combination of fields i.e. uuid ?
> >
> > On Thu, Apr 16, 2015 at 2:44 PM, Erick Erickson <erickerick...@gmail.com
> >
> > wrote:
> >
> >> This seems relevant:
> >>
> >>
> >>
> http://stackoverflow.com/questions/16914324/solr-4-missing-required-field-uuid
> >>
> >> Best,
> >> Erick
> >>
> >> On Thu, Apr 16, 2015 at 11:38 AM, Kaushik <kaushika...@gmail.com>
> wrote:
> >> > You seem to have defined the field, but not populating it in the
> query.
> >> Use
> >> > a combination of fields to come up with a unique id that can be
> >> assigned to
> >> > uuid. Does that make sense?
> >> >
> >> > Kaushik
> >> >
> >> > On Thu, Apr 16, 2015 at 2:25 PM, Vishal Swaroop <vishal....@gmail.com
> >
> >> > wrote:
> >> >
> >> >> How to generate uuid/ id (maybe in data-config.xml...) for table
> which
> >> do
> >> >> not have any primary key.
> >> >>
> >> >> Scenario :
> >> >> Using DIH I need to import data from database but table does not have
> >> any
> >> >> primary key
> >> >> I do have uuid defined in schema.xml and is
> >> >> <field name="uuid" type="uuid" indexed="true" stored="true"
> >> required="true"
> >> >> multiValued="false"/>
> >> >> <uniqueKey>uuid</uniqueKey>
> >> >>
> >> >> data-config.xml
> >> >> <?xml version="1.0" encoding="UTF-8" ?>
> >> >> <dataConfig>
> >> >> <dataSource
> >> >>   batchSize="2000"
> >> >>   name="test"
> >> >>   type="JdbcDataSource"
> >> >>   driver="oracle.jdbc.OracleDriver"
> >> >>   url="jdbc:oracle:thin:@ldap:...."
> >> >>   user="myUser"
> >> >>   password="pwd"/>
> >> >> <document>
> >> >> <entity name="test_entity"
> >> >>   docRoot="true"
> >> >>   dataSource="test"
> >> >>   query="select name, age from test_user">
> >> >> </entity>
> >> >> </document>
> >> >> </dataConfig>
> >> >>
> >> >> Error : Document is missing mandatory uniqueKey field: uuid
> >> >>
> >>
> >
> >
>

Reply via email to