Skip to content

[SQL] --anonymize flag#5630

Open
mihaibudiu wants to merge 1 commit intomainfrom
issue5616
Open

[SQL] --anonymize flag#5630
mihaibudiu wants to merge 1 commit intomainfrom
issue5616

Conversation

@mihaibudiu
Copy link
Contributor

Fixes #5616

There's a test showing sample output.

@mihaibudiu mihaibudiu marked this pull request as draft February 14, 2026 00:05
@mihaibudiu
Copy link
Contributor Author

Still have an issue to fix with "jsonstring_as"

@mihaibudiu mihaibudiu marked this pull request as ready for review February 14, 2026 05:13
@mihaibudiu
Copy link
Contributor Author

This program:

CREATE TYPE TYP AS ("Z" INT);
CREATE FUNCTION jsonstring_as_typ(l VARCHAR) RETURNS TYP;
CREATE TABLE T(x INT, y INT LATENESS 0, "Z" TYP ARRAY, W STRING) WITH ('connectors' = '[]');
CREATE VIEW V WITH ('emit_final' = 'y', 'connectors' = '[]') AS 
SELECT jsonstring_as_typ(W), y, SUM(T.x) as sum, COUNT(T."Z"[1]) FROM T GROUP BY T.y, W;

is converted to:

CREATE TYPE ID_0 AS (ID_1 INTEGER);
CREATE FUNCTION jsonstring_as_ID_0 (ID_3 VARCHAR) RETURNS ID_0;
CREATE TABLE ID_4 (ID_5 INTEGER, ID_6 INTEGER LATENESS 0, ID_1 ID_0 ARRAY, ID_7 string);
CREATE VIEW ID_8 WITH ('emit_final' = 'ID_6') AS
SELECT jsonstring_as_ID_0(ID_7), ID_6, SUM(ID_4.ID_5) AS ID_9, COUNT(ID_4.ID_1[1])
FROM ID_4
GROUP BY ID_4.ID_6, ID_7;

The program should functionally equivalent with the original one.
Notice that all connector information is stripped.

Signed-off-by: Mihai Budiu <mbudiu@feldera.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SQL] Build a tool to anonymize SQL programs

1 participant