apache / apache/datafusion-sqlparser-rs

DuckDB COPY FROM DATABASE memory TO ... can't be parsed

Open
#1,824 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
3.5k
Forks
772
Avg merge
4d 9h
Merged PRs (30d)
17

Description

For example:
```sql
COPY FROM DATABASE memory TO my_database;
```

gives the error:
```rs
ParserError("Expected: FROM or TO, found: DATABASE at Line: 1, Column: 11")
```

Documentation: https://duckdb.org/docs/stable/guides/snippets/copy_in-memory_database_to_file.html

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the documented `COPY FROM DATABASE memory TO my_database` statement and trace how the SQL parser handles COPY syntax. Check the existing parser tests for COPY statements, then add coverage for this form; done means the statement parses successfully without the reported error.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, sql
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.