julianhyde commented on issue #1229: [CALCITE-3085] Remove RelShuttleImpl#stack 
protected field
URL: https://github.com/apache/calcite/pull/1229#issuecomment-496681425
 
 
   Has this issue shown up empirically?
   
   The stack is implemented as an `ArrayDeque`, so push and pop should be very 
few machine instructions.
   
   `RelShuttleImpl` is not the only possible implementation of `RelShuttle`. It 
is just a good general-purpose implementation. If it doesn't meet your needs, 
you can create your own.
   
   No sub-classes in Calcite use the `stack` field, but it's there, and it is 
potentially useful, if I am looking for say a `Filter` within a `Project` 
within a `Filter`.
   
   Consider `AbstractList` class in the JDK. It contains a `modCount` field is 
useful for most implementations (prevents concurrent modifications) but is 
unnecessary overhead for sub-classes that are immutable. To avoid that 
overhead, I created `AbstractImmutableList`, but I wouldn't suggest removing 
`modCount` from `AbstractList`.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to