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

Maryann Xue commented on CALCITE-1941:
--------------------------------------

bq. Should we also change Schema.contentsHaveChangedSince(long, long)?
Actually I had thought about this while I was working on this issue. My 
conclusion now is that now that we create a new Schema snapshot at the 
beginning of each query compilation, we should remove this interface at all. 
Thus the only difference between a CachingCalciteSchema and a 
SimpleCalciteSchema will be whether the list of schema object names is 
pre-loaded or not.
bq. I notice that distributed systems clocks e.g. Lamport timestamps typically 
use a strict partial order (i.e. !a.happensBefore(a)). Do you think ours be 
strict also?
If we remove the above interface, this won't seem to matter to Calcite any 
more. It's all up to user to figure out what to do in creating a schema 
snapshot, although I prefer changing the interface to "lessThan" or "before" 
and requires it to be strict.


> Refine interface Schema#snapshot()
> ----------------------------------
>
>                 Key: CALCITE-1941
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1941
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.13.0
>            Reporter: Maryann Xue
>            Assignee: Maryann Xue
>            Priority: Minor
>             Fix For: 1.14.0
>
>
> The current Schema#snapshot(long timestamp) interface is limited, for it 
> assumes that users only use timestamp for schema version control, thus we 
> need something new to replace the "timestamp" parameter.
> So we'll introduce a SchemaVersion interface with a partial ordering contract 
> that is:
> 1) Reflexive: if a.equals(b) then a.lessThanOrEqualTo(b);
> 2) Transitive: if a. lessThanOrEqualTo(b) and b. lessThanOrEqualTo(c) then 
> a.lessThanOrEqualTo(c);
> and 3) anti-symmetric: if a.lessThanOrEqualTo(b) and !a.equals(b) then 
> !b.lessThanOrEqualTo(a);
> User can implement their own SchemaVersion, which, aside from following the 
> partial ordering contract, must also override {{equals()}}, {{hashCode()}} 
> and {{toString()}}, so that user can, through overriding 
> {{CalciteConnection#createPrepareContext()}}, create a Schema snapshot of a 
> specific SchemaVersion used by the prepare context.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to