Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support oneliner of :CSV foo.csv with tailing nGQL. #141

Closed
wey-gu opened this issue Nov 3, 2021 · 1 comment
Closed

support oneliner of :CSV foo.csv with tailing nGQL. #141

wey-gu opened this issue Nov 3, 2021 · 1 comment

Comments

@wey-gu
Copy link
Contributor

wey-gu commented Nov 3, 2021

One of our users was trying to create some script to automate nGQL query to output result in CSV leveraging console :CSV syntax.

The current semantic of :CSV means to save the next line of :CSV result to file, which is clear and making a lot of sense :).

While in this user's need, the shell script is calling console -e, thus the only thing it could done are something like:

console ... -e `use foo; :csv bar.csv; go from ...`

This should not be supported for the initial definition of :CSV as it only means to output query in next line.

The way to support this was to alternatively use -f filename where in the file, multi-line of use foo;\n:csv bar.csv;\n go ... was placed.

But with this, I would like to ask for help on considering changing our semantic of :CSV on allowing its tailing query to output to the file if exists.

 :csv bar.csv; go from ...

Do you think this makes sense?

Thanks

@jievince
Copy link
Contributor

jievince commented Nov 9, 2021

Sorry to reply so late.

:csv bar.csv; go from ...
Do you think this makes sense?

This was considered when we first designed the : CSV syntax, but because Nebula’s server-side syntax allows multiple statements separated by semicolons, so putting a semicolon on the same line between a client statement and a server statement can create some confusing situations, such as:

$var=go from...; : csv a.csv; $var2=...;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants