[ 
https://issues.apache.org/jira/browse/CALCITE-2208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16392095#comment-16392095
 ] 

Julian Hyde commented on CALCITE-2208:
--------------------------------------

The materialized view doesn't belong to the current connection, nor does it 
necessarily "belong to the schema". The current implementation is 
quick-and-dirty but it doesn't need to be replaced with a different 
quick-and-dirty.

Materialized views are not exactly the same as views, but I'll remark that for 
a view, the right thing is to remember the environment where the view was 
created (e.g. the lexical convention in use, and the access control 
environment) and apply the same environment when the view is used (i.e. 
expanded in a query). Maybe for materialized views we need to capture the 
environment when they were created. MATERIALIZATION_CONNECTION should be a 
connection factory (perhaps pooling behind the scenes, perhaps not) that can 
create connections with a particular environment. Perhaps they're not even 
full-blown connections, just a context in which a query can be prepared.

> MaterializedViewTable.MATERIALIZATION_CONNECTION breaks lex and case 
> sensitivity for end user
> ---------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-2208
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2208
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.15.0, 1.16.0
>            Reporter: Piotr Bojko
>            Assignee: Julian Hyde
>            Priority: Major
>
> MaterializedViewTable.MATERIALIZATION_CONNECTION used for validating views 
> uses ORACLE lex by default. Calcite expands the view sql to uppercase so when 
> schemas used in such view sql are used are declared in lowercase - Calcite 
> does not find needed objects to resolve and validate the view sql.
> It does really not work even when end user creates connection with 
> lex=oracle, but uses uppercase for the names of its tables. 
> It would be best when MaterializedViewTable.MATERIALIZATION_CONNECTION would 
> be replaced by connection of an end user or dynamically created connection 
> with passed lex from end user connection. 
> Quick and dirty solution is to create 
> MaterializedViewTable.MATERIALIZATION_CONNECTION with caseSensitive=false;



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to