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

Add struct/list support for load query options. #182

Closed
jheer opened this issue Sep 21, 2023 Discussed in #181 · 0 comments · Fixed by #183
Closed

Add struct/list support for load query options. #182

jheer opened this issue Sep 21, 2023 Discussed in #181 · 0 comments · Fixed by #183
Assignees
Labels
enhancement New feature or request

Comments

@jheer
Copy link
Member

jheer commented Sep 21, 2023

Discussed in #181

Originally posted by fundef1 September 21, 2023
Hi, I'm trying to load a CSV and manually specify the columns.
it's a bit of a degenerate case as I only have a single column, but I can't figure out the correct format:

const csvopts = {
	auto_detect: false, 
	all_varchar: true,
	columns: "{'line': 'VARCHAR'}", 
	header: false
};

vg.coordinator().exec(vg.loadCSV("lines", `${window.location}data/lines.csv`,csvopts));

results in

Uncaught (in promise) Error: Parser Error: syntax error at or near "line"
LINE 1: ..._size=-1, all_varchar=true, columns='{'line': 'VARCHAR'}', header=false,...

the quoting of columns looks off and I've tried different variants of quoting the columns option but just can't get it to work.

any hints? thanks!

We should expand the load* methods to properly handle object (-> struct) and array (-> list) option values.

@jheer jheer self-assigned this Sep 21, 2023
@jheer jheer added the enhancement New feature or request label Sep 21, 2023
jheer added a commit that referenced this issue Sep 21, 2023
* feat: Support struct/list load query options. (#182)
* fix: Fix lint errors.
* chore: Code clean-up.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant