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

Julian Hyde commented on HIVE-12839:
------------------------------------

It's not essential, but I recommend storing RelMetadataQuery.instance() in a 
variable if you are going to use it more than once in a method or rule 
invocation. We plan (as part of CALCITE-604) to cache results in the 
RelMetadataQuery instance, so if you keep the same instance you'll have to do 
less work. You should *definitely* use the same instance when one metadata 
method calls another.

Of course we'd like to cache results BETWEEN calls but I don't know how much we 
can safely cache when the graph is mutating.

Also, very minor, but I have a convention of naming RelMetadataQuery variables 
{{mq}}. They crop up a lot, so you don't want a long name, and a consistent 
short name helps you find one if it is around in the same method.

> Upgrade Hive to Calcite 1.6
> ---------------------------
>
>                 Key: HIVE-12839
>                 URL: https://issues.apache.org/jira/browse/HIVE-12839
>             Project: Hive
>          Issue Type: Improvement
>            Reporter: Pengcheng Xiong
>            Assignee: Pengcheng Xiong
>         Attachments: HIVE-12839.01.patch, HIVE-12839.02.patch, 
> HIVE-12839.03.patch, HIVE-12839.04.patch
>
>
> CLEAR LIBRARY CACHE
> Upgrade Hive to Calcite 1.6.0-incubating.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to