[jira] [Updated] (HIVE-18268) Hive Prepared Statement when split with double quoted in query fails
[ https://issues.apache.org/jira/browse/HIVE-18268?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Daniel Dai updated HIVE-18268: -- Fix Version/s: (was: 2.3.3) > Hive Prepared Statement when split with double quoted in query fails > > > Key: HIVE-18268 > URL: https://issues.apache.org/jira/browse/HIVE-18268 > Project: Hive > Issue Type: Bug > Components: JDBC >Affects Versions: 2.3.2 >Reporter: Choi JaeHwan >Assignee: Choi JaeHwan >Priority: Major > Fix For: 3.0.0, 2.4.0 > > Attachments: HIVE-18268.1.patch, HIVE-18268.2.patch, > HIVE-18268.3.patch, HIVE-18268.4.patch, HIVE-18268.patch > > > HIVE-13625, Change sql statement split when odd number of escape characters, > and add parameter counter validation, above > {code:java} > // prev code > StringBuilder newSql = new StringBuilder(parts.get(0)); > for(int i=1;i if(!parameters.containsKey(i)){ > throw new SQLException("Parameter #"+i+" is unset"); > } > newSql.append(parameters.get(i)); > newSql.append(parts.get(i)); > } > // change from HIVE-13625 > int paramLoc = 1; > while (getCharIndexFromSqlByParamLocation(sql, '?', paramLoc) > 0) { > // check the user has set the needs parameters > if (parameters.containsKey(paramLoc)) { > int tt = getCharIndexFromSqlByParamLocation(newSql.toString(), '?', > 1); > newSql.deleteCharAt(tt); > newSql.insert(tt, parameters.get(paramLoc)); > } > paramLoc++; > } > {code} > If the number of split SQL and the number of parameters are not matched, an > SQLException is thrown > Currently, when splitting SQL, there is no processing for double quoted, and > when the token ('?' ) is between double quote, SQL is split. > i think when the token between double quoted is literal, it is correct to not > split. > for example, above the query; > {code:java} > // Some comments here > 1: String query = " select 1 from x where qa="?" " > 2: String query = " SELECT 1 FROM `x` WHERE (trecord LIKE "ALA[d_?]%") > {code} > ? is literal, then query do not split. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Updated] (HIVE-18268) Hive Prepared Statement when split with double quoted in query fails
[ https://issues.apache.org/jira/browse/HIVE-18268?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Daniel Dai updated HIVE-18268: -- Target Version/s: 3.0.0, 2.4.0 Fix Version/s: (was: 2.4.0) (was: 3.0.0) > Hive Prepared Statement when split with double quoted in query fails > > > Key: HIVE-18268 > URL: https://issues.apache.org/jira/browse/HIVE-18268 > Project: Hive > Issue Type: Bug > Components: JDBC >Affects Versions: 2.3.2 >Reporter: Choi JaeHwan >Assignee: Choi JaeHwan >Priority: Major > Attachments: HIVE-18268.1.patch, HIVE-18268.2.patch, > HIVE-18268.3.patch, HIVE-18268.4.patch, HIVE-18268.patch > > > HIVE-13625, Change sql statement split when odd number of escape characters, > and add parameter counter validation, above > {code:java} > // prev code > StringBuilder newSql = new StringBuilder(parts.get(0)); > for(int i=1;i if(!parameters.containsKey(i)){ > throw new SQLException("Parameter #"+i+" is unset"); > } > newSql.append(parameters.get(i)); > newSql.append(parts.get(i)); > } > // change from HIVE-13625 > int paramLoc = 1; > while (getCharIndexFromSqlByParamLocation(sql, '?', paramLoc) > 0) { > // check the user has set the needs parameters > if (parameters.containsKey(paramLoc)) { > int tt = getCharIndexFromSqlByParamLocation(newSql.toString(), '?', > 1); > newSql.deleteCharAt(tt); > newSql.insert(tt, parameters.get(paramLoc)); > } > paramLoc++; > } > {code} > If the number of split SQL and the number of parameters are not matched, an > SQLException is thrown > Currently, when splitting SQL, there is no processing for double quoted, and > when the token ('?' ) is between double quote, SQL is split. > i think when the token between double quoted is literal, it is correct to not > split. > for example, above the query; > {code:java} > // Some comments here > 1: String query = " select 1 from x where qa="?" " > 2: String query = " SELECT 1 FROM `x` WHERE (trecord LIKE "ALA[d_?]%") > {code} > ? is literal, then query do not split. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Updated] (HIVE-18268) Hive Prepared Statement when split with double quoted in query fails
[ https://issues.apache.org/jira/browse/HIVE-18268?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Choi JaeHwan updated HIVE-18268: Attachment: HIVE-18268.patch > Hive Prepared Statement when split with double quoted in query fails > > > Key: HIVE-18268 > URL: https://issues.apache.org/jira/browse/HIVE-18268 > Project: Hive > Issue Type: Bug > Components: JDBC >Affects Versions: 2.3.2 >Reporter: Choi JaeHwan >Assignee: Choi JaeHwan > Attachments: HIVE-18268.patch > > > HIVE-13625, Change sql statement split when odd number of escape characters, > and add parameter counter validation, above > {code:java} > // prev code > StringBuilder newSql = new StringBuilder(parts.get(0)); > for(int i=1;i if(!parameters.containsKey(i)){ > throw new SQLException("Parameter #"+i+" is unset"); > } > newSql.append(parameters.get(i)); > newSql.append(parts.get(i)); > } > // change from HIVE-13625 > int paramLoc = 1; > while (getCharIndexFromSqlByParamLocation(sql, '?', paramLoc) > 0) { > // check the user has set the needs parameters > if (parameters.containsKey(paramLoc)) { > int tt = getCharIndexFromSqlByParamLocation(newSql.toString(), '?', > 1); > newSql.deleteCharAt(tt); > newSql.insert(tt, parameters.get(paramLoc)); > } > paramLoc++; > } > {code} > If the number of split SQL and the number of parameters are not matched, an > SQLException is thrown > Currently, when splitting SQL, there is no processing for double quoted, and > when the token ('?' ) is between double quote, SQL is split. > i think when the token between double quoted is literal, it is correct to not > split. > for example, above the query; > {code:java} > // Some comments here > 1: String query = " select 1 from x where qa="?" " > 2: String query = " SELECT 1 FROM `x` WHERE (trecord LIKE "ALA[d_?]%") > {code} > ? is literal, then query do not split. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Updated] (HIVE-18268) Hive Prepared Statement when split with double quoted in query fails
[ https://issues.apache.org/jira/browse/HIVE-18268?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Choi JaeHwan updated HIVE-18268: Fix Version/s: 2.3.3 Status: Patch Available (was: In Progress) > Hive Prepared Statement when split with double quoted in query fails > > > Key: HIVE-18268 > URL: https://issues.apache.org/jira/browse/HIVE-18268 > Project: Hive > Issue Type: Bug > Components: JDBC >Affects Versions: 2.3.2 >Reporter: Choi JaeHwan >Assignee: Choi JaeHwan > Fix For: 2.3.3 > > Attachments: HIVE-18268.patch > > > HIVE-13625, Change sql statement split when odd number of escape characters, > and add parameter counter validation, above > {code:java} > // prev code > StringBuilder newSql = new StringBuilder(parts.get(0)); > for(int i=1;i if(!parameters.containsKey(i)){ > throw new SQLException("Parameter #"+i+" is unset"); > } > newSql.append(parameters.get(i)); > newSql.append(parts.get(i)); > } > // change from HIVE-13625 > int paramLoc = 1; > while (getCharIndexFromSqlByParamLocation(sql, '?', paramLoc) > 0) { > // check the user has set the needs parameters > if (parameters.containsKey(paramLoc)) { > int tt = getCharIndexFromSqlByParamLocation(newSql.toString(), '?', > 1); > newSql.deleteCharAt(tt); > newSql.insert(tt, parameters.get(paramLoc)); > } > paramLoc++; > } > {code} > If the number of split SQL and the number of parameters are not matched, an > SQLException is thrown > Currently, when splitting SQL, there is no processing for double quoted, and > when the token ('?' ) is between double quote, SQL is split. > i think when the token between double quoted is literal, it is correct to not > split. > for example, above the query; > {code:java} > // Some comments here > 1: String query = " select 1 from x where qa="?" " > 2: String query = " SELECT 1 FROM `x` WHERE (trecord LIKE "ALA[d_?]%") > {code} > ? is literal, then query do not split. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Updated] (HIVE-18268) Hive Prepared Statement when split with double quoted in query fails
[ https://issues.apache.org/jira/browse/HIVE-18268?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Choi JaeHwan updated HIVE-18268: Attachment: HIVE-18268.1.ptach > Hive Prepared Statement when split with double quoted in query fails > > > Key: HIVE-18268 > URL: https://issues.apache.org/jira/browse/HIVE-18268 > Project: Hive > Issue Type: Bug > Components: JDBC >Affects Versions: 2.3.2 >Reporter: Choi JaeHwan >Assignee: Choi JaeHwan > Fix For: 2.3.3 > > Attachments: HIVE-18268.1.ptach, HIVE-18268.patch > > > HIVE-13625, Change sql statement split when odd number of escape characters, > and add parameter counter validation, above > {code:java} > // prev code > StringBuilder newSql = new StringBuilder(parts.get(0)); > for(int i=1;i if(!parameters.containsKey(i)){ > throw new SQLException("Parameter #"+i+" is unset"); > } > newSql.append(parameters.get(i)); > newSql.append(parts.get(i)); > } > // change from HIVE-13625 > int paramLoc = 1; > while (getCharIndexFromSqlByParamLocation(sql, '?', paramLoc) > 0) { > // check the user has set the needs parameters > if (parameters.containsKey(paramLoc)) { > int tt = getCharIndexFromSqlByParamLocation(newSql.toString(), '?', > 1); > newSql.deleteCharAt(tt); > newSql.insert(tt, parameters.get(paramLoc)); > } > paramLoc++; > } > {code} > If the number of split SQL and the number of parameters are not matched, an > SQLException is thrown > Currently, when splitting SQL, there is no processing for double quoted, and > when the token ('?' ) is between double quote, SQL is split. > i think when the token between double quoted is literal, it is correct to not > split. > for example, above the query; > {code:java} > // Some comments here > 1: String query = " select 1 from x where qa="?" " > 2: String query = " SELECT 1 FROM `x` WHERE (trecord LIKE "ALA[d_?]%") > {code} > ? is literal, then query do not split. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Updated] (HIVE-18268) Hive Prepared Statement when split with double quoted in query fails
[ https://issues.apache.org/jira/browse/HIVE-18268?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Choi JaeHwan updated HIVE-18268: Status: Open (was: Patch Available) > Hive Prepared Statement when split with double quoted in query fails > > > Key: HIVE-18268 > URL: https://issues.apache.org/jira/browse/HIVE-18268 > Project: Hive > Issue Type: Bug > Components: JDBC >Affects Versions: 2.3.2 >Reporter: Choi JaeHwan >Assignee: Choi JaeHwan > Fix For: 2.3.3 > > Attachments: HIVE-18268.1.ptach, HIVE-18268.patch > > > HIVE-13625, Change sql statement split when odd number of escape characters, > and add parameter counter validation, above > {code:java} > // prev code > StringBuilder newSql = new StringBuilder(parts.get(0)); > for(int i=1;i if(!parameters.containsKey(i)){ > throw new SQLException("Parameter #"+i+" is unset"); > } > newSql.append(parameters.get(i)); > newSql.append(parts.get(i)); > } > // change from HIVE-13625 > int paramLoc = 1; > while (getCharIndexFromSqlByParamLocation(sql, '?', paramLoc) > 0) { > // check the user has set the needs parameters > if (parameters.containsKey(paramLoc)) { > int tt = getCharIndexFromSqlByParamLocation(newSql.toString(), '?', > 1); > newSql.deleteCharAt(tt); > newSql.insert(tt, parameters.get(paramLoc)); > } > paramLoc++; > } > {code} > If the number of split SQL and the number of parameters are not matched, an > SQLException is thrown > Currently, when splitting SQL, there is no processing for double quoted, and > when the token ('?' ) is between double quote, SQL is split. > i think when the token between double quoted is literal, it is correct to not > split. > for example, above the query; > {code:java} > // Some comments here > 1: String query = " select 1 from x where qa="?" " > 2: String query = " SELECT 1 FROM `x` WHERE (trecord LIKE "ALA[d_?]%") > {code} > ? is literal, then query do not split. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Updated] (HIVE-18268) Hive Prepared Statement when split with double quoted in query fails
[ https://issues.apache.org/jira/browse/HIVE-18268?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Choi JaeHwan updated HIVE-18268: Status: Patch Available (was: Open) > Hive Prepared Statement when split with double quoted in query fails > > > Key: HIVE-18268 > URL: https://issues.apache.org/jira/browse/HIVE-18268 > Project: Hive > Issue Type: Bug > Components: JDBC >Affects Versions: 2.3.2 >Reporter: Choi JaeHwan >Assignee: Choi JaeHwan > Fix For: 2.3.3 > > Attachments: HIVE-18268.1.ptach, HIVE-18268.patch > > > HIVE-13625, Change sql statement split when odd number of escape characters, > and add parameter counter validation, above > {code:java} > // prev code > StringBuilder newSql = new StringBuilder(parts.get(0)); > for(int i=1;i if(!parameters.containsKey(i)){ > throw new SQLException("Parameter #"+i+" is unset"); > } > newSql.append(parameters.get(i)); > newSql.append(parts.get(i)); > } > // change from HIVE-13625 > int paramLoc = 1; > while (getCharIndexFromSqlByParamLocation(sql, '?', paramLoc) > 0) { > // check the user has set the needs parameters > if (parameters.containsKey(paramLoc)) { > int tt = getCharIndexFromSqlByParamLocation(newSql.toString(), '?', > 1); > newSql.deleteCharAt(tt); > newSql.insert(tt, parameters.get(paramLoc)); > } > paramLoc++; > } > {code} > If the number of split SQL and the number of parameters are not matched, an > SQLException is thrown > Currently, when splitting SQL, there is no processing for double quoted, and > when the token ('?' ) is between double quote, SQL is split. > i think when the token between double quoted is literal, it is correct to not > split. > for example, above the query; > {code:java} > // Some comments here > 1: String query = " select 1 from x where qa="?" " > 2: String query = " SELECT 1 FROM `x` WHERE (trecord LIKE "ALA[d_?]%") > {code} > ? is literal, then query do not split. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Updated] (HIVE-18268) Hive Prepared Statement when split with double quoted in query fails
[ https://issues.apache.org/jira/browse/HIVE-18268?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Choi JaeHwan updated HIVE-18268: Attachment: (was: HIVE-18268.1.ptach) > Hive Prepared Statement when split with double quoted in query fails > > > Key: HIVE-18268 > URL: https://issues.apache.org/jira/browse/HIVE-18268 > Project: Hive > Issue Type: Bug > Components: JDBC >Affects Versions: 2.3.2 >Reporter: Choi JaeHwan >Assignee: Choi JaeHwan > Fix For: 2.3.3 > > Attachments: HIVE-18268.patch > > > HIVE-13625, Change sql statement split when odd number of escape characters, > and add parameter counter validation, above > {code:java} > // prev code > StringBuilder newSql = new StringBuilder(parts.get(0)); > for(int i=1;i if(!parameters.containsKey(i)){ > throw new SQLException("Parameter #"+i+" is unset"); > } > newSql.append(parameters.get(i)); > newSql.append(parts.get(i)); > } > // change from HIVE-13625 > int paramLoc = 1; > while (getCharIndexFromSqlByParamLocation(sql, '?', paramLoc) > 0) { > // check the user has set the needs parameters > if (parameters.containsKey(paramLoc)) { > int tt = getCharIndexFromSqlByParamLocation(newSql.toString(), '?', > 1); > newSql.deleteCharAt(tt); > newSql.insert(tt, parameters.get(paramLoc)); > } > paramLoc++; > } > {code} > If the number of split SQL and the number of parameters are not matched, an > SQLException is thrown > Currently, when splitting SQL, there is no processing for double quoted, and > when the token ('?' ) is between double quote, SQL is split. > i think when the token between double quoted is literal, it is correct to not > split. > for example, above the query; > {code:java} > // Some comments here > 1: String query = " select 1 from x where qa="?" " > 2: String query = " SELECT 1 FROM `x` WHERE (trecord LIKE "ALA[d_?]%") > {code} > ? is literal, then query do not split. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Updated] (HIVE-18268) Hive Prepared Statement when split with double quoted in query fails
[ https://issues.apache.org/jira/browse/HIVE-18268?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Choi JaeHwan updated HIVE-18268: Attachment: HIVE-18268.1.patch > Hive Prepared Statement when split with double quoted in query fails > > > Key: HIVE-18268 > URL: https://issues.apache.org/jira/browse/HIVE-18268 > Project: Hive > Issue Type: Bug > Components: JDBC >Affects Versions: 2.3.2 >Reporter: Choi JaeHwan >Assignee: Choi JaeHwan > Fix For: 2.3.3 > > Attachments: HIVE-18268.1.patch, HIVE-18268.patch > > > HIVE-13625, Change sql statement split when odd number of escape characters, > and add parameter counter validation, above > {code:java} > // prev code > StringBuilder newSql = new StringBuilder(parts.get(0)); > for(int i=1;i if(!parameters.containsKey(i)){ > throw new SQLException("Parameter #"+i+" is unset"); > } > newSql.append(parameters.get(i)); > newSql.append(parts.get(i)); > } > // change from HIVE-13625 > int paramLoc = 1; > while (getCharIndexFromSqlByParamLocation(sql, '?', paramLoc) > 0) { > // check the user has set the needs parameters > if (parameters.containsKey(paramLoc)) { > int tt = getCharIndexFromSqlByParamLocation(newSql.toString(), '?', > 1); > newSql.deleteCharAt(tt); > newSql.insert(tt, parameters.get(paramLoc)); > } > paramLoc++; > } > {code} > If the number of split SQL and the number of parameters are not matched, an > SQLException is thrown > Currently, when splitting SQL, there is no processing for double quoted, and > when the token ('?' ) is between double quote, SQL is split. > i think when the token between double quoted is literal, it is correct to not > split. > for example, above the query; > {code:java} > // Some comments here > 1: String query = " select 1 from x where qa="?" " > 2: String query = " SELECT 1 FROM `x` WHERE (trecord LIKE "ALA[d_?]%") > {code} > ? is literal, then query do not split. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Updated] (HIVE-18268) Hive Prepared Statement when split with double quoted in query fails
[ https://issues.apache.org/jira/browse/HIVE-18268?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Choi JaeHwan updated HIVE-18268: Status: Patch Available (was: Open) > Hive Prepared Statement when split with double quoted in query fails > > > Key: HIVE-18268 > URL: https://issues.apache.org/jira/browse/HIVE-18268 > Project: Hive > Issue Type: Bug > Components: JDBC >Affects Versions: 2.3.2 >Reporter: Choi JaeHwan >Assignee: Choi JaeHwan > Fix For: 2.3.3 > > Attachments: HIVE-18268.1.patch, HIVE-18268.patch > > > HIVE-13625, Change sql statement split when odd number of escape characters, > and add parameter counter validation, above > {code:java} > // prev code > StringBuilder newSql = new StringBuilder(parts.get(0)); > for(int i=1;i if(!parameters.containsKey(i)){ > throw new SQLException("Parameter #"+i+" is unset"); > } > newSql.append(parameters.get(i)); > newSql.append(parts.get(i)); > } > // change from HIVE-13625 > int paramLoc = 1; > while (getCharIndexFromSqlByParamLocation(sql, '?', paramLoc) > 0) { > // check the user has set the needs parameters > if (parameters.containsKey(paramLoc)) { > int tt = getCharIndexFromSqlByParamLocation(newSql.toString(), '?', > 1); > newSql.deleteCharAt(tt); > newSql.insert(tt, parameters.get(paramLoc)); > } > paramLoc++; > } > {code} > If the number of split SQL and the number of parameters are not matched, an > SQLException is thrown > Currently, when splitting SQL, there is no processing for double quoted, and > when the token ('?' ) is between double quote, SQL is split. > i think when the token between double quoted is literal, it is correct to not > split. > for example, above the query; > {code:java} > // Some comments here > 1: String query = " select 1 from x where qa="?" " > 2: String query = " SELECT 1 FROM `x` WHERE (trecord LIKE "ALA[d_?]%") > {code} > ? is literal, then query do not split. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Updated] (HIVE-18268) Hive Prepared Statement when split with double quoted in query fails
[ https://issues.apache.org/jira/browse/HIVE-18268?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Choi JaeHwan updated HIVE-18268: Status: Open (was: Patch Available) > Hive Prepared Statement when split with double quoted in query fails > > > Key: HIVE-18268 > URL: https://issues.apache.org/jira/browse/HIVE-18268 > Project: Hive > Issue Type: Bug > Components: JDBC >Affects Versions: 2.3.2 >Reporter: Choi JaeHwan >Assignee: Choi JaeHwan > Fix For: 2.3.3 > > Attachments: HIVE-18268.1.patch, HIVE-18268.patch > > > HIVE-13625, Change sql statement split when odd number of escape characters, > and add parameter counter validation, above > {code:java} > // prev code > StringBuilder newSql = new StringBuilder(parts.get(0)); > for(int i=1;i if(!parameters.containsKey(i)){ > throw new SQLException("Parameter #"+i+" is unset"); > } > newSql.append(parameters.get(i)); > newSql.append(parts.get(i)); > } > // change from HIVE-13625 > int paramLoc = 1; > while (getCharIndexFromSqlByParamLocation(sql, '?', paramLoc) > 0) { > // check the user has set the needs parameters > if (parameters.containsKey(paramLoc)) { > int tt = getCharIndexFromSqlByParamLocation(newSql.toString(), '?', > 1); > newSql.deleteCharAt(tt); > newSql.insert(tt, parameters.get(paramLoc)); > } > paramLoc++; > } > {code} > If the number of split SQL and the number of parameters are not matched, an > SQLException is thrown > Currently, when splitting SQL, there is no processing for double quoted, and > when the token ('?' ) is between double quote, SQL is split. > i think when the token between double quoted is literal, it is correct to not > split. > for example, above the query; > {code:java} > // Some comments here > 1: String query = " select 1 from x where qa="?" " > 2: String query = " SELECT 1 FROM `x` WHERE (trecord LIKE "ALA[d_?]%") > {code} > ? is literal, then query do not split. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Updated] (HIVE-18268) Hive Prepared Statement when split with double quoted in query fails
[ https://issues.apache.org/jira/browse/HIVE-18268?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Choi JaeHwan updated HIVE-18268: Attachment: HIVE-18268.2.patch > Hive Prepared Statement when split with double quoted in query fails > > > Key: HIVE-18268 > URL: https://issues.apache.org/jira/browse/HIVE-18268 > Project: Hive > Issue Type: Bug > Components: JDBC >Affects Versions: 2.3.2 >Reporter: Choi JaeHwan >Assignee: Choi JaeHwan > Fix For: 2.3.3 > > Attachments: HIVE-18268.1.patch, HIVE-18268.2.patch, HIVE-18268.patch > > > HIVE-13625, Change sql statement split when odd number of escape characters, > and add parameter counter validation, above > {code:java} > // prev code > StringBuilder newSql = new StringBuilder(parts.get(0)); > for(int i=1;i if(!parameters.containsKey(i)){ > throw new SQLException("Parameter #"+i+" is unset"); > } > newSql.append(parameters.get(i)); > newSql.append(parts.get(i)); > } > // change from HIVE-13625 > int paramLoc = 1; > while (getCharIndexFromSqlByParamLocation(sql, '?', paramLoc) > 0) { > // check the user has set the needs parameters > if (parameters.containsKey(paramLoc)) { > int tt = getCharIndexFromSqlByParamLocation(newSql.toString(), '?', > 1); > newSql.deleteCharAt(tt); > newSql.insert(tt, parameters.get(paramLoc)); > } > paramLoc++; > } > {code} > If the number of split SQL and the number of parameters are not matched, an > SQLException is thrown > Currently, when splitting SQL, there is no processing for double quoted, and > when the token ('?' ) is between double quote, SQL is split. > i think when the token between double quoted is literal, it is correct to not > split. > for example, above the query; > {code:java} > // Some comments here > 1: String query = " select 1 from x where qa="?" " > 2: String query = " SELECT 1 FROM `x` WHERE (trecord LIKE "ALA[d_?]%") > {code} > ? is literal, then query do not split. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Updated] (HIVE-18268) Hive Prepared Statement when split with double quoted in query fails
[ https://issues.apache.org/jira/browse/HIVE-18268?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Choi JaeHwan updated HIVE-18268: Status: Open (was: Patch Available) > Hive Prepared Statement when split with double quoted in query fails > > > Key: HIVE-18268 > URL: https://issues.apache.org/jira/browse/HIVE-18268 > Project: Hive > Issue Type: Bug > Components: JDBC >Affects Versions: 2.3.2 >Reporter: Choi JaeHwan >Assignee: Choi JaeHwan > Fix For: 2.3.3 > > Attachments: HIVE-18268.1.patch, HIVE-18268.2.patch, HIVE-18268.patch > > > HIVE-13625, Change sql statement split when odd number of escape characters, > and add parameter counter validation, above > {code:java} > // prev code > StringBuilder newSql = new StringBuilder(parts.get(0)); > for(int i=1;i if(!parameters.containsKey(i)){ > throw new SQLException("Parameter #"+i+" is unset"); > } > newSql.append(parameters.get(i)); > newSql.append(parts.get(i)); > } > // change from HIVE-13625 > int paramLoc = 1; > while (getCharIndexFromSqlByParamLocation(sql, '?', paramLoc) > 0) { > // check the user has set the needs parameters > if (parameters.containsKey(paramLoc)) { > int tt = getCharIndexFromSqlByParamLocation(newSql.toString(), '?', > 1); > newSql.deleteCharAt(tt); > newSql.insert(tt, parameters.get(paramLoc)); > } > paramLoc++; > } > {code} > If the number of split SQL and the number of parameters are not matched, an > SQLException is thrown > Currently, when splitting SQL, there is no processing for double quoted, and > when the token ('?' ) is between double quote, SQL is split. > i think when the token between double quoted is literal, it is correct to not > split. > for example, above the query; > {code:java} > // Some comments here > 1: String query = " select 1 from x where qa="?" " > 2: String query = " SELECT 1 FROM `x` WHERE (trecord LIKE "ALA[d_?]%") > {code} > ? is literal, then query do not split. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Updated] (HIVE-18268) Hive Prepared Statement when split with double quoted in query fails
[ https://issues.apache.org/jira/browse/HIVE-18268?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Choi JaeHwan updated HIVE-18268: Status: Patch Available (was: Open) > Hive Prepared Statement when split with double quoted in query fails > > > Key: HIVE-18268 > URL: https://issues.apache.org/jira/browse/HIVE-18268 > Project: Hive > Issue Type: Bug > Components: JDBC >Affects Versions: 2.3.2 >Reporter: Choi JaeHwan >Assignee: Choi JaeHwan > Fix For: 2.3.3 > > Attachments: HIVE-18268.1.patch, HIVE-18268.2.patch, HIVE-18268.patch > > > HIVE-13625, Change sql statement split when odd number of escape characters, > and add parameter counter validation, above > {code:java} > // prev code > StringBuilder newSql = new StringBuilder(parts.get(0)); > for(int i=1;i if(!parameters.containsKey(i)){ > throw new SQLException("Parameter #"+i+" is unset"); > } > newSql.append(parameters.get(i)); > newSql.append(parts.get(i)); > } > // change from HIVE-13625 > int paramLoc = 1; > while (getCharIndexFromSqlByParamLocation(sql, '?', paramLoc) > 0) { > // check the user has set the needs parameters > if (parameters.containsKey(paramLoc)) { > int tt = getCharIndexFromSqlByParamLocation(newSql.toString(), '?', > 1); > newSql.deleteCharAt(tt); > newSql.insert(tt, parameters.get(paramLoc)); > } > paramLoc++; > } > {code} > If the number of split SQL and the number of parameters are not matched, an > SQLException is thrown > Currently, when splitting SQL, there is no processing for double quoted, and > when the token ('?' ) is between double quote, SQL is split. > i think when the token between double quoted is literal, it is correct to not > split. > for example, above the query; > {code:java} > // Some comments here > 1: String query = " select 1 from x where qa="?" " > 2: String query = " SELECT 1 FROM `x` WHERE (trecord LIKE "ALA[d_?]%") > {code} > ? is literal, then query do not split. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Updated] (HIVE-18268) Hive Prepared Statement when split with double quoted in query fails
[ https://issues.apache.org/jira/browse/HIVE-18268?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Choi JaeHwan updated HIVE-18268: Attachment: HIVE-18268.3.patch > Hive Prepared Statement when split with double quoted in query fails > > > Key: HIVE-18268 > URL: https://issues.apache.org/jira/browse/HIVE-18268 > Project: Hive > Issue Type: Bug > Components: JDBC >Affects Versions: 2.3.2 >Reporter: Choi JaeHwan >Assignee: Choi JaeHwan > Fix For: 2.3.3 > > Attachments: HIVE-18268.1.patch, HIVE-18268.2.patch, > HIVE-18268.3.patch, HIVE-18268.patch > > > HIVE-13625, Change sql statement split when odd number of escape characters, > and add parameter counter validation, above > {code:java} > // prev code > StringBuilder newSql = new StringBuilder(parts.get(0)); > for(int i=1;i if(!parameters.containsKey(i)){ > throw new SQLException("Parameter #"+i+" is unset"); > } > newSql.append(parameters.get(i)); > newSql.append(parts.get(i)); > } > // change from HIVE-13625 > int paramLoc = 1; > while (getCharIndexFromSqlByParamLocation(sql, '?', paramLoc) > 0) { > // check the user has set the needs parameters > if (parameters.containsKey(paramLoc)) { > int tt = getCharIndexFromSqlByParamLocation(newSql.toString(), '?', > 1); > newSql.deleteCharAt(tt); > newSql.insert(tt, parameters.get(paramLoc)); > } > paramLoc++; > } > {code} > If the number of split SQL and the number of parameters are not matched, an > SQLException is thrown > Currently, when splitting SQL, there is no processing for double quoted, and > when the token ('?' ) is between double quote, SQL is split. > i think when the token between double quoted is literal, it is correct to not > split. > for example, above the query; > {code:java} > // Some comments here > 1: String query = " select 1 from x where qa="?" " > 2: String query = " SELECT 1 FROM `x` WHERE (trecord LIKE "ALA[d_?]%") > {code} > ? is literal, then query do not split. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Updated] (HIVE-18268) Hive Prepared Statement when split with double quoted in query fails
[ https://issues.apache.org/jira/browse/HIVE-18268?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Choi JaeHwan updated HIVE-18268: Status: Open (was: Patch Available) > Hive Prepared Statement when split with double quoted in query fails > > > Key: HIVE-18268 > URL: https://issues.apache.org/jira/browse/HIVE-18268 > Project: Hive > Issue Type: Bug > Components: JDBC >Affects Versions: 2.3.2 >Reporter: Choi JaeHwan >Assignee: Choi JaeHwan > Fix For: 2.3.3 > > Attachments: HIVE-18268.1.patch, HIVE-18268.2.patch, > HIVE-18268.3.patch, HIVE-18268.patch > > > HIVE-13625, Change sql statement split when odd number of escape characters, > and add parameter counter validation, above > {code:java} > // prev code > StringBuilder newSql = new StringBuilder(parts.get(0)); > for(int i=1;i if(!parameters.containsKey(i)){ > throw new SQLException("Parameter #"+i+" is unset"); > } > newSql.append(parameters.get(i)); > newSql.append(parts.get(i)); > } > // change from HIVE-13625 > int paramLoc = 1; > while (getCharIndexFromSqlByParamLocation(sql, '?', paramLoc) > 0) { > // check the user has set the needs parameters > if (parameters.containsKey(paramLoc)) { > int tt = getCharIndexFromSqlByParamLocation(newSql.toString(), '?', > 1); > newSql.deleteCharAt(tt); > newSql.insert(tt, parameters.get(paramLoc)); > } > paramLoc++; > } > {code} > If the number of split SQL and the number of parameters are not matched, an > SQLException is thrown > Currently, when splitting SQL, there is no processing for double quoted, and > when the token ('?' ) is between double quote, SQL is split. > i think when the token between double quoted is literal, it is correct to not > split. > for example, above the query; > {code:java} > // Some comments here > 1: String query = " select 1 from x where qa="?" " > 2: String query = " SELECT 1 FROM `x` WHERE (trecord LIKE "ALA[d_?]%") > {code} > ? is literal, then query do not split. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Updated] (HIVE-18268) Hive Prepared Statement when split with double quoted in query fails
[ https://issues.apache.org/jira/browse/HIVE-18268?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Choi JaeHwan updated HIVE-18268: Fix Version/s: 2.4.0 3.0.0 Status: Patch Available (was: Open) > Hive Prepared Statement when split with double quoted in query fails > > > Key: HIVE-18268 > URL: https://issues.apache.org/jira/browse/HIVE-18268 > Project: Hive > Issue Type: Bug > Components: JDBC >Affects Versions: 2.3.2 >Reporter: Choi JaeHwan >Assignee: Choi JaeHwan > Fix For: 3.0.0, 2.4.0, 2.3.3 > > Attachments: HIVE-18268.1.patch, HIVE-18268.2.patch, > HIVE-18268.3.patch, HIVE-18268.patch > > > HIVE-13625, Change sql statement split when odd number of escape characters, > and add parameter counter validation, above > {code:java} > // prev code > StringBuilder newSql = new StringBuilder(parts.get(0)); > for(int i=1;i if(!parameters.containsKey(i)){ > throw new SQLException("Parameter #"+i+" is unset"); > } > newSql.append(parameters.get(i)); > newSql.append(parts.get(i)); > } > // change from HIVE-13625 > int paramLoc = 1; > while (getCharIndexFromSqlByParamLocation(sql, '?', paramLoc) > 0) { > // check the user has set the needs parameters > if (parameters.containsKey(paramLoc)) { > int tt = getCharIndexFromSqlByParamLocation(newSql.toString(), '?', > 1); > newSql.deleteCharAt(tt); > newSql.insert(tt, parameters.get(paramLoc)); > } > paramLoc++; > } > {code} > If the number of split SQL and the number of parameters are not matched, an > SQLException is thrown > Currently, when splitting SQL, there is no processing for double quoted, and > when the token ('?' ) is between double quote, SQL is split. > i think when the token between double quoted is literal, it is correct to not > split. > for example, above the query; > {code:java} > // Some comments here > 1: String query = " select 1 from x where qa="?" " > 2: String query = " SELECT 1 FROM `x` WHERE (trecord LIKE "ALA[d_?]%") > {code} > ? is literal, then query do not split. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Updated] (HIVE-18268) Hive Prepared Statement when split with double quoted in query fails
[ https://issues.apache.org/jira/browse/HIVE-18268?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Choi JaeHwan updated HIVE-18268: Status: Open (was: Patch Available) > Hive Prepared Statement when split with double quoted in query fails > > > Key: HIVE-18268 > URL: https://issues.apache.org/jira/browse/HIVE-18268 > Project: Hive > Issue Type: Bug > Components: JDBC >Affects Versions: 2.3.2 >Reporter: Choi JaeHwan >Assignee: Choi JaeHwan > Fix For: 3.0.0, 2.4.0, 2.3.3 > > Attachments: HIVE-18268.1.patch, HIVE-18268.2.patch, > HIVE-18268.3.patch, HIVE-18268.patch > > > HIVE-13625, Change sql statement split when odd number of escape characters, > and add parameter counter validation, above > {code:java} > // prev code > StringBuilder newSql = new StringBuilder(parts.get(0)); > for(int i=1;i if(!parameters.containsKey(i)){ > throw new SQLException("Parameter #"+i+" is unset"); > } > newSql.append(parameters.get(i)); > newSql.append(parts.get(i)); > } > // change from HIVE-13625 > int paramLoc = 1; > while (getCharIndexFromSqlByParamLocation(sql, '?', paramLoc) > 0) { > // check the user has set the needs parameters > if (parameters.containsKey(paramLoc)) { > int tt = getCharIndexFromSqlByParamLocation(newSql.toString(), '?', > 1); > newSql.deleteCharAt(tt); > newSql.insert(tt, parameters.get(paramLoc)); > } > paramLoc++; > } > {code} > If the number of split SQL and the number of parameters are not matched, an > SQLException is thrown > Currently, when splitting SQL, there is no processing for double quoted, and > when the token ('?' ) is between double quote, SQL is split. > i think when the token between double quoted is literal, it is correct to not > split. > for example, above the query; > {code:java} > // Some comments here > 1: String query = " select 1 from x where qa="?" " > 2: String query = " SELECT 1 FROM `x` WHERE (trecord LIKE "ALA[d_?]%") > {code} > ? is literal, then query do not split. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Updated] (HIVE-18268) Hive Prepared Statement when split with double quoted in query fails
[ https://issues.apache.org/jira/browse/HIVE-18268?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Choi JaeHwan updated HIVE-18268: Status: Patch Available (was: Open) > Hive Prepared Statement when split with double quoted in query fails > > > Key: HIVE-18268 > URL: https://issues.apache.org/jira/browse/HIVE-18268 > Project: Hive > Issue Type: Bug > Components: JDBC >Affects Versions: 2.3.2 >Reporter: Choi JaeHwan >Assignee: Choi JaeHwan > Fix For: 3.0.0, 2.4.0, 2.3.3 > > Attachments: HIVE-18268.1.patch, HIVE-18268.2.patch, > HIVE-18268.3.patch, HIVE-18268.4.patch, HIVE-18268.patch > > > HIVE-13625, Change sql statement split when odd number of escape characters, > and add parameter counter validation, above > {code:java} > // prev code > StringBuilder newSql = new StringBuilder(parts.get(0)); > for(int i=1;i if(!parameters.containsKey(i)){ > throw new SQLException("Parameter #"+i+" is unset"); > } > newSql.append(parameters.get(i)); > newSql.append(parts.get(i)); > } > // change from HIVE-13625 > int paramLoc = 1; > while (getCharIndexFromSqlByParamLocation(sql, '?', paramLoc) > 0) { > // check the user has set the needs parameters > if (parameters.containsKey(paramLoc)) { > int tt = getCharIndexFromSqlByParamLocation(newSql.toString(), '?', > 1); > newSql.deleteCharAt(tt); > newSql.insert(tt, parameters.get(paramLoc)); > } > paramLoc++; > } > {code} > If the number of split SQL and the number of parameters are not matched, an > SQLException is thrown > Currently, when splitting SQL, there is no processing for double quoted, and > when the token ('?' ) is between double quote, SQL is split. > i think when the token between double quoted is literal, it is correct to not > split. > for example, above the query; > {code:java} > // Some comments here > 1: String query = " select 1 from x where qa="?" " > 2: String query = " SELECT 1 FROM `x` WHERE (trecord LIKE "ALA[d_?]%") > {code} > ? is literal, then query do not split. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Updated] (HIVE-18268) Hive Prepared Statement when split with double quoted in query fails
[ https://issues.apache.org/jira/browse/HIVE-18268?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Choi JaeHwan updated HIVE-18268: Attachment: HIVE-18268.4.patch > Hive Prepared Statement when split with double quoted in query fails > > > Key: HIVE-18268 > URL: https://issues.apache.org/jira/browse/HIVE-18268 > Project: Hive > Issue Type: Bug > Components: JDBC >Affects Versions: 2.3.2 >Reporter: Choi JaeHwan >Assignee: Choi JaeHwan > Fix For: 3.0.0, 2.4.0, 2.3.3 > > Attachments: HIVE-18268.1.patch, HIVE-18268.2.patch, > HIVE-18268.3.patch, HIVE-18268.4.patch, HIVE-18268.patch > > > HIVE-13625, Change sql statement split when odd number of escape characters, > and add parameter counter validation, above > {code:java} > // prev code > StringBuilder newSql = new StringBuilder(parts.get(0)); > for(int i=1;i if(!parameters.containsKey(i)){ > throw new SQLException("Parameter #"+i+" is unset"); > } > newSql.append(parameters.get(i)); > newSql.append(parts.get(i)); > } > // change from HIVE-13625 > int paramLoc = 1; > while (getCharIndexFromSqlByParamLocation(sql, '?', paramLoc) > 0) { > // check the user has set the needs parameters > if (parameters.containsKey(paramLoc)) { > int tt = getCharIndexFromSqlByParamLocation(newSql.toString(), '?', > 1); > newSql.deleteCharAt(tt); > newSql.insert(tt, parameters.get(paramLoc)); > } > paramLoc++; > } > {code} > If the number of split SQL and the number of parameters are not matched, an > SQLException is thrown > Currently, when splitting SQL, there is no processing for double quoted, and > when the token ('?' ) is between double quote, SQL is split. > i think when the token between double quoted is literal, it is correct to not > split. > for example, above the query; > {code:java} > // Some comments here > 1: String query = " select 1 from x where qa="?" " > 2: String query = " SELECT 1 FROM `x` WHERE (trecord LIKE "ALA[d_?]%") > {code} > ? is literal, then query do not split. -- This message was sent by Atlassian JIRA (v6.4.14#64029)