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

vdk-sqlite: support whitespace in column names #2510

Merged
merged 1 commit into from
Aug 3, 2023

Conversation

DeltaMichael
Copy link
Contributor

@DeltaMichael DeltaMichael commented Aug 2, 2023

Why?

Trying to create columns with whitespace in the name and inserting data in them using vdk-sqlite resulted in error.

This was most evident in examples like csv-ingestion

https://github.com/vmware/versatile-data-kit/wiki/Ingesting-local-CSV-file-into-Database

What?

  • Add double quotes around column names with whitespace in them when the table is created.
  • Replace named placeholders in insert query with question marks
  • Convert payload from dicts to lists to pass it to above query
  • Check if payload headers match column names before it's passed

How has this been tested?

Unit tests

What type of change is this?

Bugfix

@DeltaMichael DeltaMichael force-pushed the person/mdilyan/support-whitespace-sqlite branch 2 times, most recently from 5613c93 to 4e89d5f Compare August 2, 2023 12:58
Why?

Trying to create columns with whitespace in the name
and inserting data in them using vdk-sqlite resulted
in error.

This was most evident in examples like csv-ingestion

https://github.com/vmware/versatile-data-kit/wiki/Ingesting-local-CSV-file-into-Database

What?

Add double quotes around column names with whitespace in them when the table is created.
Replace named placeholders in insert query with question marks
Convert payload from dicts to lists to pass it to above query
Check if payload headers match column names before it's passed

How has this been tested?

Unit tests

What type of change is this?

Bugfix

Signed-off-by: Dilyan Marinov <[email protected]>
@DeltaMichael DeltaMichael force-pushed the person/mdilyan/support-whitespace-sqlite branch from 4e89d5f to 93602d4 Compare August 3, 2023 11:19
@DeltaMichael DeltaMichael enabled auto-merge (squash) August 3, 2023 11:21
@DeltaMichael DeltaMichael merged commit fd1ddb1 into main Aug 3, 2023
@DeltaMichael DeltaMichael deleted the person/mdilyan/support-whitespace-sqlite branch August 3, 2023 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

quickstart-vdk: Fix the CSV ingestion example, and link to Getting Started guide
4 participants