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

Always getting "query error: near "~": syntax error" error #324

Open
jgclark opened this issue Nov 10, 2023 · 4 comments
Open

Always getting "query error: near "~": syntax error" error #324

jgclark opened this issue Nov 10, 2023 · 4 comments

Comments

@jgclark
Copy link

jgclark commented Nov 10, 2023

I'm upgrading to 3.1.6 from 2.1.x after brew's version of this stopped working. And I can't get it to run successfully at all even on a very basic file such as:

first,last,tag
Bob,Smith,leader
Fanny,Jones,helper
Joe,Clark,trustee

When I run any query, even the very simplest
q -H -d , "SELECT * from ./test-basic.csv"
I get the same error:
query error: near "~": syntax error
I can't find anything obviously related in the issues already.

I'm running on macOS 13.6.1 and the version string is

q version 3.1.6
Python: 3.8.11 (default, Jul 24 2021, 22:28:00) // [Clang 12.0.1 ]
@jgclark jgclark changed the title Always getting "" error Always getting "query error: near "~": syntax error" error Nov 10, 2023
@jgclark
Copy link
Author

jgclark commented Nov 10, 2023

I've now found a way to get the CSV into a SQLite file.
All my previous queries are now running OK, with only changing the filename they are working on.
Therefore the installation seems OK ... but there's still something funny odd going on with my CSV files?

@harelba
Copy link
Owner

harelba commented Nov 12, 2023

Hi,

(Assuming I understand the issue properly, if not please write again and i'll help as much as i can).

Unfortunately, I haven't made q aware of the home folder ~ character, you would need to provide the full path and not use the ~ shortcut.

@jgclark
Copy link
Author

jgclark commented Nov 13, 2023

Thanks. However I'm not using ~ as part of filenames when calling q. See example above.

@jgclark
Copy link
Author

jgclark commented Jan 8, 2024

I had another look, and I think I've found where the ~ symbols are creeping in.
I'm running on macOS, and despite in the shall I'm only working in the current directory, it's doing full path expansion. And that starts '/Users/jonathan/Library/Mobile Documents/com~apple~CloudDocs/.
So, it's still not about the "home folder character", but it is about that character breaking q's processing in filepaths.

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