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

Julian Hyde commented on OPTIQ-333:
-----------------------------------

How about iterating? Then you can put the complexity outside the schema rather 
than in it.

{code:java}
DrillSchema schema;
for (;;) {
  try {
    validate(sql);
    break;
  } catch (TableNotFound e) {
    schema.add(e.tableName(), createDummyTableDef());
    schema.invalidate(System.currentTimeMillis());
  }
}
{code}


> Abstract OptiqSchema as a base class and move the existing implementation to 
> a separate class
> ---------------------------------------------------------------------------------------------
>
>                 Key: OPTIQ-333
>                 URL: https://issues.apache.org/jira/browse/OPTIQ-333
>             Project: Optiq
>          Issue Type: Improvement
>            Reporter: Jacques Nadeau
>            Assignee: Jacques Nadeau
>
> The implementation of OptiqSchema can make users jump through many hoops 
> because it holds a complex hold internal state.  A couple of times now, 
> efforts to move Apache Drill to newer versions of Optiq has required all 
> schema management code to be rewritten as the nature of the internally 
> maintained state has changed.  As such, this JIRA is about abstracting out 
> the core interface and providing an alternative, near stateless 
> implementation.  Existing tools will continue to leverage the traditional 
> existing implementation.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to