Skip to main content

normalize

Function normalize 

Source
pub fn normalize(
    arena: &mut MorselArena,
    form: NormalForm,
    v: &ValueVector,
) -> Result<ValueVector>
Expand description

Evaluate NORMALIZE(v, form) into a new flat string vector.

This is the string function the builder was built for. A trim answers a part of what it was handed and a fold answers something exactly as long, so both of them know where the answer’s bytes are going before they start. A normal form knows neither: composing makes a string shorter, decomposing makes it longer, and how much either way is a fact about the characters rather than about the count of them. So the answers are written out and the room for them is a guess, the argument’s own long bytes, which is right for everything a query normally holds and grows when it is not.

The one shape that costs nothing is the one nearly every column is: all ASCII, where the answers are the argument’s own strings and the vector hands its buffers over the way a trim does.