The digest is used everywhere (RelNode, RexNode, DataType), causing OOM easily for large queries or with complex expressions. Datatype is cached in global interner and can be reused. Unlike RelNode, RexNode is not stored in MEMO as a GROUP, causing it can't be shared. This makes Calcite can't scale for large queries, e.g. CALCITE-3784.