I created a new script. This script is much more better.
I'm still working on it, but even now you can use it.
I tested script on Verica 8.0.1 (you didn't post your version).
$ ./vertex.py --help
usage: vertex.py [--help] [-d DATABASE] [-U USER] -w PASSWORD [-h HOST]
[-p PORT] -c COMMAND [-F {csv,json,xml}] [-o FILENAME] [-V]
vertex.py - convert your SQL table or query to JSON/CSV/XML format.
optional arguments:
--help show this help message and exit
-d DATABASE, --dbname DATABASE
the name of your HP Vertica database. (default: None)
-U USER, --username USER
your HP Vertica user name. (default: dbadmin)
-w PASSWORD the password for the user's account. (default: None)
-h HOST, --host HOST the name of the host. (default: localhost)
-p PORT, --port PORT the port number on which HP Vertica listens. (default:
5433)
-c COMMAND, --command COMMAND
query to exeport. (default: None)
-F {csv,json,xml}, --format {csv,json,xml}
output format for query. (default: json)
-o FILENAME, --output FILENAME
writes all query output into file filename. (default:
None)
-V, --version show program's version number and exit
Answers
You could if you use something like DBeaver. http://dbeaver.jkiss.org/docs/features/. Ctrl-F JSON.
A similar question was discussed here.
https://forum.vertica.com/discussion/comment/239123
Hi!
Can you describe your requirements(how do you see it)?
For example:
or how?
Hi!
Yes, you can do it easily, but its not a out-of-box functionality.
Depends on your requirements:
Don't afraid, all options very easy to implement(I can help, if you don't know how to do it).
Hi!
Yes, you can do it easily, but its not a out-of-box functionality.
Depends on your requirements:
Don't afraid, all options very easy to implement(I can help, if you don't know how to do it).
I think, for my requirements, Python client will be the best choice. Do you have any example of this?
I will create a lot of files to use in my chart tool, I start with:
select * from tabela order by campo1
And any time who change "campo1" I create a new file campo1.json
Hi Ariel_Cary
When i click on this link I get this message:
Permission Problem
You don't have permission to do that.
Hi!
Checkout this gist(its just a concept): https://gist.github.com/sKwa/b7af8753f598c9666ad4cfdc05904346
Since we cannot enclose fields in quotes so I did a trick:
example of usage:
example of output:
see example in the end of gist.
This snippet converts empty string to null and probably will fail on binary data.
PS
Latter I will post a robust script.
Hi alalmeida!
I created a new script. This script is much more better.
I'm still working on it, but even now you can use it.
I tested script on Verica 8.0.1 (you didn't post your version).
Feel free to fork/modify it:
https://github.com/sKwa/vertica/tree/master/vertex
Changes:
vsql
Limitations:
Requirements:
Supported data types:
Help
Example
How to remove last records extra comma?
Individual records looks good, and if we consider the whole JSON file then after last record it is having an extra comma making the json invalid.
PravinG - I am sure you can find a way to remove the last comma using sed or awk.
PravinG - I am sure you can find a way to remove the last comma using sed or awk.