>>>inferred_schema.graphqls
type ArrayFunctions {
  listagg_example: String!
  arrayagg_example: [String]!
}

"An RFC-3339 compliant Full Date Scalar"
scalar Date

"A DateTime scalar that handles both full RFC3339 and shorter timestamp formats"
scalar DateTime

type FunctionCalls {
  log2_example: Float!
  log_nat_example: Float!
  log_base_example: Float!
  e_example: Float!
  rand_example: Boolean!
  rand_int_example: Boolean!
  uuid_example: Boolean!
  bin_example: String!
  hex_numeric_example: String!
  hex_string_example: String!
  truncate_scale_example: Float!
  truncate_default_example: Float!
  printf_example: String
  startswith_example: Boolean!
  endswith_example: Boolean!
  regexp_extract_example: String
  regexp_extract_group_example: String
  regexp_extract_all_example: [String]
  regexp_extract_all_group_example: [String]
  decode_example: String!
  encode_example: Boolean!
  from_base64_example: String!
  to_base64_example: String!
  instr_example: Int!
  regexp_example: Boolean!
  split_index_example: String
  split_index_expr_example: String
  elt_example: String
  try_cast_to_int_example: Int
  try_cast_to_bigint_example: Long
  try_cast_to_bool_example: Boolean
  try_cast_to_text_example: String
  try_cast_to_decimal_example: Float
  try_cast_to_timestamp_example: Boolean!
  try_cast_to_timestamptz_example: Boolean!
  now_example: Boolean!
  local_time_example: Boolean!
  local_timestamp_example: Boolean!
  current_time_example: Boolean!
  current_date_example: Boolean!
  current_timestamp_example: Boolean!
  year_example: Long!
  quarter_example: Long!
  month_example: Long!
  week_example: Long!
  dayofyear_example: Long!
  dayofmonth_example: Long!
  dayofweek_example: Long!
  hour_example: Long!
  minute_example: Long!
  second_example: Long!
  convert_tz_example: String
  unix_timestamp_now_example: Boolean!
  if_example: String!
  ifnull_example: String!
  is_alpha_example: Boolean!
  is_decimal_example: Boolean!
  is_digit_example: Boolean!
  element_example: Int!
  array_contains_example: Boolean!
  array_prepend_example: [String]!
  array_concat_example: [String]!
  array_remove_example: [String]!
  array_join_example: String!
  split_example: [String]
  sha1_example: String!
  sha224_example: String!
  sha256_example: String!
  sha384_example: String!
  sha512_example: String!
  the_end: String!
}

"A JSON scalar"
scalar JSON

"24-hour clock time value string in the format `hh:mm:ss` or `hh:mm:ss.sss`."
scalar LocalTime

"A 64-bit signed integer"
scalar Long

type Query {
  ArrayFunctions(limit: Int = 10, offset: Int = 0): [ArrayFunctions!]
  FunctionCalls(limit: Int = 10, offset: Int = 0): [FunctionCalls!]
}

enum _McpMethodType {
  NONE
  TOOL
  RESOURCE
}

enum _RestMethodType {
  NONE
  GET
  POST
}

directive @api(mcp: _McpMethodType, rest: _RestMethodType, uri: String) on QUERY | MUTATION | FIELD_DEFINITION

>>>pipeline_explain.txt
=== ArrayFunctions
ID:          default_catalog.default_database.ArrayFunctions
Type:        state
Stage:       postgres
Primary key: -
Timestamp:   -
Row count:   ~1
---
Schema:
 - listagg_example: CHAR(1) CHARACTER SET "UTF-16LE" NOT NULL
 - arrayagg_example: CHAR(1) CHARACTER SET "UTF-16LE" NOT NULL ARRAY NOT NULL
Inputs:
 - default_catalog.default_database._ArrayData

=== FunctionCalls
ID:          default_catalog.default_database.FunctionCalls
Type:        state
Stage:       postgres
Primary key: -
Timestamp:   -
Row count:   ~1e8
---
Schema:
 - log2_example: DOUBLE NOT NULL
 - log_nat_example: DOUBLE NOT NULL
 - log_base_example: DOUBLE NOT NULL
 - e_example: DOUBLE NOT NULL
 - rand_example: BOOLEAN NOT NULL
 - rand_int_example: BOOLEAN NOT NULL
 - uuid_example: BOOLEAN NOT NULL
 - bin_example: VARCHAR(2147483647) CHARACTER SET "UTF-16LE" NOT NULL
 - hex_numeric_example: VARCHAR(2147483647) CHARACTER SET "UTF-16LE" NOT NULL
 - hex_string_example: VARCHAR(2147483647) CHARACTER SET "UTF-16LE" NOT NULL
 - asdasd_example: VARBINARY(2147483647)
 - truncate_scale_example: DECIMAL(6, 2) NOT NULL
 - truncate_default_example: DECIMAL(4, 0) NOT NULL
 - printf_example: VARCHAR(2147483647) CHARACTER SET "UTF-16LE"
 - startswith_example: BOOLEAN NOT NULL
 - endswith_example: BOOLEAN NOT NULL
 - regexp_extract_example: VARCHAR(2147483647) CHARACTER SET "UTF-16LE"
 - regexp_extract_group_example: VARCHAR(2147483647) CHARACTER SET "UTF-16LE"
 - regexp_extract_all_example: VARCHAR(2147483647) CHARACTER SET "UTF-16LE" ARRAY
 - regexp_extract_all_group_example: VARCHAR(2147483647) CHARACTER SET "UTF-16LE" ARRAY
 - decode_example: VARCHAR(2147483647) CHARACTER SET "UTF-16LE" NOT NULL
 - encode_example: BOOLEAN NOT NULL
 - from_base64_example: VARCHAR(2147483647) CHARACTER SET "UTF-16LE" NOT NULL
 - to_base64_example: VARCHAR(2147483647) CHARACTER SET "UTF-16LE" NOT NULL
 - instr_example: INTEGER NOT NULL
 - regexp_example: BOOLEAN NOT NULL
 - split_index_example: VARCHAR(2147483647) CHARACTER SET "UTF-16LE"
 - split_index_expr_example: VARCHAR(2147483647) CHARACTER SET "UTF-16LE"
 - elt_example: VARCHAR(6) CHARACTER SET "UTF-16LE"
 - try_cast_to_int_example: INTEGER
 - try_cast_to_bigint_example: BIGINT
 - try_cast_to_bool_example: BOOLEAN
 - try_cast_to_text_example: VARCHAR(2147483647) CHARACTER SET "UTF-16LE"
 - try_cast_to_decimal_example: DECIMAL(10, 2)
 - try_cast_to_timestamp_example: BOOLEAN NOT NULL
 - try_cast_to_timestamptz_example: BOOLEAN NOT NULL
 - now_example: BOOLEAN NOT NULL
 - local_time_example: BOOLEAN NOT NULL
 - local_timestamp_example: BOOLEAN NOT NULL
 - current_time_example: BOOLEAN NOT NULL
 - current_date_example: BOOLEAN NOT NULL
 - current_timestamp_example: BOOLEAN NOT NULL
 - year_example: BIGINT NOT NULL
 - quarter_example: BIGINT NOT NULL
 - month_example: BIGINT NOT NULL
 - week_example: BIGINT NOT NULL
 - dayofyear_example: BIGINT NOT NULL
 - dayofmonth_example: BIGINT NOT NULL
 - dayofweek_example: BIGINT NOT NULL
 - hour_example: BIGINT NOT NULL
 - minute_example: BIGINT NOT NULL
 - second_example: BIGINT NOT NULL
 - convert_tz_example: VARCHAR(2147483647) CHARACTER SET "UTF-16LE"
 - unix_timestamp_now_example: BOOLEAN NOT NULL
 - if_example: VARCHAR(3) CHARACTER SET "UTF-16LE" NOT NULL
 - ifnull_example: VARCHAR(2147483647) CHARACTER SET "UTF-16LE" NOT NULL
 - is_alpha_example: BOOLEAN NOT NULL
 - is_decimal_example: BOOLEAN NOT NULL
 - is_digit_example: BOOLEAN NOT NULL
 - element_example: INTEGER NOT NULL
 - array_contains_example: BOOLEAN NOT NULL
 - array_prepend_example: CHAR(1) CHARACTER SET "UTF-16LE" NOT NULL ARRAY NOT NULL
 - array_concat_example: CHAR(1) CHARACTER SET "UTF-16LE" NOT NULL ARRAY NOT NULL
 - array_remove_example: CHAR(1) CHARACTER SET "UTF-16LE" NOT NULL ARRAY NOT NULL
 - array_join_example: VARCHAR(2147483647) CHARACTER SET "UTF-16LE" NOT NULL
 - split_example: VARCHAR(2147483647) CHARACTER SET "UTF-16LE" ARRAY
 - sha1_example: CHAR(40) CHARACTER SET "UTF-16LE" NOT NULL
 - sha224_example: CHAR(56) CHARACTER SET "UTF-16LE" NOT NULL
 - sha256_example: CHAR(64) CHARACTER SET "UTF-16LE" NOT NULL
 - sha384_example: CHAR(96) CHARACTER SET "UTF-16LE" NOT NULL
 - sha512_example: CHAR(128) CHARACTER SET "UTF-16LE" NOT NULL
 - the_end: CHAR(3) CHARACTER SET "UTF-16LE" NOT NULL
Inputs:
 - default_catalog.default_database._InputData

=== _ArrayData
ID:          default_catalog.default_database._ArrayData
Type:        state
Stage:       flink
Primary key: val
Timestamp:   -
Row count:   ~3
---
Schema:
 - val: CHAR(1) CHARACTER SET "UTF-16LE" NOT NULL

=== _InputData
ID:          default_catalog.default_database._InputData
Type:        state
Stage:       flink
Primary key: -
Timestamp:   -
Row count:   ~1
---
Schema:
 - dummy: INTEGER NOT NULL

>>>flink-sql-no-functions.sql
CREATE VIEW `_InputData`
AS
SELECT *
FROM (VALUES ROW(1)) AS `base` (`dummy`);
CREATE VIEW `FunctionCalls`
AS
SELECT `LOG2`(8) AS `log2_example`, `LOG`(10) AS `log_nat_example`, `LOG`(2, 8) AS `log_base_example`, `E`() AS `e_example`, RAND() IS NOT NULL AS `rand_example`, RAND_INTEGER(10) IS NOT NULL AS `rand_int_example`, `UUID`() IS NOT NULL AS `uuid_example`, `BIN`(10) AS `bin_example`, `HEX`(255) AS `hex_numeric_example`, `HEX`('AB') AS `hex_string_example`, `UNHEX`('4142') AS `asdasd_example`, TRUNCATE(123.456, 2) AS `truncate_scale_example`, TRUNCATE(123.456) AS `truncate_default_example`, `PRINTF`('%s %d %f %b', 'bob', 42, 0.5, TRUE) AS `printf_example`, `STARTSWITH`('FlinkSQL', 'Flink') AS `startswith_example`, `ENDSWITH`('FlinkSQL', 'SQL') AS `endswith_example`, `REGEXP_EXTRACT`('abc-123-def', '(\d+)') AS `regexp_extract_example`, `REGEXP_EXTRACT`('abc-123-def', '(\d+)', 1) AS `regexp_extract_group_example`, `REGEXP_EXTRACT_ALL`('a1b2c3', '(\d)') AS `regexp_extract_all_example`, `REGEXP_EXTRACT_ALL`('a1b2c3', '(\d)', 1) AS `regexp_extract_all_group_example`, `DECODE`(`ENCODE`('hi', 'UTF-8'), 'UTF-8') AS `decode_example`, `ENCODE`('hi', 'UTF-8') IS NOT NULL AS `encode_example`, `FROM_BASE64`(`TO_BASE64`('hello')) AS `from_base64_example`, `TO_BASE64`('hello') AS `to_base64_example`, `INSTR`('hello world', 'world') AS `instr_example`, `REGEXP`('foo123bar', '\d+') AS `regexp_example`, `SPLIT_INDEX`('a,b,c', ',', 1) AS `split_index_example`, `SPLIT_INDEX`('a,b,c', ',', 1 - 1) AS `split_index_expr_example`, `ELT`(2, 'first', 'second', 'third') AS `elt_example`, TRY_CAST('123' AS INTEGER) AS `try_cast_to_int_example`, TRY_CAST('112233445566778899' AS BIGINT) AS `try_cast_to_bigint_example`, TRY_CAST('true' AS BOOLEAN) AS `try_cast_to_bool_example`, TRY_CAST(123 AS VARCHAR) AS `try_cast_to_text_example`, TRY_CAST('123.45' AS DECIMAL(10, 2)) AS `try_cast_to_decimal_example`, TRY_CAST('2024-01-02 03:04:05' AS TIMESTAMP(3)) IS NOT NULL AS `try_cast_to_timestamp_example`, TRY_CAST('2024-01-02 03:04:05' AS TIMESTAMP_LTZ(3)) IS NOT NULL AS `try_cast_to_timestamptz_example`, `NOW`() IS NOT NULL AS `now_example`, LOCALTIME IS NOT NULL AS `local_time_example`, LOCALTIMESTAMP IS NOT NULL AS `local_timestamp_example`, CURRENT_TIME IS NOT NULL AS `current_time_example`, CURRENT_DATE IS NOT NULL AS `current_date_example`, CURRENT_TIMESTAMP IS NOT NULL AS `current_timestamp_example`, YEAR(DATE '2024-01-02') AS `year_example`, QUARTER(DATE '2024-01-02') AS `quarter_example`, MONTH(DATE '2024-01-02') AS `month_example`, WEEK(DATE '2024-01-02') AS `week_example`, DAYOFYEAR(DATE '2024-01-02') AS `dayofyear_example`, DAYOFMONTH(DATE '2024-01-02') AS `dayofmonth_example`, DAYOFWEEK(DATE '2024-01-02') AS `dayofweek_example`, HOUR(TIMESTAMP '2024-01-02 03:04:05') AS `hour_example`, MINUTE(TIMESTAMP '2024-01-02 03:04:05') AS `minute_example`, SECOND(TIMESTAMP '2024-01-02 03:04:05') AS `second_example`, `CONVERT_TZ`('2024-01-02 03:04:05', 'UTC', 'America/Los_Angeles') AS `convert_tz_example`, `UNIX_TIMESTAMP`() IS NOT NULL AS `unix_timestamp_now_example`, `IF`(1 < 2, 'yes', 'no') AS `if_example`, `IFNULL`(CAST(NULL AS STRING), 'fallback') AS `ifnull_example`, `IS_ALPHA`('OnlyLetters') AS `is_alpha_example`, `IS_DECIMAL`('123.45') AS `is_decimal_example`, `IS_DIGIT`('12345') AS `is_digit_example`, ELEMENT(ARRAY[3]) AS `element_example`, `ARRAY_CONTAINS`(ARRAY[1, 2, 3], 2) AS `array_contains_example`, `ARRAY_PREPEND`(ARRAY['b', 'c'], 'a') AS `array_prepend_example`, `ARRAY_CONCAT`(ARRAY['a', 'b'], ARRAY['c', 'd'], ARRAY['e']) AS `array_concat_example`, `ARRAY_REMOVE`(ARRAY['a', 'b', 'c'], 'b') AS `array_remove_example`, `ARRAY_JOIN`(ARRAY['a', NULL, 'c'], '-', '') AS `array_join_example`, `SPLIT`('a|b|c', '|') AS `split_example`, `SHA1`('hello') AS `sha1_example`, `SHA224`('hello') AS `sha224_example`, `SHA256`('hello') AS `sha256_example`, `SHA384`('hello') AS `sha384_example`, `SHA512`('hello') AS `sha512_example`, 'end' AS `the_end`
FROM `_InputData`;
CREATE VIEW `_ArrayData`
AS
SELECT *
FROM (VALUES ROW('x'),
   ROW('y'),
   ROW('z')) AS `t` (`val`);
CREATE VIEW `ArrayFunctions`
AS
SELECT LISTAGG(`val`, ',') AS `listagg_example`, ARRAY_AGG(`val`) AS `arrayagg_example`
FROM `_ArrayData`;
CREATE TABLE `_ArrayData_1` (
  `val` CHAR(1) CHARACTER SET `UTF-16LE` NOT NULL,
  PRIMARY KEY (`val`) NOT ENFORCED
)
WITH (
  'connector' = 'jdbc-sqrl',
  'driver' = 'org.postgresql.Driver',
  'password' = '${POSTGRES_PASSWORD}',
  'table-name' = '_ArrayData',
  'url' = 'jdbc:postgresql://${POSTGRES_AUTHORITY}',
  'username' = '${POSTGRES_USERNAME}'
);
CREATE TABLE `_InputData_2` (
  `dummy` INTEGER NOT NULL,
  `__pk_hash` INTEGER NOT NULL,
  PRIMARY KEY (`__pk_hash`) NOT ENFORCED
)
WITH (
  'connector' = 'jdbc-sqrl',
  'driver' = 'org.postgresql.Driver',
  'password' = '${POSTGRES_PASSWORD}',
  'table-name' = '_InputData',
  'url' = 'jdbc:postgresql://${POSTGRES_AUTHORITY}',
  'username' = '${POSTGRES_USERNAME}'
);
EXECUTE STATEMENT SET BEGIN
INSERT INTO `default_catalog`.`default_database`.`_ArrayData_1`
SELECT *
 FROM `default_catalog`.`default_database`.`_ArrayData`
;
INSERT INTO `default_catalog`.`default_database`.`_InputData_2`
 SELECT `dummy`, 1 AS `__pk_hash`
  FROM `default_catalog`.`default_database`.`_InputData`
 ;
 END
>>>postgres-schema.sql
CREATE TABLE IF NOT EXISTS "_ArrayData" ("val" TEXT NOT NULL, PRIMARY KEY ("val"));
CREATE TABLE IF NOT EXISTS "_InputData" ("dummy" INTEGER NOT NULL, "__pk_hash" INTEGER NOT NULL, PRIMARY KEY ("__pk_hash"))
>>>postgres-views.sql
CREATE OR REPLACE VIEW "ArrayFunctions"("listagg_example", "arrayagg_example") AS SELECT "string_agg"("val", ',') AS "listagg_example", ARRAY_AGG("val") AS "arrayagg_example"
FROM "_ArrayData";
CREATE OR REPLACE VIEW "FunctionCalls"("log2_example", "log_nat_example", "log_base_example", "e_example", "rand_example", "rand_int_example", "uuid_example", "bin_example", "hex_numeric_example", "hex_string_example", "asdasd_example", "truncate_scale_example", "truncate_default_example", "printf_example", "startswith_example", "endswith_example", "regexp_extract_example", "regexp_extract_group_example", "regexp_extract_all_example", "regexp_extract_all_group_example", "decode_example", "encode_example", "from_base64_example", "to_base64_example", "instr_example", "regexp_example", "split_index_example", "split_index_expr_example", "elt_example", "try_cast_to_int_example", "try_cast_to_bigint_example", "try_cast_to_bool_example", "try_cast_to_text_example", "try_cast_to_decimal_example", "try_cast_to_timestamp_example", "try_cast_to_timestamptz_example", "now_example", "local_time_example", "local_timestamp_example", "current_time_example", "current_date_example", "current_timestamp_example", "year_example", "quarter_example", "month_example", "week_example", "dayofyear_example", "dayofmonth_example", "dayofweek_example", "hour_example", "minute_example", "second_example", "convert_tz_example", "unix_timestamp_now_example", "if_example", "ifnull_example", "is_alpha_example", "is_decimal_example", "is_digit_example", "element_example", "array_contains_example", "array_prepend_example", "array_concat_example", "array_remove_example", "array_join_example", "split_example", "sha1_example", "sha224_example", "sha256_example", "sha384_example", "sha512_example", "the_end") AS SELECT LOG(2, 8) AS "log2_example", LN(10) AS "log_nat_example", LOG(2, 8) AS "log_base_example", EXP(1) AS "e_example", RANDOM() IS NOT NULL AS "rand_example", FLOOR(RANDOM() * 10) IS NOT NULL AS "rand_int_example", GEN_RANDOM_UUID() IS NOT NULL AS "uuid_example", TO_BIN(10) AS "bin_example", ENCODE(CONVERT_TO(255 ::text, 'UTF8'), 'hex') AS "hex_numeric_example", ENCODE(CONVERT_TO('AB' ::text, 'UTF8'), 'hex') AS "hex_string_example", CONVERT_FROM(DECODE('4142' ::text, 'hex'), 'UTF8') AS "asdasd_example", TRUNC(123.456, 2) AS "truncate_scale_example", TRUNC(123.456) AS "truncate_default_example", FORMAT('%s %s %s %s', 'bob', 42, 0.5, TRUE) AS "printf_example", STARTS_WITH('FlinkSQL', 'Flink') AS "startswith_example", RIGHT('FlinkSQL', CHAR_LENGTH('SQL')) = 'SQL' AS "endswith_example", REGEXP_SUBSTR('abc-123-def', '(\d+)') AS "regexp_extract_example", (REGEXP_MATCH('abc-123-def', '(\d+)'))[1] AS "regexp_extract_group_example", ARRAY (SELECT  m[1] FROM  REGEXP_MATCHES('a1b2c3', '(\d)', 'g')  AS m) AS "regexp_extract_all_example", ARRAY (SELECT  m[1] FROM  REGEXP_MATCHES('a1b2c3', '(\d)', 'g')  AS m) AS "regexp_extract_all_group_example", CONVERT_FROM(CONVERT_TO('hi', 'UTF-8'), 'UTF-8') AS "decode_example", CONVERT_TO('hi', 'UTF-8') IS NOT NULL AS "encode_example", CONVERT_FROM(DECODE(ENCODE(CONVERT_TO('hello', 'UTF8'), 'base64'), 'base64'), 'UTF8') AS "from_base64_example", ENCODE(CONVERT_TO('hello', 'UTF8'), 'base64') AS "to_base64_example", STRPOS('hello world', 'world') AS "instr_example", REGEXP_LIKE('foo123bar', '\d+') AS "regexp_example", SPLIT_PART('a,b,c', ',', 2) AS "split_index_example", SPLIT_PART('a,b,c', ',', 1 - 1 + 1) AS "split_index_expr_example", (ARRAY['first', 'second', 'third'])[3] AS "elt_example", CASE WHEN '123' ~ '^[+-]?[0-9]+$' THEN CAST('123' AS INTEGER) ELSE NULL END AS "try_cast_to_int_example", CASE WHEN '112233445566778899' ~ '^[+-]?[0-9]+$' THEN CAST('112233445566778899' AS BIGINT) ELSE NULL END AS "try_cast_to_bigint_example", CASE WHEN 'true' ~* '^(true|false)$' THEN CAST('true' AS BOOLEAN) ELSE NULL END AS "try_cast_to_bool_example", CAST(123 AS TEXT) AS "try_cast_to_text_example", CASE WHEN '123.45' ~ '^[+-]?(?:0*[0-9]{1,8}(?:\.[0-9]{1,2})?|\.[0-9]{1,2})$' THEN CAST('123.45' AS NUMERIC) ELSE NULL END AS "try_cast_to_decimal_example", CASE WHEN '2024-01-02 03:04:05' ~ '^\d{4}-\d{2}-\d{2}[ T]\d{2}:\d{2}:\d{2}(?:\.\d{1,3})?$' THEN CAST('2024-01-02 03:04:05' AS TIMESTAMP WITHOUT TIME ZONE) ELSE NULL END IS NOT NULL AS "try_cast_to_timestamp_example", CASE WHEN '2024-01-02 03:04:05' ~ '^\d{4}-\d{2}-\d{2}[ T]\d{2}:\d{2}:\d{2}(?:\.\d{1,3})?(?:\s*(?:Z|[+-]\d{2}(?::?\d{2})?))?$' THEN CAST('2024-01-02 03:04:05' AS TIMESTAMP WITH TIME ZONE) ELSE NULL END IS NOT NULL AS "try_cast_to_timestamptz_example", NOW() IS NOT NULL AS "now_example", LOCALTIME(0)IS NOT NULL AS "local_time_example", LOCALTIMESTAMP(3)IS NOT NULL AS "local_timestamp_example", LOCALTIME(0)IS NOT NULL AS "current_time_example", CURRENT_DATE IS NOT NULL AS "current_date_example", CURRENT_TIMESTAMP(3)IS NOT NULL AS "current_timestamp_example", EXTRACT(YEAR FROM DATE '2024-01-02') AS "year_example", EXTRACT(QUARTER FROM DATE '2024-01-02') AS "quarter_example", EXTRACT(MONTH FROM DATE '2024-01-02') AS "month_example", EXTRACT(WEEK FROM DATE '2024-01-02') AS "week_example", EXTRACT(DOY FROM DATE '2024-01-02') AS "dayofyear_example", EXTRACT(DAY FROM DATE '2024-01-02') AS "dayofmonth_example", EXTRACT(DOW FROM DATE '2024-01-02') + 1 AS "dayofweek_example", EXTRACT(HOUR FROM TIMESTAMP '2024-01-02 03:04:05') AS "hour_example", EXTRACT(MINUTE FROM TIMESTAMP '2024-01-02 03:04:05') AS "minute_example", EXTRACT(SECOND FROM TIMESTAMP '2024-01-02 03:04:05') AS "second_example", (TIMESTAMP '2024-01-02 03:04:05' AT TIME ZONE 'UTC') AT TIME ZONE 'America/Los_Angeles' AS "convert_tz_example", (EXTRACT(EPOCH FROM CURRENT_TIMESTAMP) ::bigint)IS NOT NULL AS "unix_timestamp_now_example", CASE WHEN TRUE THEN 'yes' ELSE 'no' END AS "if_example", COALESCE(NULL, 'fallback') AS "ifnull_example", ('OnlyLetters' ~ '^[A-Za-z]+$') AS "is_alpha_example", '123.45' ~ '^[+-]?[0-9]+(\.[0-9]+)?$' AS "is_decimal_example", ('12345' ~ '^[0-9]+$') AS "is_digit_example", CASE WHEN CARDINALITY(ARRAY[3]) = 1 THEN (ARRAY[3])[1] ELSE NULL END AS "element_example", 2 = ANY (ARRAY[1, 2, 3]) AS "array_contains_example", ARRAY_PREPEND('a', ARRAY['b', 'c']) AS "array_prepend_example", "array_cat"("array_cat"(ARRAY['a', 'b'], ARRAY['c', 'd']), ARRAY['e']) AS "array_concat_example", ARRAY_REMOVE(ARRAY['a', 'b', 'c'], 'b') AS "array_remove_example", ARRAY_TO_STRING(ARRAY['a', NULL, 'c'], '-', '') AS "array_join_example", STRING_TO_ARRAY('a|b|c', '|') AS "split_example", ENCODE(DIGEST('hello', 'sha1'), 'hex') AS "sha1_example", ENCODE(DIGEST('hello', 'sha224'), 'hex') AS "sha224_example", ENCODE(DIGEST('hello', 'sha256'), 'hex') AS "sha256_example", ENCODE(DIGEST('hello', 'sha384'), 'hex') AS "sha384_example", ENCODE(DIGEST('hello', 'sha512'), 'hex') AS "sha512_example", 'end' AS "the_end"
FROM "_InputData"
>>>vertx.json
{
  "models" : {
    "v1" : {
      "queries" : [
        {
          "type" : "args",
          "parentType" : "Query",
          "fieldName" : "ArrayFunctions",
          "exec" : {
            "arguments" : [
              {
                "type" : "variable",
                "path" : "limit"
              },
              {
                "type" : "variable",
                "path" : "offset"
              }
            ],
            "query" : {
              "type" : "SqlQuery",
              "sql" : "SELECT \"string_agg\"(\"val\", ',') AS \"listagg_example\", ARRAY_AGG(\"val\") AS \"arrayagg_example\"\nFROM \"_ArrayData\"",
              "parameters" : [ ],
              "pagination" : "LIMIT_AND_OFFSET",
              "cacheDurationMs" : 0,
              "database" : "POSTGRES"
            }
          }
        },
        {
          "type" : "args",
          "parentType" : "Query",
          "fieldName" : "FunctionCalls",
          "exec" : {
            "arguments" : [
              {
                "type" : "variable",
                "path" : "limit"
              },
              {
                "type" : "variable",
                "path" : "offset"
              }
            ],
            "query" : {
              "type" : "SqlQuery",
              "sql" : "SELECT LOG(2, 8) AS \"log2_example\", LN(10) AS \"log_nat_example\", LOG(2, 8) AS \"log_base_example\", EXP(1) AS \"e_example\", RANDOM() IS NOT NULL AS \"rand_example\", FLOOR(RANDOM() * 10) IS NOT NULL AS \"rand_int_example\", GEN_RANDOM_UUID() IS NOT NULL AS \"uuid_example\", TO_BIN(10) AS \"bin_example\", ENCODE(CONVERT_TO(255 ::text, 'UTF8'), 'hex') AS \"hex_numeric_example\", ENCODE(CONVERT_TO('AB' ::text, 'UTF8'), 'hex') AS \"hex_string_example\", CONVERT_FROM(DECODE('4142' ::text, 'hex'), 'UTF8') AS \"asdasd_example\", TRUNC(123.456, 2) AS \"truncate_scale_example\", TRUNC(123.456) AS \"truncate_default_example\", FORMAT('%s %s %s %s', 'bob', 42, 0.5, TRUE) AS \"printf_example\", STARTS_WITH('FlinkSQL', 'Flink') AS \"startswith_example\", RIGHT('FlinkSQL', CHAR_LENGTH('SQL')) = 'SQL' AS \"endswith_example\", REGEXP_SUBSTR('abc-123-def', '(\\d+)') AS \"regexp_extract_example\", (REGEXP_MATCH('abc-123-def', '(\\d+)'))[1] AS \"regexp_extract_group_example\", ARRAY (SELECT  m[1] FROM  REGEXP_MATCHES('a1b2c3', '(\\d)', 'g')  AS m) AS \"regexp_extract_all_example\", ARRAY (SELECT  m[1] FROM  REGEXP_MATCHES('a1b2c3', '(\\d)', 'g')  AS m) AS \"regexp_extract_all_group_example\", CONVERT_FROM(CONVERT_TO('hi', 'UTF-8'), 'UTF-8') AS \"decode_example\", CONVERT_TO('hi', 'UTF-8') IS NOT NULL AS \"encode_example\", CONVERT_FROM(DECODE(ENCODE(CONVERT_TO('hello', 'UTF8'), 'base64'), 'base64'), 'UTF8') AS \"from_base64_example\", ENCODE(CONVERT_TO('hello', 'UTF8'), 'base64') AS \"to_base64_example\", STRPOS('hello world', 'world') AS \"instr_example\", REGEXP_LIKE('foo123bar', '\\d+') AS \"regexp_example\", SPLIT_PART('a,b,c', ',', 2) AS \"split_index_example\", SPLIT_PART('a,b,c', ',', 1 - 1 + 1) AS \"split_index_expr_example\", (ARRAY['first', 'second', 'third'])[3] AS \"elt_example\", CASE WHEN '123' ~ '^[+-]?[0-9]+$' THEN CAST('123' AS INTEGER) ELSE NULL END AS \"try_cast_to_int_example\", CASE WHEN '112233445566778899' ~ '^[+-]?[0-9]+$' THEN CAST('112233445566778899' AS BIGINT) ELSE NULL END AS \"try_cast_to_bigint_example\", CASE WHEN 'true' ~* '^(true|false)$' THEN CAST('true' AS BOOLEAN) ELSE NULL END AS \"try_cast_to_bool_example\", CAST(123 AS TEXT) AS \"try_cast_to_text_example\", CASE WHEN '123.45' ~ '^[+-]?(?:0*[0-9]{1,8}(?:\\.[0-9]{1,2})?|\\.[0-9]{1,2})$' THEN CAST('123.45' AS NUMERIC) ELSE NULL END AS \"try_cast_to_decimal_example\", CASE WHEN '2024-01-02 03:04:05' ~ '^\\d{4}-\\d{2}-\\d{2}[ T]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,3})?$' THEN CAST('2024-01-02 03:04:05' AS TIMESTAMP WITHOUT TIME ZONE) ELSE NULL END IS NOT NULL AS \"try_cast_to_timestamp_example\", CASE WHEN '2024-01-02 03:04:05' ~ '^\\d{4}-\\d{2}-\\d{2}[ T]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,3})?(?:\\s*(?:Z|[+-]\\d{2}(?::?\\d{2})?))?$' THEN CAST('2024-01-02 03:04:05' AS TIMESTAMP WITH TIME ZONE) ELSE NULL END IS NOT NULL AS \"try_cast_to_timestamptz_example\", NOW() IS NOT NULL AS \"now_example\", LOCALTIME(0)IS NOT NULL AS \"local_time_example\", LOCALTIMESTAMP(3)IS NOT NULL AS \"local_timestamp_example\", LOCALTIME(0)IS NOT NULL AS \"current_time_example\", CURRENT_DATE IS NOT NULL AS \"current_date_example\", CURRENT_TIMESTAMP(3)IS NOT NULL AS \"current_timestamp_example\", EXTRACT(YEAR FROM DATE '2024-01-02') AS \"year_example\", EXTRACT(QUARTER FROM DATE '2024-01-02') AS \"quarter_example\", EXTRACT(MONTH FROM DATE '2024-01-02') AS \"month_example\", EXTRACT(WEEK FROM DATE '2024-01-02') AS \"week_example\", EXTRACT(DOY FROM DATE '2024-01-02') AS \"dayofyear_example\", EXTRACT(DAY FROM DATE '2024-01-02') AS \"dayofmonth_example\", EXTRACT(DOW FROM DATE '2024-01-02') + 1 AS \"dayofweek_example\", EXTRACT(HOUR FROM TIMESTAMP '2024-01-02 03:04:05') AS \"hour_example\", EXTRACT(MINUTE FROM TIMESTAMP '2024-01-02 03:04:05') AS \"minute_example\", EXTRACT(SECOND FROM TIMESTAMP '2024-01-02 03:04:05') AS \"second_example\", (TIMESTAMP '2024-01-02 03:04:05' AT TIME ZONE 'UTC') AT TIME ZONE 'America/Los_Angeles' AS \"convert_tz_example\", (EXTRACT(EPOCH FROM CURRENT_TIMESTAMP) ::bigint)IS NOT NULL AS \"unix_timestamp_now_example\", CASE WHEN TRUE THEN 'yes' ELSE 'no' END AS \"if_example\", COALESCE(NULL, 'fallback') AS \"ifnull_example\", ('OnlyLetters' ~ '^[A-Za-z]+$') AS \"is_alpha_example\", '123.45' ~ '^[+-]?[0-9]+(\\.[0-9]+)?$' AS \"is_decimal_example\", ('12345' ~ '^[0-9]+$') AS \"is_digit_example\", CASE WHEN CARDINALITY(ARRAY[3]) = 1 THEN (ARRAY[3])[1] ELSE NULL END AS \"element_example\", 2 = ANY (ARRAY[1, 2, 3]) AS \"array_contains_example\", ARRAY_PREPEND('a', ARRAY['b', 'c']) AS \"array_prepend_example\", \"array_cat\"(\"array_cat\"(ARRAY['a', 'b'], ARRAY['c', 'd']), ARRAY['e']) AS \"array_concat_example\", ARRAY_REMOVE(ARRAY['a', 'b', 'c'], 'b') AS \"array_remove_example\", ARRAY_TO_STRING(ARRAY['a', NULL, 'c'], '-', '') AS \"array_join_example\", STRING_TO_ARRAY('a|b|c', '|') AS \"split_example\", ENCODE(DIGEST('hello', 'sha1'), 'hex') AS \"sha1_example\", ENCODE(DIGEST('hello', 'sha224'), 'hex') AS \"sha224_example\", ENCODE(DIGEST('hello', 'sha256'), 'hex') AS \"sha256_example\", ENCODE(DIGEST('hello', 'sha384'), 'hex') AS \"sha384_example\", ENCODE(DIGEST('hello', 'sha512'), 'hex') AS \"sha512_example\", 'end' AS \"the_end\"\nFROM \"_InputData\"",
              "parameters" : [ ],
              "pagination" : "LIMIT_AND_OFFSET",
              "cacheDurationMs" : 0,
              "database" : "POSTGRES"
            }
          }
        }
      ],
      "mutations" : [ ],
      "subscriptions" : [ ],
      "operations" : [
        {
          "function" : {
            "name" : "GetArrayFunctions",
            "parameters" : {
              "type" : "object",
              "properties" : {
                "offset" : {
                  "type" : "integer"
                },
                "limit" : {
                  "type" : "integer"
                }
              },
              "required" : [ ]
            }
          },
          "format" : "JSON",
          "apiQuery" : {
            "query" : "query ArrayFunctions($limit: Int = 10, $offset: Int = 0) {\nArrayFunctions(limit: $limit, offset: $offset) {\nlistagg_example\narrayagg_example\n}\n\n}",
            "queryName" : "ArrayFunctions",
            "operationType" : "QUERY"
          },
          "mcpMethod" : "TOOL",
          "restMethod" : "GET",
          "uriTemplate" : "queries/ArrayFunctions{?offset,limit}"
        },
        {
          "function" : {
            "name" : "GetFunctionCalls",
            "parameters" : {
              "type" : "object",
              "properties" : {
                "offset" : {
                  "type" : "integer"
                },
                "limit" : {
                  "type" : "integer"
                }
              },
              "required" : [ ]
            }
          },
          "format" : "JSON",
          "apiQuery" : {
            "query" : "query FunctionCalls($limit: Int = 10, $offset: Int = 0) {\nFunctionCalls(limit: $limit, offset: $offset) {\nlog2_example\nlog_nat_example\nlog_base_example\ne_example\nrand_example\nrand_int_example\nuuid_example\nbin_example\nhex_numeric_example\nhex_string_example\ntruncate_scale_example\ntruncate_default_example\nprintf_example\nstartswith_example\nendswith_example\nregexp_extract_example\nregexp_extract_group_example\nregexp_extract_all_example\nregexp_extract_all_group_example\ndecode_example\nencode_example\nfrom_base64_example\nto_base64_example\ninstr_example\nregexp_example\nsplit_index_example\nsplit_index_expr_example\nelt_example\ntry_cast_to_int_example\ntry_cast_to_bigint_example\ntry_cast_to_bool_example\ntry_cast_to_text_example\ntry_cast_to_decimal_example\ntry_cast_to_timestamp_example\ntry_cast_to_timestamptz_example\nnow_example\nlocal_time_example\nlocal_timestamp_example\ncurrent_time_example\ncurrent_date_example\ncurrent_timestamp_example\nyear_example\nquarter_example\nmonth_example\nweek_example\ndayofyear_example\ndayofmonth_example\ndayofweek_example\nhour_example\nminute_example\nsecond_example\nconvert_tz_example\nunix_timestamp_now_example\nif_example\nifnull_example\nis_alpha_example\nis_decimal_example\nis_digit_example\nelement_example\narray_contains_example\narray_prepend_example\narray_concat_example\narray_remove_example\narray_join_example\nsplit_example\nsha1_example\nsha224_example\nsha256_example\nsha384_example\nsha512_example\nthe_end\n}\n\n}",
            "queryName" : "FunctionCalls",
            "operationType" : "QUERY"
          },
          "mcpMethod" : "TOOL",
          "restMethod" : "GET",
          "uriTemplate" : "queries/FunctionCalls{?offset,limit}"
        }
      ],
      "schema" : {
        "type" : "string",
        "schema" : "type ArrayFunctions {\n  listagg_example: String!\n  arrayagg_example: [String]!\n}\n\n\"An RFC-3339 compliant Full Date Scalar\"\nscalar Date\n\n\"A DateTime scalar that handles both full RFC3339 and shorter timestamp formats\"\nscalar DateTime\n\ntype FunctionCalls {\n  log2_example: Float!\n  log_nat_example: Float!\n  log_base_example: Float!\n  e_example: Float!\n  rand_example: Boolean!\n  rand_int_example: Boolean!\n  uuid_example: Boolean!\n  bin_example: String!\n  hex_numeric_example: String!\n  hex_string_example: String!\n  truncate_scale_example: Float!\n  truncate_default_example: Float!\n  printf_example: String\n  startswith_example: Boolean!\n  endswith_example: Boolean!\n  regexp_extract_example: String\n  regexp_extract_group_example: String\n  regexp_extract_all_example: [String]\n  regexp_extract_all_group_example: [String]\n  decode_example: String!\n  encode_example: Boolean!\n  from_base64_example: String!\n  to_base64_example: String!\n  instr_example: Int!\n  regexp_example: Boolean!\n  split_index_example: String\n  split_index_expr_example: String\n  elt_example: String\n  try_cast_to_int_example: Int\n  try_cast_to_bigint_example: Long\n  try_cast_to_bool_example: Boolean\n  try_cast_to_text_example: String\n  try_cast_to_decimal_example: Float\n  try_cast_to_timestamp_example: Boolean!\n  try_cast_to_timestamptz_example: Boolean!\n  now_example: Boolean!\n  local_time_example: Boolean!\n  local_timestamp_example: Boolean!\n  current_time_example: Boolean!\n  current_date_example: Boolean!\n  current_timestamp_example: Boolean!\n  year_example: Long!\n  quarter_example: Long!\n  month_example: Long!\n  week_example: Long!\n  dayofyear_example: Long!\n  dayofmonth_example: Long!\n  dayofweek_example: Long!\n  hour_example: Long!\n  minute_example: Long!\n  second_example: Long!\n  convert_tz_example: String\n  unix_timestamp_now_example: Boolean!\n  if_example: String!\n  ifnull_example: String!\n  is_alpha_example: Boolean!\n  is_decimal_example: Boolean!\n  is_digit_example: Boolean!\n  element_example: Int!\n  array_contains_example: Boolean!\n  array_prepend_example: [String]!\n  array_concat_example: [String]!\n  array_remove_example: [String]!\n  array_join_example: String!\n  split_example: [String]\n  sha1_example: String!\n  sha224_example: String!\n  sha256_example: String!\n  sha384_example: String!\n  sha512_example: String!\n  the_end: String!\n}\n\n\"A JSON scalar\"\nscalar JSON\n\n\"24-hour clock time value string in the format `hh:mm:ss` or `hh:mm:ss.sss`.\"\nscalar LocalTime\n\n\"A 64-bit signed integer\"\nscalar Long\n\ntype Query {\n  ArrayFunctions(limit: Int = 10, offset: Int = 0): [ArrayFunctions!]\n  FunctionCalls(limit: Int = 10, offset: Int = 0): [FunctionCalls!]\n}\n\nenum _McpMethodType {\n  NONE\n  TOOL\n  RESOURCE\n}\n\nenum _RestMethodType {\n  NONE\n  GET\n  POST\n}\n\ndirective @api(mcp: _McpMethodType, rest: _RestMethodType, uri: String) on QUERY | MUTATION | FIELD_DEFINITION\n"
      }
    }
  }
}
