Redshift Json extract path text - amazon-redshift

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

Related

How do I import inet or uudi data as null from csv file?

I am using DBeaver tool for import csv file into postgres database. When Iam trying to import csv file which is having column (inet datatype) as null. Then I am getting the below error. Please let me know how to fix this in excel ?
Error occurred during SQL query execution
Reason:
SQL Error [22P02]: ERROR: invalid input syntax for type integer: ""
Position: 468

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

RDBMS to MongoDB using Talend 6.1.2 throwing error

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]

Unable to load CSV file in postgresq due to column of relation does not exist

I have a csv file :
SrNo,TradeDate,TradeTime,SettlementNo
1,25-Apr-17,14:48:19,NSE-N-2017077
2,05-May-17,09:33:28,NSE-N-2017084
I am trying to upload this file using the command:
copy public.shares(SrNo,TradeDate,TradeTime,SettlementNo) from 'C:/Users/Dell/Downloads/report_jul2018.csv' with csv header;
It is giving the error:
ERROR: column "srno" of relation "shares" does not exist SQL state: 42703
Any solution?

Unload from Redshift to S3: Authentication not working

I am using the following script:
UNLOAD ('SELECT * FROM table WHERE
UPPER(description) LIKE \'%something%\' AND
transaction_date=\'2014-01-01\'')
TO 's3://yourdirectory/jan14.txt' CREDENTIALS
'aws_access_key_id=xxxx;
aws_secret_access_key=xxx'
PARALLEL OFF
But it returns this error:
An error occurred when executing the SQL command:
UNLOAD ('SELECT * FROM yi_base_views.card_panel WHERE
UPPER(description) LIKE \'%LULULEMON%\' AND
transaction_date=\'2014-01-01\'')
TO 's3://yourdirec...
ERROR: Invalid credentials. Must be of the format: credentials 'aws_access_key_id=;aws_secret_access_key=[;token=]'
Detail:
error: Invalid credentials. Must be of the format: credentials 'aws_access_key_id=;aws_secret_access_key=[;token=]'
code: 8001
context:
query: 0
location: aws_credentials_parser.cpp:59
process: padbmaster [pid=43295]
Remove the line break between the access key and secret key and it should work.