[JBoss JIRA] (TEIIDDES-1614) Procedure result set not being generated when creating simple CREATE VIRTUAL PROCEDURE from SQL
by Paul Richardson (JIRA)
[ https://issues.jboss.org/browse/TEIIDDES-1614?page=com.atlassian.jira.plu... ]
Paul Richardson commented on TEIIDDES-1614:
-------------------------------------------
The 8.2/8.3 implementation still fails to resolve the project symbols.
Using the parts project, the following error is generated from the SQL.
"The SELECT transformation is valid, but NOT fully reconciled: The number of transformation output symbols is zero."
{code:SQL}
CREATE VIRTUAL PROCEDURE
BEGIN
DECLARE string VARIABLES.IN_exampleVar;
VARIABLES.IN_exampleVar = xPathValue(null, '//*[local-name()="exampleName"]');
SELECT * FROM PartsXMLViewOutput_View.PartsXMLViewTable_OutputView;
END
{code}
The reason for the error is removal of code between the 7.7 and 8.2 teiid code streams.
When a project is loaded containing a virtual procedure, it is validated and resolved by the transformation validator.
In 8.2, resolution of the CreateProcedureCommand passes through TransformationMetadata.getStoredProcInfoDirect(). The output symbols are determined by this method using the ColumnSetRecordImpl.getColumnsIDs(). Now when the validator first validates the project on import, this returns empty
However, when the webservice model is opened it calls:
OperationObjectEditorPage.setEditorContent ->
TransformationMappingHelper.reconcileTargetAttributes
The reconciling of attributes determines 2 variables:
* currentTargetAttrNames
* projectedSymbolNames
Both are empty in 8.2 so nothing more occurs. However, in 7.7 projectSymbolsNames contains "xml" and as a consequence the TransformationMappingHelper calls addTargetAttributes() correcting the validity error. So why doesn't 8.2 do the same?
The reason:
Teiid's CreateUpdateProcedureCommand and CreateProcedureCommand have changed in that:
{code}
public List getProjectedSymbols(){
if(this.projectedSymbols != null){
return this.projectedSymbols;
}
- if(!isUpdateProcedure){
- if(this.resultsCommand == null){
- //user may have not entered any query yet
- return Collections.EMPTY_LIST;
- }
- List<? extends SingleElementSymbol> symbols = this.resultsCommand.getProjectedSymbols();
- if (this.resultsCommand instanceof StoredProcedure) {
- StoredProcedure sp = (StoredProcedure)this.resultsCommand;
- if (sp.isCallableStatement()) {
- symbols = sp.getResultSetColumns();
- }
- }
- setProjectedSymbols(symbols);
- return this.projectedSymbols;
- }
- this.projectedSymbols = Command.getUpdateCommandSymbol();
- return this.projectedSymbols;
+ //user may have not entered any query yet
+ return Collections.EMPTY_LIST;
}
{code}
The removed code extracts the projected symbols from the embedded resultsCommand (a Query and is the same between 7.7 and 8.2). This is responsible for creating the crucial xml elementSymbol.
To resolve the problem:
* Understand why these classes were modified in Teiid and address appropriately
* Should the removed code be added to the postResolveCommand method of the resolver for 8.2?
> Procedure result set not being generated when creating simple CREATE VIRTUAL PROCEDURE from SQL
> -----------------------------------------------------------------------------------------------
>
> Key: TEIIDDES-1614
> URL: https://issues.jboss.org/browse/TEIIDDES-1614
> Project: Teiid Designer
> Issue Type: Bug
> Components: Modeling, Validation
> Affects Versions: 8.1
> Reporter: Barry LaFond
> Assignee: Paul Richardson
> Fix For: 8.1
>
> Attachments: DynamicSQLMPS.zip
>
>
> Designer 7.7.x will auto-generated the virtual procedure result set and columns after pasting in the following:
> CREATE VIRTUAL PROCEDURE
> BEGIN
> SELECT * FROM PARTS;
> END
> Current Designer 8.1 codebase results in valid SQL (no errors) but the result set and columns are not generated.
> When creating a Web Service Model/Operation from same PARTS source table the resulting Operation will have a resulting OUTPUT (result set) but no output column with XML type
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira