You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by "mdayakar (via GitHub)" <gi...@apache.org> on 2023/07/10 13:01:14 UTC
[GitHub] [hive] mdayakar opened a new pull request, #4476: HIVE-27488: HPL/SQL Quote literals not behaving as expected
mdayakar opened a new pull request, #4476:
URL: https://github.com/apache/hive/pull/4476
<!--
Thanks for sending a pull request! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines: https://cwiki.apache.org/confluence/display/Hive/HowToContribute
2. Ensure that you have created an issue on the Hive project JIRA: https://issues.apache.org/jira/projects/HIVE/summary
3. Ensure you have added or run the appropriate tests for your PR:
4. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP]HIVE-XXXXX: Your PR title ...'.
5. Be sure to keep the PR description updated to reflect all changes.
6. Please write your PR title to summarize what this PR proposes.
7. If possible, provide a concise example to reproduce the issue for a faster review.
-->
### What changes were proposed in this pull request?
Now including single quote(') in the output if the last two characters are single quotes(').
<!--
Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue.
If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
2. If you fix some SQL features, you can provide some references of other DBMSes.
3. If there is design documentation, please add the link.
4. If there is a discussion in the mailing list, please add the link.
-->
### Why are the changes needed?
To fix the issue 'HIVE-27488: HPL/SQL Quote literals not behaving as expected'.
<!--
Please clarify why the changes are needed. For instance,
1. If you propose a new API, clarify the use case for a new API.
2. If you fix a bug, you can clarify why it is a bug.
-->
### Does this PR introduce _any_ user-facing change?
No
<!--
Note that it means *any* user-facing change including all aspects such as the documentation fix.
If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description, screenshot and/or a reproducable example to show the behavior difference if possible.
If possible, please also clarify if this is a user-facing change compared to the released Hive versions or within the unreleased branches such as master.
If no, write 'No'.
-->
### Is the change a dependency upgrade?
No
<!--
If yes, please attach a file with output from mvn dependency:tree to validate a complete upgrade of dependency.
If no, write 'No'.
-->
### How was this patch tested?
Tests are added.
<!--
If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
If tests were not added, please describe why they were not added and/or why it was difficult to add.
-->
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
[GitHub] [hive] sonarcloud[bot] commented on pull request #4476: HIVE-27488: HPL/SQL Quote literals not behaving as expected
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #4476:
URL: https://github.com/apache/hive/pull/4476#issuecomment-1630312216
Kudos, SonarCloud Quality Gate passed! [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=4476)
[](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4476&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4476&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4476&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4476&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4476&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4476&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=4476&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=4476&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=4476&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4476&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4476&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4476&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=4476&metric=coverage&view=list) No Coverage information
[](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=4476&metric=duplicated_lines_density&view=list) No Duplication information
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
[GitHub] [hive] mdayakar commented on a diff in pull request #4476: HIVE-27488: HPL/SQL Quote literals not behaving as expected
Posted by "mdayakar (via GitHub)" <gi...@apache.org>.
mdayakar commented on code in PR #4476:
URL: https://github.com/apache/hive/pull/4476#discussion_r1265782073
##########
hplsql/src/test/queries/local/dbms_output.sql:
##########
@@ -3,4 +3,7 @@ DECLARE
BEGIN
DBMS_OUTPUT.PUT_LINE('Hello, world!');
DBMS_OUTPUT.PUT_LINE(str);
+ DBMS_OUTPUT.PUT_LINE(trim('a''a'));
+ DBMS_OUTPUT.PUT_LINE(trim('''a'));
+ DBMS_OUTPUT.PUT_LINE(trim('a'''));
Review Comment:
Removed trim function from test cases.
It will throw error as single quotes are not properly closed.
Added the test cases for the specified scenarios. Also changed the behaviour as per Oracles PL/SQL output.
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
[GitHub] [hive] sonarcloud[bot] commented on pull request #4476: HIVE-27488: HPL/SQL Quote literals not behaving as expected
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #4476:
URL: https://github.com/apache/hive/pull/4476#issuecomment-1629451472
Kudos, SonarCloud Quality Gate passed! [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=4476)
[](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4476&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4476&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4476&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4476&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4476&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4476&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=4476&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=4476&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=4476&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4476&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4476&resolved=false&types=CODE_SMELL) [9 Code Smells](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4476&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=4476&metric=coverage&view=list) No Coverage information
[](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=4476&metric=duplicated_lines_density&view=list) No Duplication information
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
[GitHub] [hive] mdayakar commented on a diff in pull request #4476: HIVE-27488: HPL/SQL Quote literals not behaving as expected
Posted by "mdayakar (via GitHub)" <gi...@apache.org>.
mdayakar commented on code in PR #4476:
URL: https://github.com/apache/hive/pull/4476#discussion_r1265782073
##########
hplsql/src/test/queries/local/dbms_output.sql:
##########
@@ -3,4 +3,7 @@ DECLARE
BEGIN
DBMS_OUTPUT.PUT_LINE('Hello, world!');
DBMS_OUTPUT.PUT_LINE(str);
+ DBMS_OUTPUT.PUT_LINE(trim('a''a'));
+ DBMS_OUTPUT.PUT_LINE(trim('''a'));
+ DBMS_OUTPUT.PUT_LINE(trim('a'''));
Review Comment:
Removed trim function from test cases.
It will throw error as single quotes are not properly closed.
Added the test cases for the specified scenarios.
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
[GitHub] [hive] sonarcloud[bot] commented on pull request #4476: HIVE-27488: HPL/SQL Quote literals not behaving as expected
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #4476:
URL: https://github.com/apache/hive/pull/4476#issuecomment-1639427299
Kudos, SonarCloud Quality Gate passed! [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=4476)
[](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4476&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4476&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4476&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4476&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4476&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4476&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=4476&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=4476&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=4476&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4476&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4476&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4476&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=4476&metric=coverage&view=list) No Coverage information
[](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=4476&metric=duplicated_lines_density&view=list) No Duplication information
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
[GitHub] [hive] sonarcloud[bot] commented on pull request #4476: HIVE-27488: HPL/SQL Quote literals not behaving as expected
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #4476:
URL: https://github.com/apache/hive/pull/4476#issuecomment-1638784231
Kudos, SonarCloud Quality Gate passed! [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=4476)
[](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4476&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4476&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4476&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4476&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4476&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4476&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=4476&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=4476&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=4476&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4476&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4476&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4476&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=4476&metric=coverage&view=list) No Coverage information
[](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=4476&metric=duplicated_lines_density&view=list) No Duplication information
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
[GitHub] [hive] mdayakar commented on a diff in pull request #4476: HIVE-27488: HPL/SQL Quote literals not behaving as expected
Posted by "mdayakar (via GitHub)" <gi...@apache.org>.
mdayakar commented on code in PR #4476:
URL: https://github.com/apache/hive/pull/4476#discussion_r1265784618
##########
hplsql/src/main/java/org/apache/hive/hplsql/Utils.java:
##########
@@ -38,11 +38,11 @@ public static String unquoteString(String s) {
char ch = s.charAt(i);
char ch2 = (i < len - 1) ? s.charAt(i+1) : 0;
- if((i == 0 || i == len -1) && (ch == '\'' || ch == '"'))
+ if((i == 0 || i == len - 1) && (ch == '\'' || ch == '"'))
continue;
else
- // \' and '' escape sequences
- if((ch == '\\' && ch2 == '\'') || (ch == '\'' && ch2 == '\''))
+ // \' and '' escape sequences and include ' if last two characters are ''
+ if((ch == '\\' && ch2 == '\'') || (ch == '\'' && ch2 == '\'' && i != len - 2))
Review Comment:
Added TestUtils unit test class.
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
[GitHub] [hive] zabetak commented on a diff in pull request #4476: HIVE-27488: HPL/SQL Quote literals not behaving as expected
Posted by "zabetak (via GitHub)" <gi...@apache.org>.
zabetak commented on code in PR #4476:
URL: https://github.com/apache/hive/pull/4476#discussion_r1266506232
##########
hplsql/src/test/java/org/apache/hive/hplsql/TestUtils.java:
##########
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hive.hplsql;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+public class TestUtils {
+
+ @Test
+ public void testShouldRemoveEscapeCharactersFromTheGivenInput() {
Review Comment:
We should include the name of the method that is tested. Something like:
`testUnquoteStringRemovesOneQuoteWhenTwoConsecutive`
##########
hplsql/src/main/java/org/apache/hive/hplsql/Utils.java:
##########
@@ -32,18 +32,22 @@ public static String unquoteString(String s) {
}
int len = s.length();
- StringBuilder s2 = new StringBuilder(len);
+ StringBuilder s2 = new StringBuilder(len);
+ boolean isEscape = true;
Review Comment:
Formatting is off.
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
[GitHub] [hive] zabetak commented on a diff in pull request #4476: HIVE-27488: HPL/SQL Quote literals not behaving as expected
Posted by "zabetak (via GitHub)" <gi...@apache.org>.
zabetak commented on code in PR #4476:
URL: https://github.com/apache/hive/pull/4476#discussion_r1260912937
##########
hplsql/src/test/queries/local/dbms_output.sql:
##########
@@ -3,4 +3,7 @@ DECLARE
BEGIN
DBMS_OUTPUT.PUT_LINE('Hello, world!');
DBMS_OUTPUT.PUT_LINE(str);
+ DBMS_OUTPUT.PUT_LINE(trim('a''a'));
+ DBMS_OUTPUT.PUT_LINE(trim('''a'));
+ DBMS_OUTPUT.PUT_LINE(trim('a'''));
Review Comment:
If the `trim` function is not necessary for reproducing the problem then we should remove it. In general, we should strive to keep repro tests minimal to facilitate understanding and also avoid side effects and unrelated failures in the future by the inclusion of extra elements.
##########
itests/hive-unit/pom.xml:
##########
@@ -483,6 +483,12 @@
<version>${htmlunit.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>net.sf.supercsv</groupId>
+ <artifactId>super-csv</artifactId>
+ <version>${super-csv.version}</version>
+ <scope>test</scope>
+ </dependency>
Review Comment:
Why do we need this new dependency here? I don't see how it is relevant to the problem or changes in the PR.
##########
hplsql/src/test/queries/local/dbms_output.sql:
##########
@@ -3,4 +3,7 @@ DECLARE
BEGIN
DBMS_OUTPUT.PUT_LINE('Hello, world!');
DBMS_OUTPUT.PUT_LINE(str);
+ DBMS_OUTPUT.PUT_LINE(trim('a''a'));
+ DBMS_OUTPUT.PUT_LINE(trim('''a'));
+ DBMS_OUTPUT.PUT_LINE(trim('a'''));
Review Comment:
What should happen in the following cases:
```
DBMS_OUTPUT.PUT_LINE('a'');
DBMS_OUTPUT.PUT_LINE(''a');
```
Should we add these test cases as well?
##########
hplsql/src/test/queries/local/dbms_output.sql:
##########
@@ -3,4 +3,7 @@ DECLARE
BEGIN
DBMS_OUTPUT.PUT_LINE('Hello, world!');
DBMS_OUTPUT.PUT_LINE(str);
+ DBMS_OUTPUT.PUT_LINE(trim('a''a'));
+ DBMS_OUTPUT.PUT_LINE(trim('''a'));
+ DBMS_OUTPUT.PUT_LINE(trim('a'''));
Review Comment:
Please also include the following test cases:
```
'''''aa'
'a''''a'
'aa'''''
```
##########
hplsql/src/main/java/org/apache/hive/hplsql/Utils.java:
##########
@@ -38,11 +38,11 @@ public static String unquoteString(String s) {
char ch = s.charAt(i);
char ch2 = (i < len - 1) ? s.charAt(i+1) : 0;
- if((i == 0 || i == len -1) && (ch == '\'' || ch == '"'))
+ if((i == 0 || i == len - 1) && (ch == '\'' || ch == '"'))
continue;
else
- // \' and '' escape sequences
- if((ch == '\\' && ch2 == '\'') || (ch == '\'' && ch2 == '\''))
+ // \' and '' escape sequences and include ' if last two characters are ''
+ if((ch == '\\' && ch2 == '\'') || (ch == '\'' && ch2 == '\'' && i != len - 2))
Review Comment:
Please create a class `TestUtils` and add unit tests for this method; these are in general faster and can be made more exhaustive.
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
[GitHub] [hive] zabetak closed pull request #4476: HIVE-27488: HPL/SQL Quote literals not behaving as expected
Posted by "zabetak (via GitHub)" <gi...@apache.org>.
zabetak closed pull request #4476: HIVE-27488: HPL/SQL Quote literals not behaving as expected
URL: https://github.com/apache/hive/pull/4476
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
[GitHub] [hive] mdayakar commented on a diff in pull request #4476: HIVE-27488: HPL/SQL Quote literals not behaving as expected
Posted by "mdayakar (via GitHub)" <gi...@apache.org>.
mdayakar commented on code in PR #4476:
URL: https://github.com/apache/hive/pull/4476#discussion_r1265784125
##########
itests/hive-unit/pom.xml:
##########
@@ -483,6 +483,12 @@
<version>${htmlunit.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>net.sf.supercsv</groupId>
+ <artifactId>super-csv</artifactId>
+ <version>${super-csv.version}</version>
+ <scope>test</scope>
+ </dependency>
Review Comment:
Was facing issues while running itests without this dependency, anyway for the current fix this change not required so reverted back.
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
[GitHub] [hive] zabetak commented on a diff in pull request #4476: HIVE-27488: HPL/SQL Quote literals not behaving as expected
Posted by "zabetak (via GitHub)" <gi...@apache.org>.
zabetak commented on code in PR #4476:
URL: https://github.com/apache/hive/pull/4476#discussion_r1268159491
##########
hplsql/src/main/java/org/apache/hive/hplsql/Utils.java:
##########
@@ -32,18 +32,22 @@ public static String unquoteString(String s) {
}
int len = s.length();
- StringBuilder s2 = new StringBuilder(len);
+ StringBuilder s2 = new StringBuilder(len);
+ boolean isEscape = true;
Review Comment:
The formatting appears off because there is a mix of tabs and spaces in indentation. According to the projects [coding conventions](https://cwiki.apache.org/confluence/display/Hive/HowToContribute#HowToContribute-CodingConventions) spaces should be used for indentation (not tabs) so the new code added in this PR is correctly formatted. However, the old code is not (it includes both tabs and spaces) and thus indentation appears broken.
To avoid this weird diff, I will exceptionally use the non-compliant tab + space indentation in this method.
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org