@Test public void testParseDescNegative1() throws Exception { ExtendedSqlStatement extendedSqlStatement = metaStatementMatcher.parse(" \tDeSc \tEuRopa aa"); Assert.assertNull(extendedSqlStatement); }
public ExtendedSqlStatement parse(final String fql) { if(fql.matches(DESC_STATEMENT_MATCH)) { final String[] parts = fql.split(DESC_STATEMENT_DELIMITER); if(parts.length != 2) { throw new FqlParsingException("Could not decode table name from desc statement. Table name format is: [a-zA-Z-_]+"); } return new Describe(new Table(parts[1].toLowerCase())); } if(fql.matches(SHOWTABLES_STATEMENT_MATCH)) { return new ShowTables(); } return null; }
MetaStatementMatcher { public ExtendedSqlStatement parse(final String fql) { if(fql.matches(DESC_STATEMENT_MATCH)) { final String[] parts = fql.split(DESC_STATEMENT_DELIMITER); if(parts.length != 2) { throw new FqlParsingException("Could not decode table name from desc statement. Table name format is: [a-zA-Z-_]+"); } return new Describe(new Table(parts[1].toLowerCase())); } if(fql.matches(SHOWTABLES_STATEMENT_MATCH)) { return new ShowTables(); } return null; } }
MetaStatementMatcher { public ExtendedSqlStatement parse(final String fql) { if(fql.matches(DESC_STATEMENT_MATCH)) { final String[] parts = fql.split(DESC_STATEMENT_DELIMITER); if(parts.length != 2) { throw new FqlParsingException("Could not decode table name from desc statement. Table name format is: [a-zA-Z-_]+"); } return new Describe(new Table(parts[1].toLowerCase())); } if(fql.matches(SHOWTABLES_STATEMENT_MATCH)) { return new ShowTables(); } return null; }  }
MetaStatementMatcher { public ExtendedSqlStatement parse(final String fql) { if(fql.matches(DESC_STATEMENT_MATCH)) { final String[] parts = fql.split(DESC_STATEMENT_DELIMITER); if(parts.length != 2) { throw new FqlParsingException("Could not decode table name from desc statement. Table name format is: [a-zA-Z-_]+"); } return new Describe(new Table(parts[1].toLowerCase())); } if(fql.matches(SHOWTABLES_STATEMENT_MATCH)) { return new ShowTables(); } return null; }  ExtendedSqlStatement parse(final String fql); }
MetaStatementMatcher { public ExtendedSqlStatement parse(final String fql) { if(fql.matches(DESC_STATEMENT_MATCH)) { final String[] parts = fql.split(DESC_STATEMENT_DELIMITER); if(parts.length != 2) { throw new FqlParsingException("Could not decode table name from desc statement. Table name format is: [a-zA-Z-_]+"); } return new Describe(new Table(parts[1].toLowerCase())); } if(fql.matches(SHOWTABLES_STATEMENT_MATCH)) { return new ShowTables(); } return null; }  ExtendedSqlStatement parse(final String fql);  }