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

Undocumented behavior in crontab for alasql cli #1405

Closed
landall opened this issue Dec 6, 2021 · 2 comments
Closed

Undocumented behavior in crontab for alasql cli #1405

landall opened this issue Dec 6, 2021 · 2 comments

Comments

@landall
Copy link

landall commented Dec 6, 2021

I use alasql-cli in crontab but find it cannot accept a SQL statement ('No sql to process') when I write
/usr/local/bin/alasql "SELECT author,count(1) as c into JSON(\"${YLOG}\") from CSV(\"${DLOG}\") where timestamp=$yesterday group by author order by author asc"

but can work in pipe mode.
echo "SELECT author,count(1) as c into JSON(\"${YLOG}\") from CSV(\"${DLOG}\") where timestamp=$yesterday group by author order by author asc" | /usr/local/bin/alasql

I guess it is caused by Boolean(process.stdin.isTTY) in /usr/local/bin/alasql, but i do not know how to fix it.

OS: AlmaLinux 8.4
node: v16.8.0
SELinux: Enforcing

@mathiasrw
Copy link
Member

Good point. If you run that command wrapped in another execution it will not try to read the parameter as SQL. Let me fix that.

@mathiasrw
Copy link
Member

Released as part of v2.0.2

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