TheBuilderJR commented on issue #13649:
URL: https://github.com/apache/datafusion/issues/13649#issuecomment-2521079355
@findepi yes that's correct, you can see the code here
```
let result: Result<_> = ctx
.sql(
&format!(
"SELECT * FROM ({}) AS query LIMIT 10000",
regex::Regex
::new(r"--[^\n]*")
.unwrap()
.replace_all(&query, " ")
.replace('\n', " ")
.trim()
.trim_end_matches(';')
)
).await
```
As an aside, all the pre-processing is also unideal (removing new lines,
trailing semicolon, etc). Ideally the sql API would do this processing by
default.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]