Ask Your Question
1

Executing PostgreSQL Function

asked 2019-06-12 11:33:55 -0500

Chris Purcell gravatar image

updated 2019-06-12 19:37:52 -0500

metadaddy gravatar image

Hello,

My PostgreSQL database defines functions that are used to ingest data. These functions have a single argument of type json representing the data to be ingested. Simply inserting rows into various database tables isn't an option at this time. The data must be ingested via these functions.

What I am struggling with is getting the output of my Field Type Converter, json, to be used as an argument to a PostgreSQL function, i.e.

select insert_data('[]'::json);

...where '[]' is the output of my Field Type Converter.

Any help is appreciated.

-Chris

edit retag flag offensive close merge delete

Comments

Can you edit your post to include a screenshot of your pipeline so far? In particular, which destination are you using to access PostgreSQL?

metadaddy gravatar imagemetadaddy ( 2019-06-12 17:08:08 -0500 )edit

I don't have a destination that lands my data in Postgres. My Origin is MongoDB. I have several processors that drop, rename, and convert fields. A local file is the present destination. I need help calling a function in PostgreSQL passing JSON as an argument instead of writing to the file.

Chris Purcell gravatar imageChris Purcell ( 2019-06-12 19:07:29 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-06-12 19:37:14 -0500

metadaddy gravatar image

You should look at using JDBC Query Executor to call your PostgreSQL function (you can use an executor in place of a destination). The SQL Query field would contain something like:

SELECT insert_data('${record:value('/path/to/field')}'::json);
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-06-12 11:33:55 -0500

Seen: 31 times

Last updated: Jun 12