alamb commented on issue #6227:
URL:
https://github.com/apache/arrow-datafusion/issues/6227#issuecomment-1534970219
Can you start with just supporting Statement::Statement?
So something like (untested)
```
let statement = 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');
")
let json = match statement {
Statement::Statement(sql_statement) =>
serde_json::to_string_pretty(sql_statement).unwrap()
Statement::CreateExternalTable(..) => "{}".to_string(),
Statement::DescribeTableStmt(..) => "{}".to_string(),
}
```
That might be enough to get you unblocked -- then perhaps we can add serde
support to
https://docs.rs/datafusion-sql/23.0.0/datafusion_sql/parser/enum.Statement.html
in DataFusion directly
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]