RDBMS to MongoDB using Talend 6.1.2 throwing error - mongodb

I am trying to convert data from ORacle to MongoDB JSON format . But when trying to convert, I am getting following error when writing to JSON field. can anyone help. I have attached the flow and the mapping
Error message
tarting job ora2mongo at 03:14 17/08/2018.
[statistics] connecting to socket on port 4071
[statistics] connected
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
Incorrect number of arguments for type Queue<E>; it cannot be parameterized with arguments <>
Syntax error on token "null", delete this token
Syntax error on token "null", delete this token
Syntax error on token "null", delete this token
queue cannot be resolved or is not a field
queue cannot be resolved to a variable
queue cannot be resolved or is not a field
queue cannot be resolved to a variable
Syntax error, insert "AssignmentOperator Expression" to complete Assignment
Syntax error, insert ";" to complete Statement
The left-hand side of an assignment must be a variable
Syntax error on token "null", invalid ClassType
Syntax error, insert "new ClassType ( )" to complete Expression
Syntax error, insert "AssignmentOperator Expression" to complete Assignment
Syntax error, insert ";" to complete Statement
Syntax error on token "null", invalid ClassType
Syntax error, insert "new ClassType ( )" to complete Expression
at rdbms_to_mongo.ora2mongo_0_1.ora2mongo.tOracleInput_1Process(ora2mongo.java:3156)
[statistics] disconnected
at rdbms_to_mongo.ora2mongo_0_1.ora2mongo.tOracleConnection_1Process(ora2mongo.java:550)
at rdbms_to_mongo.ora2mongo_0_1.ora2mongo.runJobInTOS(ora2mongo.java:5272)
at rdbms_to_mongo.ora2mongo_0_1.ora2mongo.main(ora2mongo.java:5129)
Job ora2mongo ended at 03:14 17/08/2018. [exit code=0]

Related

Redshift Json extract path text

Hi I was using this code to extract data from a column it was working, but I am now getting an error message. Any input is appreciated.
SQL Error [XX000]: ERROR: JSON parsing error
Detail:
error: JSON parsing error
code: 8001
context: invalid json object false
query: 6047879
location: funcs_json.hpp:127
process: query1_117_6047879 [pid=6614]
select json_extract_path_text (info,'device_category') as device_category
from admin.project

Could not able to fetch data in datasource in Tableau Desktop,Throws below error

Unable to complete action
[Hortonworks][HiveODBC] (80) Syntax or semantic analysis error thrown in server while execurint query. Error message from server: Error while compiling statement: FAILED: SemanticException Line 0:-1 Argument type mismatch 'TOK_NULL': The expression after ELSE should have the same type as those after THEN: "date" is expected but "timestamp" is found
Error Code: 9F80FB23
It tells you what the problem is. check your query.
The expression after ELSE should have the same type as those after THEN: "date" is expected but "timestamp" is found

PostgreSQL JDBC execute PL/pgSQL

While trying to run PL/pgSQL via JDBC driver (postgresql-9.4.1211.jre7.jar; using ANT) I get following error: ERROR: syntax error at or near "$"
Is there any way howto fix this via setting JDBC properties or changing the query of PL/pgSQL?
query:
DO $$
BEGIN
CREATE SEQUENCE id_sequence_SEQ OWNED BY id_sequence.id;
EXCEPTION WHEN duplicate_table
THEN
END
$$
LANGUAGE plpgsql;
error:
org.postgresql.util.PSQLException: ERROR: syntax error at or near "$"
Position: 5
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2458)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2158)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:291)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:432)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:358)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:305)
at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:291)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:269)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:265)
I tried executing a DO statement with JDBC and it works just fine.
There must be something weird in your statement. Try and log the statement by setting log_min_error_statement and log_min_messages to error. Execute the statement, then look at the message in the PostgreSQL log file. It should contain the statement that was actually executed. Examine it for weird characters and other strangeness.
Please also note that there is a syntax error in you PL/pgSQL: there must be something between THEN and END. For a no-op, use the statement NULL;.

Postgres sql file insert hanging

I am attempting to insert data from an sql file which is about 1.6GB in size. I used the command:
\i filename.sql
however it had been running for well over ten minutes. Initially when I ran it I got output such as below:
psql:xxx.sql:1102: ERROR: role "xxx" does not exist
psql:xxx.sql:1124: ERROR: relation "xxx" already exists
psql:xxx.sql:1127: ERROR: role "xxx" does not exist
psql:xxx.sql:1138: ERROR: relation "xxx" already exists
psql:xxx.sql:1141: ERROR: role "xxx" does not exist
psql:xxx.sql:1177: ERROR: relation "xxx" already exists
psql:xxx.sql:1180: ERROR: role "xxx" does not exist
psql:xxx.sql:1191: ERROR: relation "xxx" already exists
psql:xxx.sql:1194: ERROR: role "xxx" does not exist
psql:xxx.sql:1223: ERROR: relation "xxx" already exists
psql:xxx.sql:1226: ERROR: role "xxx" does not exist
psql:xxx.sql:1237: ERROR: relation "xxx" already exists
psql:xxx.sql:1240: ERROR: role "xxx" does not exist
This continues until the final output was:
psql:xxx.sql:1183266: ERROR: duplicate key value violates unique constraint "xxx"
DETAIL: Key (id)=(2) already exists.
CONTEXT: COPY mo_logs, line 1: "2 +6421558671 +15759151518 LolWithPlus unable to deliver, dropping : undefined method `bytesize' for..."
Then the console shows nothing new since then. On my first attempt I thought it was hanging so exited but got the following output:
Cancel request sent
This leads me to believe the script is still running but I have no way of telling. Can anyone advise how I can either diagnose what is going on or give me an indication of whether the insert is failing as shown by it hanging.
It seems like the SQL script contains several COPY statements.
One of them (COPY TO mo_logs) failed, and another of them (COPY TO midn_protections) was running when you interrupted processing.
Normally psql continues working after an error and will just execute the next statement. To avoid that, start it with the option --set ON_ERROR_STOP=on.

Is DB2 CLPPLUS editor able to do xquery

I am new to the CLPPlus editor and I'm trying a simple query that works if I execute it from a file like this
db2 -td% -svf C:\query.sql
and the query.sql file contains:
SELECT tx.ID,XMLQUERY('for $e in $d/Client/Address return data($e)' passing tx.contactinfo as "d") FROM clients tx %
If I just place the query as it is in the CLP or CLPPLUS editor as it is I get errors.
Error FROM CLP: SQL0104N An unexpected token "for $e in $d/Client/Ad"
was found following "LECT tx.ID,XMLQUERY(". Expected tokens may
include: "
Error from CLPPLUS: SQL16002N An XQuery expression has an unexpected
token "in" following "for ". Expected tokens may include: "is". Error
QName=err:XPST0003.