diff --git a/sqrl-testing/sqrl-integration-tests/src/test/java/com/datasqrl/FullUsecasesIT.java b/sqrl-testing/sqrl-integration-tests/src/test/java/com/datasqrl/FullUsecasesIT.java index d7e35b2cf..b5527f1b1 100644 --- a/sqrl-testing/sqrl-integration-tests/src/test/java/com/datasqrl/FullUsecasesIT.java +++ b/sqrl-testing/sqrl-integration-tests/src/test/java/com/datasqrl/FullUsecasesIT.java @@ -248,7 +248,7 @@ public void testUseCase(UseCaseTestParameter param, TestInfo testInfo) { @MethodSource("useCaseProvider") @Disabled public void runTestNumber(UseCaseTestParameter param, TestInfo testInfo) { - int i = 25; + int i = 26; testNo++; System.out.println(testNo + ":" + param); if (i == testNo) { diff --git a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/FullUsecasesIT/avro-schema_avro-schema.txt b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/FullUsecasesIT/avro-schema_avro-schema.txt index 1f3211396..42371d2e5 100644 --- a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/FullUsecasesIT/avro-schema_avro-schema.txt +++ b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/FullUsecasesIT/avro-schema_avro-schema.txt @@ -1,2 +1,2 @@ >>>MySchemaQuery.graphql -{"data":{"Schema":[{"uuidField":"223e4567-e89b-12d3-a456-426614174001","timestampMillisField":"2023-08-09T21:16:19.000Z","nullableTimestampMillisField":"2023-08-09T21:16:19.000Z","timestampMicrosField":"2023-08-09T21:16:19.000Z","nullableTimestampMicrosField":"2023-08-09T21:16:19.000Z","dateField":"2020-01-01","nullableDateField":null,"timeMillisField":"23:59:59","nullableTimeMillisField":"23:59:59","timeMicrosField":"23:59:59","nullableTimeMicrosField":"23:59:59","complexArrayField":[{"itemFieldOne":2,"itemFieldTwo":"another"}],"nullableComplexArrayField":[{"nullableItemFieldOne":3.5,"nullableItemFieldTwo":true}],"stringField":"example2","nullableStringField":"optional","intField":84,"nullableIntField":21,"longField":9.8765432109876E13,"nullableLongField":9.87654321E9,"floatField":6.28000021,"nullableFloatField":1.57000005,"doubleField":1.414,"nullableDoubleField":0.707,"booleanField":false,"nullableBooleanField":true,"enumField":"TWO","nullableEnumField":"FOUR","decimalField":7890.12},{"uuidField":"123e4567-e89b-12d3-a456-426614174000","timestampMillisField":"2023-08-08T17:29:39.000Z","nullableTimestampMillisField":null,"timestampMicrosField":"2023-08-08T17:29:39.000Z","nullableTimestampMicrosField":null,"dateField":"2020-01-01","nullableDateField":null,"timeMillisField":"23:59:59","nullableTimeMillisField":null,"timeMicrosField":"23:59:59","nullableTimeMicrosField":null,"complexArrayField":[{"itemFieldOne":1,"itemFieldTwo":"example"}],"nullableComplexArrayField":null,"stringField":"example","nullableStringField":null,"intField":42,"nullableIntField":null,"longField":1.23456789012345E14,"nullableLongField":null,"floatField":3.1400001,"nullableFloatField":null,"doubleField":2.718,"nullableDoubleField":null,"booleanField":true,"nullableBooleanField":null,"enumField":"ONE","nullableEnumField":null,"decimalField":1234.56}]}} +{"data":{"Schema":[{"uuidField":"223e4567-e89b-12d3-a456-426614174001","timestampMillisField":"2023-08-09T21:16:19.000Z","nullableTimestampMillisField":"2023-08-09T21:16:19.000Z","timestampMicrosField":"2023-08-09T21:16:19.000Z","nullableTimestampMicrosField":"2023-08-09T21:16:19.000Z","dateField":"2020-01-01","nullableDateField":null,"timeMillisField":"23:59:59","nullableTimeMillisField":"23:59:59","timeMicrosField":"23:59:59","nullableTimeMicrosField":"23:59:59","stringField":"example2","nullableStringField":"optional","intField":84,"nullableIntField":21,"longField":9.8765432109876E13,"nullableLongField":9.87654321E9,"floatField":6.28000021,"nullableFloatField":1.57000005,"doubleField":1.414,"nullableDoubleField":0.707,"booleanField":false,"nullableBooleanField":true,"enumField":"TWO","nullableEnumField":"FOUR","decimalField":7890.12,"complexArrayField":[{"itemFieldOne":2,"itemFieldTwo":"another"}],"multiNestedRecord":{"nestedLevelOne":{"levelOneField":"nestedLevel1","nestedLevelTwo":{"levelTwoField":20}}},"nullableComplexArrayField":[{"nullableItemFieldOne":3.5,"nullableItemFieldTwo":true}],"nestedRecord":{"nestedStringField":"nestedExample","nestedIntField":15},"nullableNestedRecord":{"nullableNestedStringField":"nullable","nullableNestedLongField":5.67890123456E11}},{"uuidField":"123e4567-e89b-12d3-a456-426614174000","timestampMillisField":"2023-08-08T17:29:39.000Z","nullableTimestampMillisField":null,"timestampMicrosField":"2023-08-08T17:29:39.000Z","nullableTimestampMicrosField":null,"dateField":"2020-01-01","nullableDateField":null,"timeMillisField":"23:59:59","nullableTimeMillisField":null,"timeMicrosField":"23:59:59","nullableTimeMicrosField":null,"stringField":"example","nullableStringField":null,"intField":42,"nullableIntField":null,"longField":1.23456789012345E14,"nullableLongField":null,"floatField":3.1400001,"nullableFloatField":null,"doubleField":2.718,"nullableDoubleField":null,"booleanField":true,"nullableBooleanField":null,"enumField":"ONE","nullableEnumField":null,"decimalField":1234.56,"complexArrayField":[{"itemFieldOne":1,"itemFieldTwo":"example"}],"multiNestedRecord":{"nestedLevelOne":{"levelOneField":"level1","nestedLevelTwo":{"levelTwoField":10}}},"nullableComplexArrayField":null,"nestedRecord":{"nestedStringField":"nested","nestedIntField":5},"nullableNestedRecord":null}]}} diff --git a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/UseCaseCompileTest/avro-schema--package.txt b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/UseCaseCompileTest/avro-schema--package.txt index dfe0a432e..baad43210 100644 --- a/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/UseCaseCompileTest/avro-schema--package.txt +++ b/sqrl-testing/sqrl-integration-tests/src/test/resources/snapshots/com/datasqrl/UseCaseCompileTest/avro-schema--package.txt @@ -19,6 +19,7 @@ Schema: - nullableTimeMicrosField: TIME(0) - complexArrayField: RecordType:peek_no_expand(INTEGER NOT NULL itemFieldOne, VARCHAR(2147483647) CHARACTER SET "UTF-16LE" NOT NULL itemFieldTwo) NOT NULL ARRAY NOT NULL - nullableComplexArrayField: RecordType:peek_no_expand(DOUBLE nullableItemFieldOne, BOOLEAN nullableItemFieldTwo) NOT NULL ARRAY + - multiNestedRecord: RecordType:peek_no_expand(RecordType:peek_no_expand(VARCHAR(2147483647) CHARACTER SET "UTF-16LE" NOT NULL levelOneField, RecordType:peek_no_expand(INTEGER NOT NULL levelTwoField) NOT NULL nestedLevelTwo) NOT NULL nestedLevelOne) NOT NULL - stringField: VARCHAR(2147483647) CHARACTER SET "UTF-16LE" NOT NULL - nullableStringField: VARCHAR(2147483647) CHARACTER SET "UTF-16LE" - intField: INTEGER NOT NULL @@ -33,6 +34,8 @@ Schema: - nullableBooleanField: BOOLEAN - enumField: VARCHAR(2147483647) CHARACTER SET "UTF-16LE" NOT NULL - nullableEnumField: VARCHAR(2147483647) CHARACTER SET "UTF-16LE" + - nestedRecord: RecordType:peek_no_expand(VARCHAR(2147483647) CHARACTER SET "UTF-16LE" NOT NULL nestedStringField, INTEGER NOT NULL nestedIntField) NOT NULL + - nullableNestedRecord: RecordType:peek_no_expand(VARCHAR(2147483647) CHARACTER SET "UTF-16LE" nullableNestedStringField, BIGINT nullableNestedLongField) - decimalField: DECIMAL(10, 2) NOT NULL Plan: LogicalTableScan(table=[[schema_1]]) @@ -41,9 +44,9 @@ LogicalTableScan(table=[[schema_1]]) { "flinkSql" : [ "CREATE TEMPORARY FUNCTION IF NOT EXISTS `ToJson` AS 'com.datasqrl.json.ToJson' LANGUAGE JAVA;", - "CREATE TEMPORARY TABLE `schema_1` (\n `uuidField` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,\n `timestampMillisField` TIMESTAMP(3) WITH LOCAL TIME ZONE NOT NULL,\n `nullableTimestampMillisField` TIMESTAMP(3) WITH LOCAL TIME ZONE,\n `timestampMicrosField` TIMESTAMP(6) WITH LOCAL TIME ZONE NOT NULL,\n `nullableTimestampMicrosField` TIMESTAMP(6) WITH LOCAL TIME ZONE,\n `dateField` DATE NOT NULL,\n `nullableDateField` DATE,\n `timeMillisField` TIME(0) NOT NULL,\n `nullableTimeMillisField` TIME(0),\n `timeMicrosField` TIME(0) NOT NULL,\n `nullableTimeMicrosField` TIME(0),\n `complexArrayField` ROW(`itemFieldOne` INTEGER NOT NULL, `itemFieldTwo` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL) NOT NULL ARRAY NOT NULL,\n `nullableComplexArrayField` ROW(`nullableItemFieldOne` DOUBLE, `nullableItemFieldTwo` BOOLEAN) ARRAY,\n `stringField` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,\n `nullableStringField` VARCHAR(2147483647) CHARACTER SET `UTF-16LE`,\n `intField` INTEGER NOT NULL,\n `nullableIntField` INTEGER,\n `longField` BIGINT NOT NULL,\n `nullableLongField` BIGINT,\n `floatField` FLOAT NOT NULL,\n `nullableFloatField` FLOAT,\n `doubleField` DOUBLE NOT NULL,\n `nullableDoubleField` DOUBLE,\n `booleanField` BOOLEAN NOT NULL,\n `nullableBooleanField` BOOLEAN,\n `enumField` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,\n `nullableEnumField` VARCHAR(2147483647) CHARACTER SET `UTF-16LE`,\n `decimalField` DECIMAL(10, 2) NOT NULL,\n PRIMARY KEY (`uuidField`, `timestampMillisField`) NOT ENFORCED,\n WATERMARK FOR `timestampMillisField` AS `timestampMillisField` - INTERVAL '0.0' SECOND\n) WITH (\n 'format' = 'flexible-json',\n 'path' = '${DATA_PATH}/schema.jsonl',\n 'connector' = 'filesystem'\n);", - "CREATE TEMPORARY TABLE `schema_2` (\n `uuidField` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,\n `timestampMillisField` TIMESTAMP(3) WITH LOCAL TIME ZONE NOT NULL,\n `nullableTimestampMillisField` TIMESTAMP(3) WITH LOCAL TIME ZONE,\n `timestampMicrosField` TIMESTAMP(6) WITH LOCAL TIME ZONE NOT NULL,\n `nullableTimestampMicrosField` TIMESTAMP(6) WITH LOCAL TIME ZONE,\n `dateField` DATE NOT NULL,\n `nullableDateField` DATE,\n `timeMillisField` TIME(0) NOT NULL,\n `nullableTimeMillisField` TIME(0),\n `timeMicrosField` TIME(0) NOT NULL,\n `nullableTimeMicrosField` TIME(0),\n `complexArrayField` RAW('com.datasqrl.json.FlinkJsonType', 'ADFjb20uZGF0YXNxcmwuanNvbi5GbGlua0pzb25UeXBlU2VyaWFsaXplclNuYXBzaG90AAAAAQApY29tLmRhdGFzcXJsLmpzb24uRmxpbmtKc29uVHlwZVNlcmlhbGl6ZXI='),\n `nullableComplexArrayField` RAW('com.datasqrl.json.FlinkJsonType', 'ADFjb20uZGF0YXNxcmwuanNvbi5GbGlua0pzb25UeXBlU2VyaWFsaXplclNuYXBzaG90AAAAAQApY29tLmRhdGFzcXJsLmpzb24uRmxpbmtKc29uVHlwZVNlcmlhbGl6ZXI='),\n `stringField` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,\n `nullableStringField` VARCHAR(2147483647) CHARACTER SET `UTF-16LE`,\n `intField` INTEGER NOT NULL,\n `nullableIntField` INTEGER,\n `longField` BIGINT NOT NULL,\n `nullableLongField` BIGINT,\n `floatField` FLOAT NOT NULL,\n `nullableFloatField` FLOAT,\n `doubleField` DOUBLE NOT NULL,\n `nullableDoubleField` DOUBLE,\n `booleanField` BOOLEAN NOT NULL,\n `nullableBooleanField` BOOLEAN,\n `enumField` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,\n `nullableEnumField` VARCHAR(2147483647) CHARACTER SET `UTF-16LE`,\n `decimalField` DECIMAL(10, 2) NOT NULL,\n PRIMARY KEY (`uuidField`, `timestampMillisField`) NOT ENFORCED\n) WITH (\n 'password' = '${JDBC_PASSWORD}',\n 'connector' = 'jdbc-sqrl',\n 'driver' = 'org.postgresql.Driver',\n 'table-name' = 'schema_2',\n 'url' = '${JDBC_URL}',\n 'username' = '${JDBC_USERNAME}'\n);", - "CREATE VIEW `table$1`\nAS\nSELECT `uuidField`, `timestampMillisField`, `nullableTimestampMillisField`, `timestampMicrosField`, `nullableTimestampMicrosField`, `dateField`, `nullableDateField`, `timeMillisField`, `nullableTimeMillisField`, `timeMicrosField`, `nullableTimeMicrosField`, TOJSON(`complexArrayField`) AS `complexArrayField`, TOJSON(`nullableComplexArrayField`) AS `nullableComplexArrayField`, `stringField`, `nullableStringField`, `intField`, `nullableIntField`, `longField`, `nullableLongField`, `floatField`, `nullableFloatField`, `doubleField`, `nullableDoubleField`, `booleanField`, `nullableBooleanField`, `enumField`, `nullableEnumField`, `decimalField`\nFROM `schema_1`;", + "CREATE TEMPORARY TABLE `schema_1` (\n `uuidField` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,\n `timestampMillisField` TIMESTAMP(3) WITH LOCAL TIME ZONE NOT NULL,\n `nullableTimestampMillisField` TIMESTAMP(3) WITH LOCAL TIME ZONE,\n `timestampMicrosField` TIMESTAMP(6) WITH LOCAL TIME ZONE NOT NULL,\n `nullableTimestampMicrosField` TIMESTAMP(6) WITH LOCAL TIME ZONE,\n `dateField` DATE NOT NULL,\n `nullableDateField` DATE,\n `timeMillisField` TIME(0) NOT NULL,\n `nullableTimeMillisField` TIME(0),\n `timeMicrosField` TIME(0) NOT NULL,\n `nullableTimeMicrosField` TIME(0),\n `complexArrayField` ROW(`itemFieldOne` INTEGER NOT NULL, `itemFieldTwo` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL) NOT NULL ARRAY NOT NULL,\n `nullableComplexArrayField` ROW(`nullableItemFieldOne` DOUBLE, `nullableItemFieldTwo` BOOLEAN) ARRAY,\n `multiNestedRecord` ROW(`nestedLevelOne` ROW(`levelOneField` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL, `nestedLevelTwo` ROW(`levelTwoField` INTEGER NOT NULL) NOT NULL) NOT NULL) NOT NULL,\n `stringField` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,\n `nullableStringField` VARCHAR(2147483647) CHARACTER SET `UTF-16LE`,\n `intField` INTEGER NOT NULL,\n `nullableIntField` INTEGER,\n `longField` BIGINT NOT NULL,\n `nullableLongField` BIGINT,\n `floatField` FLOAT NOT NULL,\n `nullableFloatField` FLOAT,\n `doubleField` DOUBLE NOT NULL,\n `nullableDoubleField` DOUBLE,\n `booleanField` BOOLEAN NOT NULL,\n `nullableBooleanField` BOOLEAN,\n `enumField` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,\n `nullableEnumField` VARCHAR(2147483647) CHARACTER SET `UTF-16LE`,\n `nestedRecord` ROW(`nestedStringField` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL, `nestedIntField` INTEGER NOT NULL) NOT NULL,\n `nullableNestedRecord` ROW(`nullableNestedStringField` VARCHAR(2147483647) CHARACTER SET `UTF-16LE`, `nullableNestedLongField` BIGINT),\n `decimalField` DECIMAL(10, 2) NOT NULL,\n PRIMARY KEY (`uuidField`, `timestampMillisField`) NOT ENFORCED,\n WATERMARK FOR `timestampMillisField` AS `timestampMillisField` - INTERVAL '0.0' SECOND\n) WITH (\n 'format' = 'flexible-json',\n 'path' = '${DATA_PATH}/schema.jsonl',\n 'connector' = 'filesystem'\n);", + "CREATE TEMPORARY TABLE `schema_2` (\n `uuidField` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,\n `timestampMillisField` TIMESTAMP(3) WITH LOCAL TIME ZONE NOT NULL,\n `nullableTimestampMillisField` TIMESTAMP(3) WITH LOCAL TIME ZONE,\n `timestampMicrosField` TIMESTAMP(6) WITH LOCAL TIME ZONE NOT NULL,\n `nullableTimestampMicrosField` TIMESTAMP(6) WITH LOCAL TIME ZONE,\n `dateField` DATE NOT NULL,\n `nullableDateField` DATE,\n `timeMillisField` TIME(0) NOT NULL,\n `nullableTimeMillisField` TIME(0),\n `timeMicrosField` TIME(0) NOT NULL,\n `nullableTimeMicrosField` TIME(0),\n `complexArrayField` RAW('com.datasqrl.json.FlinkJsonType', 'ADFjb20uZGF0YXNxcmwuanNvbi5GbGlua0pzb25UeXBlU2VyaWFsaXplclNuYXBzaG90AAAAAQApY29tLmRhdGFzcXJsLmpzb24uRmxpbmtKc29uVHlwZVNlcmlhbGl6ZXI='),\n `nullableComplexArrayField` RAW('com.datasqrl.json.FlinkJsonType', 'ADFjb20uZGF0YXNxcmwuanNvbi5GbGlua0pzb25UeXBlU2VyaWFsaXplclNuYXBzaG90AAAAAQApY29tLmRhdGFzcXJsLmpzb24uRmxpbmtKc29uVHlwZVNlcmlhbGl6ZXI='),\n `multiNestedRecord` RAW('com.datasqrl.json.FlinkJsonType', 'ADFjb20uZGF0YXNxcmwuanNvbi5GbGlua0pzb25UeXBlU2VyaWFsaXplclNuYXBzaG90AAAAAQApY29tLmRhdGFzcXJsLmpzb24uRmxpbmtKc29uVHlwZVNlcmlhbGl6ZXI='),\n `stringField` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,\n `nullableStringField` VARCHAR(2147483647) CHARACTER SET `UTF-16LE`,\n `intField` INTEGER NOT NULL,\n `nullableIntField` INTEGER,\n `longField` BIGINT NOT NULL,\n `nullableLongField` BIGINT,\n `floatField` FLOAT NOT NULL,\n `nullableFloatField` FLOAT,\n `doubleField` DOUBLE NOT NULL,\n `nullableDoubleField` DOUBLE,\n `booleanField` BOOLEAN NOT NULL,\n `nullableBooleanField` BOOLEAN,\n `enumField` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,\n `nullableEnumField` VARCHAR(2147483647) CHARACTER SET `UTF-16LE`,\n `nestedRecord` RAW('com.datasqrl.json.FlinkJsonType', 'ADFjb20uZGF0YXNxcmwuanNvbi5GbGlua0pzb25UeXBlU2VyaWFsaXplclNuYXBzaG90AAAAAQApY29tLmRhdGFzcXJsLmpzb24uRmxpbmtKc29uVHlwZVNlcmlhbGl6ZXI='),\n `nullableNestedRecord` RAW('com.datasqrl.json.FlinkJsonType', 'ADFjb20uZGF0YXNxcmwuanNvbi5GbGlua0pzb25UeXBlU2VyaWFsaXplclNuYXBzaG90AAAAAQApY29tLmRhdGFzcXJsLmpzb24uRmxpbmtKc29uVHlwZVNlcmlhbGl6ZXI='),\n `decimalField` DECIMAL(10, 2) NOT NULL,\n PRIMARY KEY (`uuidField`, `timestampMillisField`) NOT ENFORCED\n) WITH (\n 'password' = '${JDBC_PASSWORD}',\n 'connector' = 'jdbc-sqrl',\n 'driver' = 'org.postgresql.Driver',\n 'table-name' = 'schema_2',\n 'url' = '${JDBC_URL}',\n 'username' = '${JDBC_USERNAME}'\n);", + "CREATE VIEW `table$1`\nAS\nSELECT `uuidField`, `timestampMillisField`, `nullableTimestampMillisField`, `timestampMicrosField`, `nullableTimestampMicrosField`, `dateField`, `nullableDateField`, `timeMillisField`, `nullableTimeMillisField`, `timeMicrosField`, `nullableTimeMicrosField`, TOJSON(`complexArrayField`) AS `complexArrayField`, TOJSON(`nullableComplexArrayField`) AS `nullableComplexArrayField`, TOJSON(`multiNestedRecord`) AS `multiNestedRecord`, `stringField`, `nullableStringField`, `intField`, `nullableIntField`, `longField`, `nullableLongField`, `floatField`, `nullableFloatField`, `doubleField`, `nullableDoubleField`, `booleanField`, `nullableBooleanField`, `enumField`, `nullableEnumField`, TOJSON(`nestedRecord`) AS `nestedRecord`, TOJSON(`nullableNestedRecord`) AS `nullableNestedRecord`, `decimalField`\nFROM `schema_1`;", "EXECUTE STATEMENT SET BEGIN\nINSERT INTO `schema_2`\n(SELECT *\n FROM `table$1`)\n;\nEND;" ], "connectors" : [ @@ -77,6 +80,7 @@ LogicalTableScan(table=[[schema_1]]) "\"nullableTimeMicrosField\" TIME WITHOUT TIME ZONE ", "\"complexArrayField\" JSONB NOT NULL", "\"nullableComplexArrayField\" JSONB ", + "\"multiNestedRecord\" JSONB NOT NULL", "\"stringField\" TEXT NOT NULL", "\"nullableStringField\" TEXT ", "\"intField\" INTEGER NOT NULL", @@ -91,13 +95,15 @@ LogicalTableScan(table=[[schema_1]]) "\"nullableBooleanField\" BOOLEAN ", "\"enumField\" TEXT NOT NULL", "\"nullableEnumField\" TEXT ", + "\"nestedRecord\" JSONB NOT NULL", + "\"nullableNestedRecord\" JSONB ", "\"decimalField\" NUMERIC NOT NULL" ], "primaryKeys" : [ "\"uuidField\"", "\"timestampMillisField\"" ], - "sql" : "CREATE TABLE IF NOT EXISTS schema_2 (\"uuidField\" TEXT NOT NULL,\"timestampMillisField\" TIMESTAMP WITH TIME ZONE NOT NULL,\"nullableTimestampMillisField\" TIMESTAMP WITH TIME ZONE ,\"timestampMicrosField\" TIMESTAMP WITH TIME ZONE NOT NULL,\"nullableTimestampMicrosField\" TIMESTAMP WITH TIME ZONE ,\"dateField\" DATE NOT NULL,\"nullableDateField\" DATE ,\"timeMillisField\" TIME WITHOUT TIME ZONE NOT NULL,\"nullableTimeMillisField\" TIME WITHOUT TIME ZONE ,\"timeMicrosField\" TIME WITHOUT TIME ZONE NOT NULL,\"nullableTimeMicrosField\" TIME WITHOUT TIME ZONE ,\"complexArrayField\" JSONB NOT NULL,\"nullableComplexArrayField\" JSONB ,\"stringField\" TEXT NOT NULL,\"nullableStringField\" TEXT ,\"intField\" INTEGER NOT NULL,\"nullableIntField\" INTEGER ,\"longField\" BIGINT NOT NULL,\"nullableLongField\" BIGINT ,\"floatField\" FLOAT NOT NULL,\"nullableFloatField\" FLOAT ,\"doubleField\" DOUBLE PRECISION NOT NULL,\"nullableDoubleField\" DOUBLE PRECISION ,\"booleanField\" BOOLEAN NOT NULL,\"nullableBooleanField\" BOOLEAN ,\"enumField\" TEXT NOT NULL,\"nullableEnumField\" TEXT ,\"decimalField\" NUMERIC NOT NULL , PRIMARY KEY (\"uuidField\",\"timestampMillisField\"));" + "sql" : "CREATE TABLE IF NOT EXISTS schema_2 (\"uuidField\" TEXT NOT NULL,\"timestampMillisField\" TIMESTAMP WITH TIME ZONE NOT NULL,\"nullableTimestampMillisField\" TIMESTAMP WITH TIME ZONE ,\"timestampMicrosField\" TIMESTAMP WITH TIME ZONE NOT NULL,\"nullableTimestampMicrosField\" TIMESTAMP WITH TIME ZONE ,\"dateField\" DATE NOT NULL,\"nullableDateField\" DATE ,\"timeMillisField\" TIME WITHOUT TIME ZONE NOT NULL,\"nullableTimeMillisField\" TIME WITHOUT TIME ZONE ,\"timeMicrosField\" TIME WITHOUT TIME ZONE NOT NULL,\"nullableTimeMicrosField\" TIME WITHOUT TIME ZONE ,\"complexArrayField\" JSONB NOT NULL,\"nullableComplexArrayField\" JSONB ,\"multiNestedRecord\" JSONB NOT NULL,\"stringField\" TEXT NOT NULL,\"nullableStringField\" TEXT ,\"intField\" INTEGER NOT NULL,\"nullableIntField\" INTEGER ,\"longField\" BIGINT NOT NULL,\"nullableLongField\" BIGINT ,\"floatField\" FLOAT NOT NULL,\"nullableFloatField\" FLOAT ,\"doubleField\" DOUBLE PRECISION NOT NULL,\"nullableDoubleField\" DOUBLE PRECISION ,\"booleanField\" BOOLEAN NOT NULL,\"nullableBooleanField\" BOOLEAN ,\"enumField\" TEXT NOT NULL,\"nullableEnumField\" TEXT ,\"nestedRecord\" JSONB NOT NULL,\"nullableNestedRecord\" JSONB ,\"decimalField\" NUMERIC NOT NULL , PRIMARY KEY (\"uuidField\",\"timestampMillisField\"));" }, { "indexName" : "schema_2_hash_c1", @@ -112,7 +118,7 @@ LogicalTableScan(table=[[schema_1]]) "views" : [ { "name" : "Schema", - "sql" : "CREATE OR REPLACE VIEW \"Schema\"(\"uuidField\", \"timestampMillisField\", \"nullableTimestampMillisField\", \"timestampMicrosField\", \"nullableTimestampMicrosField\", \"dateField\", \"nullableDateField\", \"timeMillisField\", \"nullableTimeMillisField\", \"timeMicrosField\", \"nullableTimeMicrosField\", \"complexArrayField\", \"nullableComplexArrayField\", \"stringField\", \"nullableStringField\", \"intField\", \"nullableIntField\", \"longField\", \"nullableLongField\", \"floatField\", \"nullableFloatField\", \"doubleField\", \"nullableDoubleField\", \"booleanField\", \"nullableBooleanField\", \"enumField\", \"nullableEnumField\", \"decimalField\") AS SELECT *\nFROM \"schema_2\"\nORDER BY \"timestampMillisField\" DESC NULLS LAST, \"uuidField\";" + "sql" : "CREATE OR REPLACE VIEW \"Schema\"(\"uuidField\", \"timestampMillisField\", \"nullableTimestampMillisField\", \"timestampMicrosField\", \"nullableTimestampMicrosField\", \"dateField\", \"nullableDateField\", \"timeMillisField\", \"nullableTimeMillisField\", \"timeMicrosField\", \"nullableTimeMicrosField\", \"complexArrayField\", \"nullableComplexArrayField\", \"multiNestedRecord\", \"stringField\", \"nullableStringField\", \"intField\", \"nullableIntField\", \"longField\", \"nullableLongField\", \"floatField\", \"nullableFloatField\", \"doubleField\", \"nullableDoubleField\", \"booleanField\", \"nullableBooleanField\", \"enumField\", \"nullableEnumField\", \"nestedRecord\", \"nullableNestedRecord\", \"decimalField\") AS SELECT *\nFROM \"schema_2\"\nORDER BY \"timestampMillisField\" DESC NULLS LAST, \"uuidField\";" } ] } @@ -256,7 +262,7 @@ LogicalTableScan(table=[[schema_1]]) "schema" : { "type" : "string", "type" : "string", - "schema" : "\"An RFC-3339 compliant Full Date Scalar\"\nscalar Date\n\n\"An RFC-3339 compliant DateTime Scalar\"\nscalar DateTime\n\n\"24-hour clock time value string in the format `hh:mm:ss` or `hh:mm:ss.sss`.\"\nscalar LocalTime\n\ntype Query {\n Schema(uuidField: String, timestampMillisField: DateTime, limit: Int = 10, offset: Int = 0): [Schema!]\n}\n\ntype Schema {\n uuidField: String!\n timestampMillisField: DateTime!\n nullableTimestampMillisField: DateTime\n timestampMicrosField: DateTime!\n nullableTimestampMicrosField: DateTime\n dateField: Date!\n nullableDateField: Date\n timeMillisField: LocalTime!\n nullableTimeMillisField: LocalTime\n timeMicrosField: LocalTime!\n nullableTimeMicrosField: LocalTime\n stringField: String!\n nullableStringField: String\n intField: Int!\n nullableIntField: Int\n longField: Float!\n nullableLongField: Float\n floatField: Float!\n nullableFloatField: Float\n doubleField: Float!\n nullableDoubleField: Float\n booleanField: Boolean!\n nullableBooleanField: Boolean\n enumField: String!\n nullableEnumField: String\n decimalField: Float!\n complexArrayField(limit: Int = 10, offset: Int = 0): [complexArrayField!]\n nullableComplexArrayField(limit: Int = 10, offset: Int = 0): [nullableComplexArrayField!]\n}\n\ntype complexArrayField {\n itemFieldOne: Int!\n itemFieldTwo: String!\n}\n\ntype nullableComplexArrayField {\n nullableItemFieldOne: Float\n nullableItemFieldTwo: Boolean\n}\n" + "schema" : "\"An RFC-3339 compliant Full Date Scalar\"\nscalar Date\n\n\"An RFC-3339 compliant DateTime Scalar\"\nscalar DateTime\n\n\"24-hour clock time value string in the format `hh:mm:ss` or `hh:mm:ss.sss`.\"\nscalar LocalTime\n\ntype Query {\n Schema(uuidField: String, timestampMillisField: DateTime, limit: Int = 10, offset: Int = 0): [Schema!]\n}\n\ntype Schema {\n uuidField: String!\n timestampMillisField: DateTime!\n nullableTimestampMillisField: DateTime\n timestampMicrosField: DateTime!\n nullableTimestampMicrosField: DateTime\n dateField: Date!\n nullableDateField: Date\n timeMillisField: LocalTime!\n nullableTimeMillisField: LocalTime\n timeMicrosField: LocalTime!\n nullableTimeMicrosField: LocalTime\n stringField: String!\n nullableStringField: String\n intField: Int!\n nullableIntField: Int\n longField: Float!\n nullableLongField: Float\n floatField: Float!\n nullableFloatField: Float\n doubleField: Float!\n nullableDoubleField: Float\n booleanField: Boolean!\n nullableBooleanField: Boolean\n enumField: String!\n nullableEnumField: String\n decimalField: Float!\n complexArrayField(limit: Int = 10, offset: Int = 0): [complexArrayField!]\n multiNestedRecord: multiNestedRecord!\n nestedRecord: nestedRecord!\n nullableComplexArrayField(limit: Int = 10, offset: Int = 0): [nullableComplexArrayField!]\n nullableNestedRecord: nullableNestedRecord\n}\n\ntype complexArrayField {\n itemFieldOne: Int!\n itemFieldTwo: String!\n}\n\ntype multiNestedRecord {\n nestedLevelOne: nestedLevelOne!\n}\n\ntype nestedLevelOne {\n levelOneField: String!\n nestedLevelTwo: nestedLevelTwo!\n}\n\ntype nestedLevelTwo {\n levelTwoField: Int!\n}\n\ntype nestedRecord {\n nestedStringField: String!\n nestedIntField: Int!\n}\n\ntype nullableComplexArrayField {\n nullableItemFieldOne: Float\n nullableItemFieldTwo: Boolean\n}\n\ntype nullableNestedRecord {\n nullableNestedStringField: String\n nullableNestedLongField: Float\n}\n" } } } diff --git a/sqrl-testing/sqrl-integration-tests/src/test/resources/usecases/avro-schema/snapshots-avro-schema/MySchema.snapshot b/sqrl-testing/sqrl-integration-tests/src/test/resources/usecases/avro-schema/snapshots-avro-schema/MySchema.snapshot index 353787a93..d0c7a7b07 100644 --- a/sqrl-testing/sqrl-integration-tests/src/test/resources/usecases/avro-schema/snapshots-avro-schema/MySchema.snapshot +++ b/sqrl-testing/sqrl-integration-tests/src/test/resources/usecases/avro-schema/snapshots-avro-schema/MySchema.snapshot @@ -1 +1 @@ -{"data":{"MySchema":[{"uuidField":"223e4567-e89b-12d3-a456-426614174001","timestampMillisField":"2023-08-09T21:16:19.000Z","nullableTimestampMillisField":"2023-08-09T21:16:19.000Z","timestampMicrosField":"2023-08-09T21:16:19.000Z","nullableTimestampMicrosField":"2023-08-09T21:16:19.000Z","dateField":"2020-01-01","nullableDateField":null,"timeMillisField":"23:59:59","nullableTimeMillisField":"23:59:59","timeMicrosField":"23:59:59","nullableTimeMicrosField":"23:59:59","stringField":"example2","nullableStringField":"optional","intField":84,"nullableIntField":21,"longField":9.8765432109876E13,"nullableLongField":9.87654321E9,"floatField":6.28000021,"nullableFloatField":1.57000005,"doubleField":1.414,"nullableDoubleField":0.707,"booleanField":false,"nullableBooleanField":true,"enumField":"TWO","nullableEnumField":"FOUR","decimalField":7890.12,"complexArrayField":[{"itemFieldOne":2,"itemFieldTwo":"another"}],"multiNestedRecord":{"nestedLevelOne":{"levelOneField":"nestedLevel1","nestedLevelTwo":{"levelTwoField":20}}},"nullableComplexArrayField":[{"nullableItemFieldOne":3.5,"nullableItemFieldTwo":true}]},{"uuidField":"123e4567-e89b-12d3-a456-426614174000","timestampMillisField":"2023-08-08T17:29:39.000Z","nullableTimestampMillisField":null,"timestampMicrosField":"2023-08-08T17:29:39.000Z","nullableTimestampMicrosField":null,"dateField":"2020-01-01","nullableDateField":null,"timeMillisField":"23:59:59","nullableTimeMillisField":null,"timeMicrosField":"23:59:59","nullableTimeMicrosField":null,"stringField":"example","nullableStringField":null,"intField":42,"nullableIntField":null,"longField":1.23456789012345E14,"nullableLongField":null,"floatField":3.1400001,"nullableFloatField":null,"doubleField":2.718,"nullableDoubleField":null,"booleanField":true,"nullableBooleanField":null,"enumField":"ONE","nullableEnumField":null,"decimalField":1234.56,"complexArrayField":[{"itemFieldOne":1,"itemFieldTwo":"example"}],"multiNestedRecord":{"nestedLevelOne":{"levelOneField":"level1","nestedLevelTwo":{"levelTwoField":10}}},"nullableComplexArrayField":null}]}} \ No newline at end of file +{"data":{"MySchema":[{"uuidField":"223e4567-e89b-12d3-a456-426614174001","timestampMillisField":"2023-08-09T21:16:19.000Z","nullableTimestampMillisField":"2023-08-09T21:16:19.000Z","timestampMicrosField":"2023-08-09T21:16:19.000Z","nullableTimestampMicrosField":"2023-08-09T21:16:19.000Z","dateField":"2020-01-01","nullableDateField":null,"timeMillisField":"23:59:59","nullableTimeMillisField":"23:59:59","timeMicrosField":"23:59:59","nullableTimeMicrosField":"23:59:59","stringField":"example2","nullableStringField":"optional","intField":84,"nullableIntField":21,"longField":9.8765432109876E13,"nullableLongField":9.87654321E9,"floatField":6.28000021,"nullableFloatField":1.57000005,"doubleField":1.414,"nullableDoubleField":0.707,"booleanField":false,"nullableBooleanField":true,"enumField":"TWO","nullableEnumField":"FOUR","decimalField":7890.12,"complexArrayField":[{"itemFieldOne":2,"itemFieldTwo":"another"}],"multiNestedRecord":{"nestedLevelOne":{"levelOneField":"nestedLevel1","nestedLevelTwo":{"levelTwoField":20}}},"nestedRecord":{"nestedStringField":"nestedExample","nestedIntField":15},"nullableComplexArrayField":[{"nullableItemFieldOne":3.5,"nullableItemFieldTwo":true}],"nullableNestedRecord":{"nullableNestedStringField":"nullable","nullableNestedLongField":5.67890123456E11}},{"uuidField":"123e4567-e89b-12d3-a456-426614174000","timestampMillisField":"2023-08-08T17:29:39.000Z","nullableTimestampMillisField":null,"timestampMicrosField":"2023-08-08T17:29:39.000Z","nullableTimestampMicrosField":null,"dateField":"2020-01-01","nullableDateField":null,"timeMillisField":"23:59:59","nullableTimeMillisField":null,"timeMicrosField":"23:59:59","nullableTimeMicrosField":null,"stringField":"example","nullableStringField":null,"intField":42,"nullableIntField":null,"longField":1.23456789012345E14,"nullableLongField":null,"floatField":3.1400001,"nullableFloatField":null,"doubleField":2.718,"nullableDoubleField":null,"booleanField":true,"nullableBooleanField":null,"enumField":"ONE","nullableEnumField":null,"decimalField":1234.56,"complexArrayField":[{"itemFieldOne":1,"itemFieldTwo":"example"}],"multiNestedRecord":{"nestedLevelOne":{"levelOneField":"level1","nestedLevelTwo":{"levelTwoField":10}}},"nestedRecord":{"nestedStringField":"nested","nestedIntField":5},"nullableComplexArrayField":null,"nullableNestedRecord":null}]}} \ No newline at end of file diff --git a/sqrl-testing/sqrl-integration-tests/src/test/resources/usecases/avro-schema/snapshots-avro-schema/MySchemaQuery.snapshot b/sqrl-testing/sqrl-integration-tests/src/test/resources/usecases/avro-schema/snapshots-avro-schema/MySchemaQuery.snapshot index b66fdeeff..9486dafa1 100644 --- a/sqrl-testing/sqrl-integration-tests/src/test/resources/usecases/avro-schema/snapshots-avro-schema/MySchemaQuery.snapshot +++ b/sqrl-testing/sqrl-integration-tests/src/test/resources/usecases/avro-schema/snapshots-avro-schema/MySchemaQuery.snapshot @@ -1 +1 @@ -{"data":{"Schema":[{"uuidField":"223e4567-e89b-12d3-a456-426614174001","timestampMillisField":"2023-08-09T21:16:19.000Z","nullableTimestampMillisField":"2023-08-09T21:16:19.000Z","timestampMicrosField":"2023-08-09T21:16:19.000Z","nullableTimestampMicrosField":"2023-08-09T21:16:19.000Z","dateField":"2020-01-01","nullableDateField":null,"timeMillisField":"23:59:59","nullableTimeMillisField":"23:59:59","timeMicrosField":"23:59:59","nullableTimeMicrosField":"23:59:59","stringField":"example2","nullableStringField":"optional","intField":84,"nullableIntField":21,"longField":9.8765432109876E13,"nullableLongField":9.87654321E9,"floatField":6.28000021,"nullableFloatField":1.57000005,"doubleField":1.414,"nullableDoubleField":0.707,"booleanField":false,"nullableBooleanField":true,"enumField":"TWO","nullableEnumField":"FOUR","decimalField":7890.12,"complexArrayField":[{"itemFieldOne":2,"itemFieldTwo":"another"}],"multiNestedRecord":{"nestedLevelOne":{"levelOneField":"nestedLevel1","nestedLevelTwo":{"levelTwoField":20}}},"nullableComplexArrayField":[{"nullableItemFieldOne":3.5,"nullableItemFieldTwo":true}]},{"uuidField":"123e4567-e89b-12d3-a456-426614174000","timestampMillisField":"2023-08-08T17:29:39.000Z","nullableTimestampMillisField":null,"timestampMicrosField":"2023-08-08T17:29:39.000Z","nullableTimestampMicrosField":null,"dateField":"2020-01-01","nullableDateField":null,"timeMillisField":"23:59:59","nullableTimeMillisField":null,"timeMicrosField":"23:59:59","nullableTimeMicrosField":null,"stringField":"example","nullableStringField":null,"intField":42,"nullableIntField":null,"longField":1.23456789012345E14,"nullableLongField":null,"floatField":3.1400001,"nullableFloatField":null,"doubleField":2.718,"nullableDoubleField":null,"booleanField":true,"nullableBooleanField":null,"enumField":"ONE","nullableEnumField":null,"decimalField":1234.56,"complexArrayField":[{"itemFieldOne":1,"itemFieldTwo":"example"}],"multiNestedRecord":{"nestedLevelOne":{"levelOneField":"level1","nestedLevelTwo":{"levelTwoField":10}}},"nullableComplexArrayField":null}]}} \ No newline at end of file +{"data":{"Schema":[{"uuidField":"223e4567-e89b-12d3-a456-426614174001","timestampMillisField":"2023-08-09T21:16:19.000Z","nullableTimestampMillisField":"2023-08-09T21:16:19.000Z","timestampMicrosField":"2023-08-09T21:16:19.000Z","nullableTimestampMicrosField":"2023-08-09T21:16:19.000Z","dateField":"2020-01-01","nullableDateField":null,"timeMillisField":"23:59:59","nullableTimeMillisField":"23:59:59","timeMicrosField":"23:59:59","nullableTimeMicrosField":"23:59:59","stringField":"example2","nullableStringField":"optional","intField":84,"nullableIntField":21,"longField":9.8765432109876E13,"nullableLongField":9.87654321E9,"floatField":6.28000021,"nullableFloatField":1.57000005,"doubleField":1.414,"nullableDoubleField":0.707,"booleanField":false,"nullableBooleanField":true,"enumField":"TWO","nullableEnumField":"FOUR","decimalField":7890.12,"complexArrayField":[{"itemFieldOne":2,"itemFieldTwo":"another"}],"multiNestedRecord":{"nestedLevelOne":{"levelOneField":"nestedLevel1","nestedLevelTwo":{"levelTwoField":20}}},"nullableComplexArrayField":[{"nullableItemFieldOne":3.5,"nullableItemFieldTwo":true}],"nestedRecord":{"nestedStringField":"nestedExample","nestedIntField":15},"nullableNestedRecord":{"nullableNestedStringField":"nullable","nullableNestedLongField":5.67890123456E11}},{"uuidField":"123e4567-e89b-12d3-a456-426614174000","timestampMillisField":"2023-08-08T17:29:39.000Z","nullableTimestampMillisField":null,"timestampMicrosField":"2023-08-08T17:29:39.000Z","nullableTimestampMicrosField":null,"dateField":"2020-01-01","nullableDateField":null,"timeMillisField":"23:59:59","nullableTimeMillisField":null,"timeMicrosField":"23:59:59","nullableTimeMicrosField":null,"stringField":"example","nullableStringField":null,"intField":42,"nullableIntField":null,"longField":1.23456789012345E14,"nullableLongField":null,"floatField":3.1400001,"nullableFloatField":null,"doubleField":2.718,"nullableDoubleField":null,"booleanField":true,"nullableBooleanField":null,"enumField":"ONE","nullableEnumField":null,"decimalField":1234.56,"complexArrayField":[{"itemFieldOne":1,"itemFieldTwo":"example"}],"multiNestedRecord":{"nestedLevelOne":{"levelOneField":"level1","nestedLevelTwo":{"levelTwoField":10}}},"nullableComplexArrayField":null,"nestedRecord":{"nestedStringField":"nested","nestedIntField":5},"nullableNestedRecord":null}]}} \ No newline at end of file