Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

night.fall.ff06_179503 avatar image
night.fall.ff06_179503 asked ·

about run multiple query in DSE Graph loader

Hello experts

I'm having a requirement to put together data from our Oracle DB to DSE Graph.

I ran into a problem wjere there is one vertex data requires to create and select a new table. I tried to put 2 query in but it didnt work.

db.execute() return error:

groovy.lang.MissingMethodException: No signature of method: com.datastax.dsegraphloader.api.Database$DatabaseBuilder.execute() is applicable for argument types: (java.lang.String) values:


CREATE TABLE NEWTABLE AS

SELECT randomUUID()AS request1,

FROM OLDTABLE;


config create_schema: true, load_new: true, load_vertex_threads: 3


db = Database.connection('jdbc:oracle:thin:@IP:1521:SID').user('').password('').Oracle()


nkInput = db.query "

CREATE TABLE NEWTABLE AS SELECT randomUUID() FROM OLDTABLE;

select * from NEWTABLE";"


load(nkInput ).asVertices {

label ""

key : ""

}


Please suggest.

Thanks in advance

graphdse graphgroovy
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

night.fall.ff06_179503 avatar image
night.fall.ff06_179503 answered ·

Hi there


Yes, I did try putting in one line but didn't work too.

The workaround here is to create a temp table on and run a single query from Graphloader to call it.

There are drawbacks, of course but it works for our current data size.


However, I noticed another issue is that the graphloader can't map properties with capital letter (with the exeption of partition and clutering key).

This issue happens only when calling a query from another DB. Importing from CSV is fine.

As you can see below, when i'm trying to map data for the "Name" property, it created another property "name", and so on with others...

Parition key "personId" is not affected since it got mapped in:


load(personInfoData).asVertices 
{    label "personInfo"    
     key personId: "personId" }


personInfo

ID Properties

Name Type
personId Uuid

Properties

Name Text Single
name Text Single













Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

ulises avatar image
ulises answered ·

Hi @night.fall.ff06_179503


Apologies for the late reply.


Have you tried putting the SQL statement all in one line?


I'd try to rule out that this is a newline/quoting issue first.

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.