-
Notifications
You must be signed in to change notification settings - Fork 25.5k
Update esql-syntax.md - escapechar and quotes. #134266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I think we need to reword this bit as we don't actually say things like `\` is the escape character - which I'm not too well equipped for. but the `\\"` is wrong and should be `\"` so <escape char><quote> vs escaping escape char and then quote as this fails: ``` POST _query?format=txt { "query":""" ROW a = 1 | EVAL b = "\\"" """ } ``` vs: ``` POST _query?format=txt { "query":""" ROW a = 1 | EVAL b = "\"" """ } ```
Pinging @elastic/core-docs (Team:Docs) |
@mjmbischoff please enable the option "Allow edits and access to secrets by maintainers" on your PR. For more information, see the documentation. |
🔍 Preview links for changed docs |
This comment was marked as resolved.
This comment was marked as resolved.
Thanks @mjmbischoff —This change looks correct to me but because escape characters is kinda a can of worms in ESQL, just want to make sure get technical approve from devs :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks good to me, \\"
is incorrect in all cases.
I think the confusion came from the fact that we can escape the string in the query
ROW a = "foo\"bar"
but we can also escape the query itself:
POST _query
{
"query": "ROW a = \"foo\\\"bar\""
}
and it becomes three escapes in this case.
Let alone all the all the combinations of triple quotes in the JSON payload and in ES|QL strings.
I still haven't found a way to explain all the cases in a way that is clear enough for the end user, so let's stick to this for now.
I think we need to reword this bit as we don't actually say things like
\
is the escape character - which I'm not too well equipped for.but the
\\"
is wrong and should be\"
so vs escaping escape char and then quote as this fails:vs: