richardantal edited a comment on pull request #1354:
URL: https://github.com/apache/phoenix/pull/1354#issuecomment-985576450
@Test
public void testCreateLocalIndexStatementLowerCase() throws Exception {
String tableName = generateUniqueName();
String schemaName = generateUniqueName();
String indexName = generateUniqueName();
String properties =
"TTL=2592000,IMMUTABLE_ROWS=true,DISABLE_WAL=true";
String pTableFullName = SchemaUtil.getQualifiedTableName(schemaName,
tableName);
String createTableStatement = "CREATE TABLE "+pTableFullName + "(k
VARCHAR NOT NULL PRIMARY KEY, \"v1\" VARCHAR, v2 VARCHAR)"
+ properties;
String createIndexStatement = "CREATE LOCAL INDEX "+indexName + " ON
"+pTableFullName+"( LPAD(\"v1\",10) DESC, k) INCLUDE (v2)";
List<String> queries = new ArrayList<String>(){};
queries.add(createTableStatement);
queries.add(createIndexStatement);
String result = runSchemaExtractionTool(schemaName, indexName, null,
queries);
Assert.assertEquals(createIndexStatement, result);
}
@Test
public void testCreateIndexStatementLowerCaseCombined() throws Exception
{
String tableName = "lowercase" + generateUniqueName();
String schemaName = "lowercase" + generateUniqueName();
String indexName = "\"lowercaseIND" + generateUniqueName() + "\"";
String properties =
"TTL=2592000,IMMUTABLE_ROWS=true,DISABLE_WAL=true";
String pTableFullName = SchemaUtil.getEscapedTableName(schemaName,
tableName);
String createTableStatement = "CREATE TABLE " + pTableFullName +
"(ID varchar primary key, \"number\" integer, CURRENCY decimal(6,2), lista
varchar[])"
+ properties;
String createIndexStatement = "CREATE INDEX " + indexName + " ON "+
pTableFullName + "(\"number\" * CURRENCY, ID) INCLUDE (LISTA)";
List<String> queries = new ArrayList<String>(){};
queries.add(createTableStatement);
queries.add(createIndexStatement);
String result = runSchemaExtractionTool("\"" + schemaName + "\"",
indexName, null, queries);
Assert.assertEquals(createIndexStatement, result);
}
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]