[teiid-issues] [JBoss JIRA] (TEIID-3439) Add support for aliases with .

Steven Hawkins (JIRA) issues at jboss.org
Fri Jun 8 11:01:00 EDT 2018


    [ https://issues.jboss.org/browse/TEIID-3439?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13588772#comment-13588772 ] 

Steven Hawkins edited comment on TEIID-3439 at 6/8/18 11:00 AM:
----------------------------------------------------------------

Updated the logic to relax the parsing restriction and the sql string logic to support table aliases with .

This effectively gives 4 modes to the id parsing:

any id
short name, not an alias
short name alias
single identifier part - added as a post validation method

A known issue is that the logic can not distinguish between a fully qualified name and an alias with a ., for example:

{code}
select "pm1.g2".*, pm1.g2.* from pm1.g1 as "pm1.g2", pm1.g2
{code}

Results in a resolving exception.  However 

{code}
select "pm1.g2".* from pm1.g1 as "pm1.g2"
{code}

will resolve locally against the alias as expected and not produce an exception.

You can also do:

{code}
select pm1.g2.* from pm1.g1 as "pm1.g2"
{code}

which is not desirable, but mirrors our overall laxity in name resolution.



was (Author: shawkins):
Updated the logic to relax the parsing restriction and the sql string logic to support table aliases with .

This effectively gives 4 modes to the id parsing:

any id
short name, not an alias
short name alias
single identifier part - added as a post validation method

A known issue is that the logic can not distinguish between a fully qualified name and an alias with a ., for example:

select "pm1.g2".*, pm1.g2.* from pm1.g1 as "pm1.g2", pm1.g2

Results in a resolving exception.  However 

select "pm1.g2".* from pm1.g1 as "pm1.g2"

will resolve locally against the alias as expected and not produce an exception.

You can also do:

select pm1.g2.* from pm1.g1 as "pm1.g2"

which is not desirable, but mirrors our overall laxity in name resolution.


> Add support for aliases with .
> ------------------------------
>
>                 Key: TEIID-3439
>                 URL: https://issues.jboss.org/browse/TEIID-3439
>             Project: Teiid
>          Issue Type: Feature Request
>          Components: Query Engine
>            Reporter: Steven Hawkins
>            Assignee: Steven Hawkins
>             Fix For: 11.0
>
>
> We currently don't allow column or table aliases to contain '.'. This is allowable given a quoted identifier is used.  However an early design decision of metamatrix was to relax the rules of naming so that queries against the engine could use quoting (on not) similar to whatever was expected by a given database rather than the engine structure.  A lot of resolving and parsing logic will need to change unfortunately to fix this.



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the teiid-issues mailing list