>From Peeyush Gupta <[email protected]>:

Attention is currently required from: Murtadha Al Hubail, Till Westmann, Ali 
Alsuliman, Ritik Raj.
Peeyush Gupta has posted comments on this change. ( 
https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17450 )

Change subject: [ASTERIXDB-3155][SQL] Supporting escape backticks in SQL++
......................................................................


Patch Set 2:

(7 comments)

Commit Message:

PS2:
Please check the commit message in 
https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17280 and reformat the commit 
message.
Note that user model is updated due to this change. Also, add details about 
what this change does.


Patchset:

PS2:
Please add test cases that check the new escape sequences.
You can refer to https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/13743 to 
check how the tests can be added.
Let me know if you still are unclear on how to add a test case.


File 
asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/parser/ScopeChecker.java:

https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17450/comment/91d09948_95e141cd
PS2, Line 308: case 'u':
             :                         // handle Unicode
             :                         if (pos + 4 > cray.length - 1) {
             :                             throw new 
IllegalStateException("should have been caught by the lexer");
             :                         }
             :
             :                         String encodedValue = s.substring(pos - 
2, pos + 4); // \u0000
             :                         String decodedValue = 
StringEscapeUtils.unescapeJava(encodedValue);
             :
             :                         pos += 4;
             :                         // Check for Surrogate Unicode String
             :                         if (isSurrogate(decodedValue.charAt(0))) 
{
             :                             if (pos + 6 > cray.length - 1 || 
cray[pos] != '\\' || cray[pos + 1] != 'u') {
             :                                 decodedValue = "\uFFFD";
             :                             } else {
             :                                 encodedValue = encodedValue + 
s.substring(pos, pos + 6);
             :                                 pos += 6;
             :                                 decodedValue = 
StringEscapeUtils.unescapeJava(encodedValue);
             :                             }
             :                         }
             :                         res.append(decodedValue);
             :                         break;
             :                     default:
             :                         throw new IllegalStateException("'\\" + 
c + "' should have been caught by the lexer");
             :                 }
As per the discussion in the team, in this change we need to support the 
following escaping functionalities
- escape backtick with backtick
- escape backtick with backslash
- escape single quote with single quote
Lets not add the extra unicode character based escaping.


File asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj:

https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17450/comment/f8be4c1a_80b978e6
PS2, Line 5759: <EscapeUnicode>
As per the discussion in the team, in this change we need to support the 
following escaping functionalities
- escape backtick with backtick
- escape backtick with backslash
- escape single quote with single quote

Lets not add the extra unicode character based escaping.


https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17450/comment/eb1c0b7f_aeeebbfe
PS2, Line 5775:         | <EscapeUnicode>
Lets not add the extra unicode character based escaping.


https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17450/comment/e492b5c2_18538b6d
PS2, Line 5786: EscapeUnicode
Lets not add the extra unicode character based escaping.


https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17450/comment/ed43f753_a8fb29b9
PS2, Line 5801: EscapeUnicode
Lets not add the extra unicode character based escaping.



--
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17450
To unsubscribe, or for help writing mail filters, visit 
https://asterix-gerrit.ics.uci.edu/settings

Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Change-Id: I5d9069c6aaa1365545f7e0ca728be6ea2ca4641d
Gerrit-Change-Number: 17450
Gerrit-PatchSet: 2
Gerrit-Owner: Ritik Raj <[email protected]>
Gerrit-Reviewer: Ali Alsuliman <[email protected]>
Gerrit-Reviewer: Anon. E. Moose #1000171
Gerrit-Reviewer: Jenkins <[email protected]>
Gerrit-Reviewer: Murtadha Al Hubail <[email protected]>
Gerrit-Reviewer: Peeyush Gupta <[email protected]>
Gerrit-Reviewer: Till Westmann <[email protected]>
Gerrit-Attention: Murtadha Al Hubail <[email protected]>
Gerrit-Attention: Till Westmann <[email protected]>
Gerrit-Attention: Ali Alsuliman <[email protected]>
Gerrit-Attention: Ritik Raj <[email protected]>
Gerrit-Comment-Date: Mon, 27 Mar 2023 22:35:14 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Reply via email to