From 7f8443c5ddb367eda4fc40c89b65eb13d1f96741 Mon Sep 17 00:00:00 2001 From: Jimmy Lu Date: Fri, 9 Aug 2024 16:30:09 -0700 Subject: [PATCH] Add document for flatten optimization in PeeledEncoding Summary: Follow up on https://github.com/facebookincubator/velox/pull/10521#discussion_r1712261760. Differential Revision: D61053625 --- velox/expression/PeeledEncoding.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/velox/expression/PeeledEncoding.h b/velox/expression/PeeledEncoding.h index f15ec6b18385..83db7972b464 100644 --- a/velox/expression/PeeledEncoding.h +++ b/velox/expression/PeeledEncoding.h @@ -32,6 +32,11 @@ class LocalSelectivityVector; /// translate top level rows into inner rows and wrap a vector (typically /// generated as a result of applying an expression on the peeled vectors). /// +/// When the base vector size is larger than 8 times of the selected rows, we do +/// not save the dictionary wrapping. Instead we store a flatten version of the +/// selected rows and return them when needed. The wrapping in this case is +/// kept as FLAT, and the inner/outer rows translation will be identical. +/// /// Typical usage pattern for peeling includes: /// (See Expr::applyFunctionWithPeeling() for example usage) /// 1. peeling a set of input vectors