Skip to content

A SQL function obfuscateQuery #98010

@alexey-milovidov

Description

@alexey-milovidov

Company or project name

ClickHouse

Use case

An easy way to show and share an obfuscated query.

Describe the solution you'd like

A set of regular functions:

obfuscateQuery(query) -- perform obfuscation with a random seed
obfuscateQuery(query, tag) -- like the `rand` function, a tag allows for inhibiting common subexpression elimination
obfuscateQueryWithSeed(query, seed) -- perform deterministic obfuscation with a specified seed

These function call obfuscateQueries (see obfuscateQueries.h/cpp).
Both query and seed can be constant or non-constant. Even if the query is constant, calling obfuscateQuery(query) on multiple rows will return multiple different obfuscated queries.

Describe alternatives you've considered

No response

Additional context

These functions will accept not only a single query, but also a string with multiple queries - this is okay.

See also formatQuery.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions