Lordworms commented on PR #14844:
URL: https://github.com/apache/datafusion/pull/14844#issuecomment-2683310903
> Hi @Lordworms -- thank you for this PR
>
> I played around with it a bit locally and something still doesn't seem
right
>
> Specifically, postgres will treat `\1` like a literal string while this PR
still tries to escape it...
>
> ```sql
> postgres=# select '\1';
> ?column?
> ----------
> \1
> (1 row)
> ```
>
> But when I try in this PR:
>
> ```sql
> select 'DataFusion CLI v45.0.0
> > select '\';
> +-----------+
> | Utf8("\") |
> +-----------+
> | \ |
> +-----------+
> 1 row(s) fetched.
> Elapsed 0.013 seconds.
>
> > select '\1'; 🤔 Invalid statement: Execution error: Invalid escape
sequence: \1
> ```
I think this is correct, because postgresql treats line breaks, such as \t
\0, as plain text, but in the original design of DataFusion, \t, \0 should be
escaped, so for \1, since it cannot be escaped, an error will be thrown. I
think the original purpose of this issue should be to fix single or multiple
backslashes. I am not sure whether we should treat all input as plain text like
postgresql.

--
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]