Script fails if first line is a comment
See original GitHub issueTo repro install Apache Phoenix 4.7 and run the following command:
./sqlline.py localhost ../examples/STOCK_SYMBOL.sql
You’ll see the following error message:
1/5 -- test comment
Aborting command set because "force" is false and command failed: "-- test comment"
Here’s what the script looks like:
-- test comment
CREATE TABLE IF NOT EXISTS STOCK_SYMBOL (SYMBOL VARCHAR NOT NULL PRIMARY KEY, COMPANY VARCHAR);
UPSERT INTO STOCK_SYMBOL VALUES ('CRM','SalesForce.com');
SELECT * FROM STOCK_SYMBOL;
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Why is the first line comment of .sh file necessary? [duplicate]
is necessary in the shell script file, and the file won't run accurately without this line. But I tested some scripts.
Read more >bash script fails to read first line - Stack Overflow
The reason for the behaviour you see is that you don't pass the line to awk. So the first line is read by...
Read more >5 Mistakes To Avoid For Writing High-Quality Bash Comments
This is the only way to do a bash comment and ensure text or code is absolutely not evaluated in Bash. The only...
Read more >2.2. Script basics
In a decent script, the first lines are usually comment about what to expect. Then each big chunk of commands will be commented...
Read more >BASH Scripting
The first line is known as the “shebang” statement and declares the text file to be a script for interpretation by /bin/bash. The...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I haven’t made a release of sqlline yet. I would make releases more often if there were more contributions.
As far as I can see, the fix did not make it into HDP 2.5.0. Scripts with the comments in the first line still cause sqlline to error out.
For my personal understanding, what is the relation between this repo and Apache Phoenix repo? If it’s fixed here, will it be merged into Phoenix code-base at some point? Is there a Phoenix JIRA for this issue?