Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » jdbc emc problem(ETL transformation problem related to a model from a Mysql db by the jdbc emc)
jdbc emc problem [message #1768500] Wed, 19 July 2017 13:51 Go to next message
Amir Kanan is currently offline Amir KananFriend
Messages: 22
Registered: July 2017
Junior Member
Hi,
I'm using the Jdbc emc code form epsilonlab in order to manage an input from a MySQL db, for an ETL trasformation.

This is the code that I put in MysqlModel.java in order to manage the input model form the MySQL db:

PostgresqlModel model = new PostgresqlModel();
model.setServer("localhost");
model.setDatabase("MyDB");
model.setUsername("user");
model.setPassword("pass");
model.setPort(4040);
model.setName("test");
model.load();

EtlModule module = new EtlModule();
module.parse("rule R1 transform s : MyDB!Table1 to t : Sequence { System.out.println('Rule psql: ' + s.column1); }");
module.getContext().getModelRepository().addModel(model);
module.execute();

The above code aims to retrieve the data for --SELECT column1 FROM Table1 -- statement. However, I got the following error:

Exception in thread "main" Type 'MyDB!Table1' not found
at (unknown@1:22-1:36)
at (unknown@1:22-1:36)
at (unknown@1:0-1:103)

org.eclipse.epsilon.eol.dom.TypeExpression.execute(TypeExpression.java:65)

...
...

Any idea about this issue ?

Moreover, My final goal is creating an in-memory model (an EMF model) as a source model for my transformation.

Do I need to have meta-model for the source model (from MySQL) ?

If YES - How can I make it consistent with the source model that I get from MySQL?

Many thanks,
Amir

Re: jdbc emc problem [message #1768544 is a reply to message #1768500] Wed, 19 July 2017 19:38 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 1520
Registered: July 2009
Location: York, UK
Senior Member

Hi Amir,

Could you please provide a minimal example [1] we can use to reproduce this?

Cheers,
Dimitris

[1] https://www.eclipse.org/epsilon/doc/articles/minimal-examples/
Re: jdbc emc problem [message #1768557 is a reply to message #1768544] Thu, 20 July 2017 02:48 Go to previous messageGo to next message
Amir Kanan is currently offline Amir KananFriend
Messages: 22
Registered: July 2017
Junior Member
Hi Dimitris,

Sure, I have changed the code to work with a PostgresQL DB and attached the minimal example for your kind review. I have also attached the backup of a test DB if needed.

By the way, I am using the Epsilon Core 1.4.0.2 and you only need to run then PostgresqlModel.Java file to reproduce the error.

Many thanks for your time and support,
Amir
Re: jdbc emc problem [message #1769173 is a reply to message #1768557] Thu, 27 July 2017 09:00 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 1520
Registered: July 2009
Location: York, UK
Senior Member

Hi Amir,

Your code is fine but JdbcModel needs a bit more work before it can support a Postgres extension. Could you please create an issue under https://github.com/epsilonlabs/emc-jdbc?

Cheers,
Dimitris
Re: jdbc emc problem [message #1769219 is a reply to message #1769173] Fri, 28 July 2017 00:42 Go to previous messageGo to next message
Amir Kanan is currently offline Amir KananFriend
Messages: 22
Registered: July 2017
Junior Member
Hi Dimitris,

That's right. Therefore, I would like to make it support a Postgres extension.
How can I contribute in an open source project like this ?
Should I fork the project ?

Many thanks,
Amir

[Updated on: Fri, 28 July 2017 01:22]

Report message to a moderator

Re: jdbc emc problem [message #1769240 is a reply to message #1769219] Fri, 28 July 2017 07:11 Go to previous message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 1520
Registered: July 2009
Location: York, UK
Senior Member

Hi Amir,

Yes, contributions should come in the form of pull requests from your fork.

Cheers,
Dimitris
Previous Topic:changing the model locally
Next Topic:get the address of input
Goto Forum:
  


Current Time: Tue Apr 24 23:25:30 GMT 2018

Powered by FUDForum. Page generated in 0.01975 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software