]
Barry LaFond resolved TEIIDDES-490.
-----------------------------------
Resolution: Done
Basically Designer's transformation Optimizer framework was messing things up.
SymbolUUIDMappingVisitor needed to have it's visit(AliasSymbol obj) method overridden
to prevent the single element case. (See Below)
/**
* @see
org.teiid.query.sql.LanguageVisitor#visit(org.teiid.query.sql.symbol.AliasSymbol)
*/
public void visit(AliasSymbol obj) {
Expression replacement = replaceExpression(obj.getSymbol());
if (replacement instanceof SingleElementSymbol) {
// DO NOTHING. Don't need to convert A.ColumnName since it's already
aliased.
// Converting would change it to A.ModelName.TableName.ColumnName which defeats
the purpose
// of the Alias
} else {
obj.setSymbol(new ExpressionSymbol(obj.getName(), obj.getSymbol()));
}
}
Validation of transformation SQL with sub-select and alias
incorrectly adds model name to alias.column name
-----------------------------------------------------------------------------------------------------------
Key: TEIIDDES-490
URL:
https://jira.jboss.org/browse/TEIIDDES-490
Project: Teiid Designer
Issue Type: Bug
Components: Transformations
Affects Versions: 7.0
Environment: Fedora 12, OpenJDK, Designer 6/28
Reporter: Paul Nittel
Assignee: Barry LaFond
Priority: Blocker
Fix For: 7.1
Attachments: Query7.zip
This is from teh TPCR metadata text import test. A series of transformations is built for
query testing. When I ran it, several transformations were affected similarly. The Hawkman
looked at it and believes the issue lies within the Designer. Here's a simplified
version of the SQL:
SELECT supp_nation, cust_nation
FROM (SELECT n1.N_NAME AS supp_nation, n2.N_NAME AS cust_nation FROM TPCR.SUPPLIER,
TPCR.NATION AS n1, TPCR.NATION AS n2
WHERE (S_NATIONKEY = n1.N_NATIONKEY) ) AS shipping
Upon validation, it changes to:
SELECT
SHIPPING.supp_nation, SHIPPING.cust_nation
FROM
(SELECT n1.TPCR.NATION.N_NAME AS supp_nation, n2.TPCR.NATION.N_NAME AS cust_nation FROM
TPCR.SUPPLIER, TPCR.NATION AS n1, TPCR.NATION AS n2 WHERE TPCR.SUPPLIER.S_NATIONKEY =
n1.TPCR.NATION.N_NATIONKEY) AS shipping
The error is:
The query is parsable but not resolvable.
Resolver Error: Symbol n1.TPCR.NATION.N_NATIONKEY is specified with an unknown group
context
The element in question should be referred to as: n1.N_NATIONKEY. (I'll attach the
model project set.)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: