diff --git a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/UseCaseCompileTest/log-import-export-wct--package.txt b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/UseCaseCompileTest/log-import-export-wct--package.txt index 1260d33f8..0080154b4 100644 --- a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/UseCaseCompileTest/log-import-export-wct--package.txt +++ b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/UseCaseCompileTest/log-import-export-wct--package.txt @@ -47,13 +47,13 @@ Inputs: importedevent_2 { "flinkSql" : [ "CREATE TEMPORARY FUNCTION IF NOT EXISTS `epochmillitotimestamp` AS 'com.datasqrl.time.EpochMilliToTimestamp' LANGUAGE JAVA;", - "CREATE TEMPORARY TABLE `importedevent_1` (\n `_uuid` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,\n `ID` BIGINT,\n `EPOCH_TIMESTAMP` BIGINT,\n `SOME_VALUE` VARCHAR(2147483647) CHARACTER SET `UTF-16LE`,\n `TIMESTAMP` TIMESTAMP(6),\n `event_time` TIMESTAMP(3) WITH LOCAL TIME ZONE NOT NULL,\n PRIMARY KEY (`_uuid`) NOT ENFORCED,\n WATERMARK FOR `event_time` AS (`event_time` - INTERVAL '0.0' SECOND)\n) WITH (\n 'hostname' = 'postgres_log',\n 'password' = '${JDBC_PASSWORD}',\n 'connector' = 'postgres-cdc',\n 'port' = '5432',\n 'slot.name' = 'flink_slot',\n 'database-name' = 'datasqrl',\n 'schema-name' = 'public',\n 'decoding.plugin.name' = 'pgoutput',\n 'table-name' = 'Event',\n 'debezium.slot.drop_on_stop' = 'false',\n 'username' = '${JDBC_USERNAME}'\n);", - "CREATE TEMPORARY TABLE `data_1` (\n `_uuid` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,\n `ID` BIGINT NOT NULL,\n `EPOCH_TIMESTAMP` BIGINT NOT NULL,\n `SOME_VALUE` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,\n `TIMESTAMP` AS EPOCHMILLITOTIMESTAMP(`EPOCH_TIMESTAMP`),\n `event_time` AS EPOCHMILLITOTIMESTAMP(`EPOCH_TIMESTAMP`),\n PRIMARY KEY (`ID`) NOT ENFORCED,\n WATERMARK FOR `TIMESTAMP` AS (`TIMESTAMP` - INTERVAL '0.001' SECOND)\n) WITH (\n 'fields.ID.end' = '9',\n 'number-of-rows' = '10',\n 'connector' = 'datagen',\n 'fields.EPOCH_TIMESTAMP.kind' = 'sequence',\n 'fields.EPOCH_TIMESTAMP.end' = '1719319565000',\n 'fields.EPOCH_TIMESTAMP.start' = '1719318565000',\n 'fields.SOME_VALUE.kind' = 'random',\n 'fields.ID.start' = '0',\n 'fields._uuid.kind' = 'random',\n 'fields.ID.kind' = 'sequence'\n);", + "CREATE TEMPORARY TABLE `importedevent_1` (\n `_uuid` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,\n `ID` BIGINT,\n `EPOCH_TIMESTAMP` BIGINT,\n `SOME_VALUE` VARCHAR(2147483647) CHARACTER SET `UTF-16LE`,\n `TIMESTAMP` TIMESTAMP(6),\n `event_time` TIMESTAMP(3) WITH LOCAL TIME ZONE NOT NULL,\n PRIMARY KEY (`_uuid`) NOT ENFORCED,\n WATERMARK FOR `event_time` AS `event_time` - INTERVAL '0.0' SECOND\n) WITH (\n 'hostname' = 'postgres_log',\n 'password' = '${JDBC_PASSWORD}',\n 'connector' = 'postgres-cdc',\n 'port' = '5432',\n 'slot.name' = 'flink_slot',\n 'database-name' = 'datasqrl',\n 'schema-name' = 'public',\n 'decoding.plugin.name' = 'pgoutput',\n 'table-name' = 'Event',\n 'debezium.slot.drop_on_stop' = 'false',\n 'username' = '${JDBC_USERNAME}'\n);", + "CREATE TEMPORARY TABLE `data_1` (\n `_uuid` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,\n `ID` BIGINT NOT NULL,\n `EPOCH_TIMESTAMP` BIGINT NOT NULL,\n `SOME_VALUE` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,\n `TIMESTAMP` AS EPOCHMILLITOTIMESTAMP(`EPOCH_TIMESTAMP`),\n `event_time` AS EPOCHMILLITOTIMESTAMP(`EPOCH_TIMESTAMP`),\n PRIMARY KEY (`ID`) NOT ENFORCED,\n WATERMARK FOR `TIMESTAMP` AS `TIMESTAMP` - INTERVAL '0.001' SECOND\n) WITH (\n 'fields.ID.end' = '9',\n 'number-of-rows' = '10',\n 'connector' = 'datagen',\n 'fields.EPOCH_TIMESTAMP.kind' = 'sequence',\n 'fields.EPOCH_TIMESTAMP.end' = '1719319565000',\n 'fields.EPOCH_TIMESTAMP.start' = '1719318565000',\n 'fields.SOME_VALUE.kind' = 'random',\n 'fields.ID.start' = '0',\n 'fields._uuid.kind' = 'random',\n 'fields.ID.kind' = 'sequence'\n);", "CREATE TEMPORARY TABLE `data_2_1` (\n `_uuid` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,\n `ID` BIGINT NOT NULL,\n `EPOCH_TIMESTAMP` BIGINT NOT NULL,\n `SOME_VALUE` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,\n `TIMESTAMP` TIMESTAMP(3) WITH LOCAL TIME ZONE NOT NULL,\n `event_time` TIMESTAMP(3) WITH LOCAL TIME ZONE NOT NULL,\n PRIMARY KEY (`_uuid`) NOT ENFORCED\n) WITH (\n 'password' = '${JDBC_PASSWORD}',\n 'connector' = 'jdbc-sqrl',\n 'driver' = 'org.postgresql.Driver',\n 'table-name' = 'Event',\n 'url' = '${POSTGRES_LOG_JDBC_URL}',\n 'username' = '${JDBC_USERNAME}'\n);", "CREATE TEMPORARY TABLE `importedevent_2_2` (\n `_uuid` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,\n `ID` BIGINT,\n `EPOCH_TIMESTAMP` BIGINT,\n `SOME_VALUE` VARCHAR(2147483647) CHARACTER SET `UTF-16LE`,\n `TIMESTAMP` TIMESTAMP(6),\n `event_time` TIMESTAMP(3) WITH LOCAL TIME ZONE NOT NULL\n) WITH (\n 'connector' = 'print',\n 'print-identifier' = 'LogImportedEvent'\n);", "CREATE VIEW `table$1`\nAS\nSELECT *\nFROM `data_1`;", "CREATE VIEW `table$2`\nAS\nSELECT *\nFROM `importedevent_1`;", - "EXECUTE STATEMENT SET BEGIN\nINSERT INTO `data_2_1`\n(SELECT *\nFROM `table$1`)\n;\nINSERT INTO `importedevent_2_2`\n(SELECT *\nFROM `table$2`)\n;\nEND;" + "EXECUTE STATEMENT SET BEGIN\nINSERT INTO `data_2_1`\n(SELECT *\n FROM `table$1`)\n;\nINSERT INTO `importedevent_2_2`\n (SELECT *\n FROM `table$2`)\n ;\n END;" ], "connectors" : [ "print", diff --git a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/UseCaseCompileTest/log-import-export-wit--package.txt b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/UseCaseCompileTest/log-import-export-wit--package.txt index 92ce64ea6..2d2bd80d4 100644 --- a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/UseCaseCompileTest/log-import-export-wit--package.txt +++ b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/UseCaseCompileTest/log-import-export-wit--package.txt @@ -46,13 +46,13 @@ Inputs: event_2 { "flinkSql" : [ "CREATE TEMPORARY FUNCTION IF NOT EXISTS `epochmillitotimestamp` AS 'com.datasqrl.time.EpochMilliToTimestamp' LANGUAGE JAVA;", - "CREATE TEMPORARY TABLE `event_1` (\n `_uuid` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,\n `ID` BIGINT NOT NULL,\n `EPOCH_TIMESTAMP` BIGINT NOT NULL,\n `SOME_VALUE` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,\n `TIMESTAMP` TIMESTAMP(3) WITH LOCAL TIME ZONE NOT NULL,\n `event_time` TIMESTAMP(3) WITH LOCAL TIME ZONE NOT NULL,\n PRIMARY KEY (`_uuid`) NOT ENFORCED,\n WATERMARK FOR `event_time` AS (`event_time` - INTERVAL '0.0' SECOND)\n) WITH (\n 'hostname' = 'postgres_log',\n 'password' = '${JDBC_PASSWORD}',\n 'connector' = 'postgres-cdc',\n 'port' = '5432',\n 'slot.name' = 'flink_slot',\n 'database-name' = 'datasqrl',\n 'schema-name' = 'public',\n 'decoding.plugin.name' = 'pgoutput',\n 'table-name' = 'Event',\n 'debezium.slot.drop_on_stop' = 'false',\n 'username' = '${JDBC_USERNAME}'\n);", - "CREATE TEMPORARY TABLE `data_1` (\n `_uuid` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,\n `ID` BIGINT NOT NULL,\n `EPOCH_TIMESTAMP` BIGINT NOT NULL,\n `SOME_VALUE` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,\n `TIMESTAMP` AS EPOCHMILLITOTIMESTAMP(`EPOCH_TIMESTAMP`),\n PRIMARY KEY (`ID`) NOT ENFORCED,\n WATERMARK FOR `TIMESTAMP` AS (`TIMESTAMP` - INTERVAL '0.001' SECOND)\n) WITH (\n 'fields.ID.end' = '9',\n 'number-of-rows' = '10',\n 'connector' = 'datagen',\n 'fields.EPOCH_TIMESTAMP.kind' = 'sequence',\n 'fields.EPOCH_TIMESTAMP.end' = '1719319565000',\n 'fields.EPOCH_TIMESTAMP.start' = '1719318565000',\n 'fields.SOME_VALUE.kind' = 'random',\n 'fields.ID.start' = '0',\n 'fields._uuid.kind' = 'random',\n 'fields.ID.kind' = 'sequence'\n);", + "CREATE TEMPORARY TABLE `event_1` (\n `_uuid` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,\n `ID` BIGINT NOT NULL,\n `EPOCH_TIMESTAMP` BIGINT NOT NULL,\n `SOME_VALUE` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,\n `TIMESTAMP` TIMESTAMP(3) WITH LOCAL TIME ZONE NOT NULL,\n `event_time` TIMESTAMP(3) WITH LOCAL TIME ZONE NOT NULL,\n PRIMARY KEY (`_uuid`) NOT ENFORCED,\n WATERMARK FOR `event_time` AS `event_time` - INTERVAL '0.0' SECOND\n) WITH (\n 'hostname' = 'postgres_log',\n 'password' = '${JDBC_PASSWORD}',\n 'connector' = 'postgres-cdc',\n 'port' = '5432',\n 'slot.name' = 'flink_slot',\n 'database-name' = 'datasqrl',\n 'schema-name' = 'public',\n 'decoding.plugin.name' = 'pgoutput',\n 'table-name' = 'Event',\n 'debezium.slot.drop_on_stop' = 'false',\n 'username' = '${JDBC_USERNAME}'\n);", + "CREATE TEMPORARY TABLE `data_1` (\n `_uuid` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,\n `ID` BIGINT NOT NULL,\n `EPOCH_TIMESTAMP` BIGINT NOT NULL,\n `SOME_VALUE` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,\n `TIMESTAMP` AS EPOCHMILLITOTIMESTAMP(`EPOCH_TIMESTAMP`),\n PRIMARY KEY (`ID`) NOT ENFORCED,\n WATERMARK FOR `TIMESTAMP` AS `TIMESTAMP` - INTERVAL '0.001' SECOND\n) WITH (\n 'fields.ID.end' = '9',\n 'number-of-rows' = '10',\n 'connector' = 'datagen',\n 'fields.EPOCH_TIMESTAMP.kind' = 'sequence',\n 'fields.EPOCH_TIMESTAMP.end' = '1719319565000',\n 'fields.EPOCH_TIMESTAMP.start' = '1719318565000',\n 'fields.SOME_VALUE.kind' = 'random',\n 'fields.ID.start' = '0',\n 'fields._uuid.kind' = 'random',\n 'fields.ID.kind' = 'sequence'\n);", "CREATE TEMPORARY TABLE `data_2_1` (\n `_uuid` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,\n `ID` BIGINT NOT NULL,\n `EPOCH_TIMESTAMP` BIGINT NOT NULL,\n `SOME_VALUE` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,\n `TIMESTAMP` TIMESTAMP(3) WITH LOCAL TIME ZONE NOT NULL,\n PRIMARY KEY (`_uuid`) NOT ENFORCED\n) WITH (\n 'password' = '${JDBC_PASSWORD}',\n 'connector' = 'jdbc-sqrl',\n 'driver' = 'org.postgresql.Driver',\n 'table-name' = 'Event',\n 'url' = '${POSTGRES_LOG_JDBC_URL}',\n 'username' = '${JDBC_USERNAME}'\n);", "CREATE TEMPORARY TABLE `event_2_2` (\n `_uuid` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,\n `ID` BIGINT NOT NULL,\n `EPOCH_TIMESTAMP` BIGINT NOT NULL,\n `SOME_VALUE` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,\n `TIMESTAMP` TIMESTAMP(3) WITH LOCAL TIME ZONE NOT NULL,\n `event_time` TIMESTAMP(3) WITH LOCAL TIME ZONE NOT NULL\n) WITH (\n 'connector' = 'print',\n 'print-identifier' = 'LogEvent'\n);", "CREATE VIEW `table$1`\nAS\nSELECT *\nFROM `data_1`;", "CREATE VIEW `table$2`\nAS\nSELECT *\nFROM `event_1`;", - "EXECUTE STATEMENT SET BEGIN\nINSERT INTO `data_2_1`\n(SELECT *\nFROM `table$1`)\n;\nINSERT INTO `event_2_2`\n(SELECT *\nFROM `table$2`)\n;\nEND;" + "EXECUTE STATEMENT SET BEGIN\nINSERT INTO `data_2_1`\n(SELECT *\n FROM `table$1`)\n;\nINSERT INTO `event_2_2`\n (SELECT *\n FROM `table$2`)\n ;\n END;" ], "connectors" : [ "print", diff --git a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/UseCaseCompileTest/snowflake--package.txt b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/UseCaseCompileTest/snowflake--package.txt index 04d665b94..665094c64 100644 --- a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/UseCaseCompileTest/snowflake--package.txt +++ b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/UseCaseCompileTest/snowflake--package.txt @@ -165,7 +165,7 @@ LogicalProject(myJson=[$0], json=[toJson('{"x":1}')], _id=[$1], _updated_at=[$2] }, { "name" : "Query.MySnowflakeTable-10", - "sql" : "CREATE OR REPLACE VIEW Query.MySnowflakeTable-10(myJson, json, _id, _updated_at)\nAS SELECT PARSE_JSON(myJson) AS myJson, TOJSON('{\"x\":1}') AS json, _id, _updated_at\nFROM myjsontable_1\nORDER BY _updated_at DESC NULLS LAST, _id" + "sql" : "CREATE OR REPLACE VIEW Query.MySnowflakeTable-10(myJson, json, _id, _updated_at)\nAS SELECT PARSE_JSON(myJson) AS myJson, PARSE_JSON('{\"x\":1}') AS json, _id, _updated_at\nFROM myjsontable_1\nORDER BY _updated_at DESC NULLS LAST, _id" } ] } @@ -483,7 +483,7 @@ LogicalProject(myJson=[$0], json=[toJson('{"x":1}')], _id=[$1], _updated_at=[$2] "query" : { "type" : "PagedSnowflakeDbQuery", "type" : "PagedSnowflakeDbQuery", - "sql" : "SELECT myJson, TOJSON('{\"x\":1}') AS json, _id, _updated_at\nFROM myjsontable_1\nORDER BY _updated_at DESC NULLS LAST, _id", + "sql" : "SELECT myJson, PARSE_JSON('{\"x\":1}') AS json, _id, _updated_at\nFROM myjsontable_1\nORDER BY _updated_at DESC NULLS LAST, _id", "parameters" : [ ] } }