Thanks Luca - that worked (I had to change "name" to "fieldName" though).

On a related note; is there a more direct way to rename a field through SQL 
API (when no property exists)?

I was thinking something like

UPDATE <class> RENAME <field> <newFieldName>

Or even (similar to the ETL flow)

UPDATE <class> SET <field>=<some way to get value of otherField for matched 
instance>
UPDATE <class> REMOVE <otherField>

At present I did it by creating a property, altering the property name and 
then dropping the property, but that felt a little wrong.

cheers,


Martin


On Wednesday, 7 January 2015 22:26:28 UTC, Lvc@ wrote:
>
> Hi Martin,
> You can do 2 field: set and remove. Example to rename the field b -> a:
>
> { "field": { "name": "a": "expression": "b"  } },
> { "field": { "name": "b": "operation": "remove"  } }
>
> Lvc@
>
>
> Lvc@
>
>
> On 7 January 2015 at 18:58, Martin Pengelly-Phillips <[email protected] 
> <javascript:>> wrote:
>
>> Hi there,
>>
>> Been looking at 
>> http://www.orientechnologies.com/docs/last/orientdb-etl.wiki/Import-from-DBMS.html
>>  
>> recently and wondered if it is possible to rename a field as part of the 
>> process?
>>
>> Tried using "select as" but it didn't make a difference to the resulting 
>> property name.
>>
>> {
>>     "extractor": {
>>         "jdbc": {
>>             ...
>>             "query": "SELECT taskid as id, parent_id FROM task"
>>         }
>>     },
>>     "transformers": [
>>         {"vertex": {"class": "Context"}},
>>         {
>>             "edge": {
>>                 "class": "parent",
>>                 "joinFieldName": "parent_id",
>>                 "lookup": "Context.id"
>>             }
>>         }
>>     ],
>>     ...
>> }
>>
>> Perhaps there is a transformer that can be used?
>>
>> cheers,
>>
>>
>> Martin
>>
>> -- 
>>
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "OrientDB" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to