apache / apache/datafusion

What is the easiest way to turn statements into JSON?

Open
#6,227 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
9.3k
Forks
2.4k
Avg merge
3d 7h
Merged PRs (30d)
344

Description

I know very little Rust so apologies for noobe question. I'm using DataFusion through Elixir and want to analyse user statements before passing them along to actually perform the query. How do I convert the output of `parser::DFParser::parse_sql` into JSON?

```rs
parser::DFParser::parse_sql("
CREATE EXTERNAL TABLE foo(c1 int) STORED AS CSV LOCATION 'foo.csv';
select * from foo;
DESCRIBE table;
INSERT INTO users (ss) values ('sdsd');
")
```

I noticed the underlying `sqlparser` crate supports serde trait for statements but from what I see `datafusion-sql` adds support for a couple more statements (CREATE EXTERNAL... and DESCRIBE ...) and that crate doesn't support serde.

What are some options for me?

Contributor guide

Open the contributing guide

Research direction

The issue names parser::DFParser::parse_sql, datafusion-sql, and the underlying sqlparser crate. Read those parser and statement definitions first and compare the stated serde support. Since no concrete change or acceptance criteria is given, a finished contribution cannot be determined from the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, sql
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.