[
https://issues.apache.org/jira/browse/PHOENIX-6357?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17341536#comment-17341536
]
ASF GitHub Bot commented on PHOENIX-6357:
-----------------------------------------
stoty commented on a change in pull request #1184:
URL: https://github.com/apache/phoenix/pull/1184#discussion_r628905242
##########
File path:
phoenix-core/src/main/java/org/apache/phoenix/mapreduce/AbstractBulkLoadTool.java
##########
@@ -181,40 +181,12 @@ public int run(String[] args) throws Exception {
return loadData(conf, cmdLine);
}
- /**
- * Check schema or table name that start with two double quotes i.e ""t""
-> true
- */
- private boolean isStartWithTwoDoubleQuotes (String name) {
- boolean start = false;
- boolean end = false;
- if (name != null && name.length() > 1) {
- int length = name.length();
- start = name.substring(0,2).equals("\"\"");
- end = name.substring(length-2, length).equals("\"\"");
- if (start && !end) {
- throw new IllegalArgumentException("Invalid table/schema name
" + name +
- ". Please check if name end with two double quotes.");
- }
- }
- return start;
- }
-
private int loadData(Configuration conf, CommandLine cmdLine) throws
Exception {
String tableName = cmdLine.getOptionValue(TABLE_NAME_OPT.getOpt());
String schemaName = cmdLine.getOptionValue(SCHEMA_NAME_OPT.getOpt());
String indexTableName =
cmdLine.getOptionValue(INDEX_TABLE_NAME_OPT.getOpt());
- boolean quotedTableName = isStartWithTwoDoubleQuotes(tableName);
- if (quotedTableName) {
- // Commons-cli cannot parse full quoted argument i.e "t" (CLI-275).
- // if \"\"t\"\" passed, then both pairs of quoted are left intact
as ""t"".
- // So remove one pair of quote from tablename ""t"" -> "t".
- tableName = tableName.substring(1, tableName.length() - 1);
- }
- boolean quotedSchemaName = isStartWithTwoDoubleQuotes(schemaName);
- if (quotedSchemaName) {
- schemaName = schemaName.substring(1,schemaName.length() - 1);
- }
+
Review comment:
Yes, this was for the double doublequote hack to workaround CLI-254,
which we patch in phoenix-thirdparty now.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
> Change all command line tools to use the fixed commons-cli constructor
> ----------------------------------------------------------------------
>
> Key: PHOENIX-6357
> URL: https://issues.apache.org/jira/browse/PHOENIX-6357
> Project: Phoenix
> Issue Type: Improvement
> Components: core
> Reporter: Istvan Toth
> Assignee: Istvan Toth
> Priority: Major
>
> Creating DefaultParser with the new DefaultParser(true, false) or
> DefaultParser(false, false)
> constructors will not mangle the double quotes for our tools.
> Change all tools to use that.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)