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.
   
![image](https://github.com/user-attachments/assets/5b50de75-b08a-41ee-8305-95c5f4e40376)
   


-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to