Giter Site home page Giter Site logo

Comments (6)

jlolling avatar jlolling commented on June 8, 2024

Hi blag

yeas of course! I know such scenarios very well. We had such scenarios with database selects and when we had calculated the necessary queries it was terrible.
Thats because I have introduced the foreign key assignment to the tJSONDocOutput.
The idea is to read every level only once and not per parent node and add the current read object just to the right parent object.
The first flow have to got over the first level nodes.
Mark the column which is the key s key in the schema.
The components provides a list of the keys as SQL-comma separated list.
In your scenario you do not need this.
You have to have in your files for the second and following levels columns which references to the parent level.
You choose such this column per level and tell the component to use it a foreign key relation.
tug_20180215_gvl_core_webservices
This is a screenshot of such a job which fetches the data level by level.
Here the setting for one of the second level components:
talend_di_service_job_opdata_getter_1_foreign_key

from talendcomp_tjsondoc.

blag001 avatar blag001 commented on June 8, 2024

I'm definitely going mad on this one...
The FK mode can't find my key and blow-up every time.

I think the point is really about making a composite key that tell the region1 in paysA>region1>depA1 is not the same than paysB>region1>depB1

The job
image
the error
image

Create Doc
image

csv schema of pays
image

The first node
image

2nd CSV
image

region node
image

last CSV
image

And the belonging docOutput
image


If I disable the 3rd CSV/output (departments level), I'll have 1st and 2nd level as I want, but the 3rd and deeper level either go on error on CODCOURT2=00 or use CODCOURT2 as a unique key and put everything in the last occurrence of the key (aka all my default departments for the world end up in the Zimbabwe default region...)

image

from talendcomp_tjsondoc.

jlolling avatar jlolling commented on June 8, 2024

I agree with you, the limitation to only one key field is not comfortable. Mostly we found easy ways to build one combined key. I use the component tHashRow to do that (the result of a cooperation with some friends): https://github.com/jlolling/talendcomp_tHashRow
We have developed this component for the purpose of building keys for a Data Vault.

from talendcomp_tjsondoc.

jlolling avatar jlolling commented on June 8, 2024

I you have further more problems with it we can do a skype session and I take a look at your jobs and we fix everything together.

from talendcomp_tjsondoc.

blag001 avatar blag001 commented on June 8, 2024

Thanks again Jan,
As I've got your confirmation tJSONDoc was not able to handle native composite key, I was able to try other things and find how to do it.

I'm working on a Plateform version, so I used tGenKey to make a composite key as a single column instead of your tHashRow. My fear was having to ship this pk_key in the generated JSON dump, but it even seem to work without!

I'm now able to make my 2h30 job in less than 120s, quite a nice change~

I'll add some screen-shot tomorrow.

from talendcomp_tjsondoc.

jlolling avatar jlolling commented on June 8, 2024

I know very well whats your pain. We have created web services with these components and those web services have to provide a multi-object response, e.g. 1000 products at once in one response.
It was terrible - we had minutes instead of seconds as response time. With the foreign key solution we was able to reduce the response time from 2-3 minutes to 1-2 seconds.

I have thought about combined keys but this what increase the complexity of the component to a not maintainable level.

from talendcomp_tjsondoc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.