Hi Team,
I have my use where I need to convert my dialect specific stored procedure
constructs like while loop, If then else to Rel expression
Basically this can contain control flow statements like below
DECLARE heads BOOL;
DECLARE heads_count INT64 DEFAULT 0;
LOOP
SET heads = RAND() < 0.5;
IF heads THEN
SELECT 'Heads!';
SET heads_count = heads_count + 1;
ELSE
SELECT 'Tails!';
BREAK;
END IF;
END LOOP;
SELECT CONCAT(CAST(heads_count AS STRING), ' heads in a row');
I can create a Java AST model from the linq4j provided by calcite however
this is only going to generate Java Result and I believe its only used by
the calcite for relational expressions of enumerable calling convention
which is used by adapters which does not support core relational operations
right?
Is there a way I can convert the stored proc constructs into some canonical
form like Rel Tree and back to Stored proc of target dialect.
--
Thanks,
Ravi