Skip to content

Commit 1e7bcce

Browse files
committed
materialize-azure-fabric-warehouse: migrate integer to number
1 parent 5d31e3d commit 1e7bcce

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

materialize-azure-fabric-warehouse/.snapshots/TestValidateAndApplyMigrations

+13-5
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ Base Initial Constraints:
66
{"Field":"flow_document","Type":2,"TypeString":"LOCATION_REQUIRED","Reason":"The root document must be materialized"}
77
{"Field":"flow_published_at","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"The projection has a single scalar type"}
88
{"Field":"int64","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"The projection has a single scalar type"}
9+
{"Field":"int64ToNumber","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"The projection has a single scalar type"}
10+
{"Field":"intToNumber","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"The projection has a single scalar type"}
911
{"Field":"intWidenedToJson","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"The projection has a single scalar type"}
10-
{"Field":"key","Type":2,"TypeString":"LOCATION_REQUIRED","Reason":"All Locations that are part of the collections key are required"}
12+
{"Field":"key","Type":2,"TypeString":"LOCATION_REQUIRED","Reason":"The first collection key component is required to be included for standard updates"}
1113
{"Field":"multiple","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"This field is able to be materialized"}
1214
{"Field":"nonScalarValue","Type":4,"TypeString":"FIELD_OPTIONAL","Reason":"Object fields may be materialized"}
1315
{"Field":"nullValue","Type":5,"TypeString":"FIELD_FORBIDDEN","Reason":"Cannot materialize a field where the only possible type is 'null'"}
@@ -27,6 +29,8 @@ Migratable Changes Before Apply Schema:
2729
{"Name":"flow_document","Nullable":"YES","Type":"varchar"}
2830
{"Name":"flow_published_at","Nullable":"YES","Type":"datetime2"}
2931
{"Name":"int64","Nullable":"YES","Type":"bigint"}
32+
{"Name":"int64ToNumber","Nullable":"YES","Type":"decimal"}
33+
{"Name":"intToNumber","Nullable":"YES","Type":"bigint"}
3034
{"Name":"intWidenedToJson","Nullable":"YES","Type":"bigint"}
3135
{"Name":"key","Nullable":"YES","Type":"varchar"}
3236
{"Name":"multiple","Nullable":"YES","Type":"varchar"}
@@ -40,8 +44,8 @@ Migratable Changes Before Apply Schema:
4044

4145

4246
Migratable Changes Before Apply Data:
43-
key (NVARCHAR), _meta/flow_truncated (BIT), boolWidenedToJson (BIT), dateValue (DATE), datetimeValue (DATETIME2), flow_published_at (DATETIME2), int64 (BIGINT), intWidenedToJson (BIGINT), multiple (NVARCHAR), nonScalarValue (NVARCHAR), numericString (DECIMAL), optional (NVARCHAR), requiredNumeric (DECIMAL), scalarValue (NVARCHAR), stringWidenedToJson (NVARCHAR), timeValue (TIME), flow_document (NVARCHAR)
44-
1, false, true, 2024-01-01T00:00:00Z, 2024-01-01T01:01:01.111111Z, 2024-09-13T01:01:01Z, 1, 999, <nil>, <nil>, 123, <nil>, 456, test, hello, 0001-01-01T01:01:01Z, {}
47+
key (NVARCHAR), _meta/flow_truncated (BIT), boolWidenedToJson (BIT), dateValue (DATE), datetimeValue (DATETIME2), flow_published_at (DATETIME2), int64 (BIGINT), int64ToNumber (DECIMAL), intToNumber (BIGINT), intWidenedToJson (BIGINT), multiple (NVARCHAR), nonScalarValue (NVARCHAR), numericString (DECIMAL), optional (NVARCHAR), requiredNumeric (DECIMAL), scalarValue (NVARCHAR), stringWidenedToJson (NVARCHAR), timeValue (TIME), flow_document (NVARCHAR)
48+
1, false, true, 2024-01-01T00:00:00Z, 2024-01-01T01:01:01.111111Z, 2024-09-13T01:01:01Z, 1, 10000000000000000000, 9223372036854775807, 999, <nil>, <nil>, 123, <nil>, 456, test, hello, 0001-01-01T01:01:01Z, {}
4549

4650
Migratable Changes Constraints:
4751
{"Field":"_meta/flow_truncated","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"This location is part of the current materialization"}
@@ -51,6 +55,8 @@ Migratable Changes Constraints:
5155
{"Field":"flow_document","Type":1,"TypeString":"FIELD_REQUIRED","Reason":"This field is the document in the current materialization"}
5256
{"Field":"flow_published_at","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"This location is part of the current materialization"}
5357
{"Field":"int64","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"This location is part of the current materialization"}
58+
{"Field":"int64ToNumber","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"This location is part of the current materialization"}
59+
{"Field":"intToNumber","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"This location is part of the current materialization"}
5460
{"Field":"intWidenedToJson","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"This location is part of the current materialization"}
5561
{"Field":"key","Type":1,"TypeString":"FIELD_REQUIRED","Reason":"This field is a key in the current materialization"}
5662
{"Field":"multiple","Type":3,"TypeString":"LOCATION_RECOMMENDED","Reason":"This location is part of the current materialization"}
@@ -72,6 +78,8 @@ Migratable Changes Applied Schema:
7278
{"Name":"flow_document","Nullable":"YES","Type":"varchar"}
7379
{"Name":"flow_published_at","Nullable":"YES","Type":"datetime2"}
7480
{"Name":"int64","Nullable":"YES","Type":"decimal"}
81+
{"Name":"int64ToNumber","Nullable":"YES","Type":"float"}
82+
{"Name":"intToNumber","Nullable":"YES","Type":"float"}
7583
{"Name":"intWidenedToJson","Nullable":"YES","Type":"varchar"}
7684
{"Name":"key","Nullable":"YES","Type":"varchar"}
7785
{"Name":"multiple","Nullable":"YES","Type":"varchar"}
@@ -85,6 +93,6 @@ Migratable Changes Applied Schema:
8593

8694

8795
Migratable Changes Applied Data:
88-
key (NVARCHAR), _meta/flow_truncated (BIT), boolWidenedToJson (NVARCHAR), dateValue (NVARCHAR), datetimeValue (NVARCHAR), flow_published_at (DATETIME2), int64 (DECIMAL), intWidenedToJson (NVARCHAR), multiple (NVARCHAR), nonScalarValue (NVARCHAR), numericString (NVARCHAR), optional (NVARCHAR), requiredNumeric (NVARCHAR), scalarValue (NVARCHAR), stringWidenedToJson (NVARCHAR), timeValue (NVARCHAR), flow_document (NVARCHAR)
89-
1, false, true, 2024-01-01, 2024-01-01 01:01:01.111111, 2024-09-13T01:01:01Z, 1, 999, <nil>, <nil>, 123, <nil>, 456, test, hello, 01:01:01.000000, {}
96+
key (NVARCHAR), _meta/flow_truncated (BIT), boolWidenedToJson (NVARCHAR), dateValue (NVARCHAR), datetimeValue (NVARCHAR), flow_published_at (DATETIME2), int64 (DECIMAL), int64ToNumber (FLOAT), intToNumber (FLOAT), intWidenedToJson (NVARCHAR), multiple (NVARCHAR), nonScalarValue (NVARCHAR), numericString (NVARCHAR), optional (NVARCHAR), requiredNumeric (NVARCHAR), scalarValue (NVARCHAR), stringWidenedToJson (NVARCHAR), timeValue (NVARCHAR), flow_document (NVARCHAR)
97+
1, false, true, 2024-01-01, 2024-01-01 01:01:01.111111, 2024-09-13T01:01:01Z, 1, 1e+19, 9.223372036854776e+18, 999, <nil>, <nil>, 123, <nil>, 456, test, hello, 01:01:01.000000, {}
9098

materialize-azure-fabric-warehouse/sqlgen.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ var dialect = func() sql.Dialect {
4848

4949
return sql.Dialect{
5050
MigratableTypes: sql.MigrationSpecs{
51-
"bigint": {sql.NewMigrationSpec([]string{"DECIMAL(38,0)", "VARCHAR(MAX)"})},
52-
"decimal": {sql.NewMigrationSpec([]string{"VARCHAR(MAX)"})},
51+
"bigint": {sql.NewMigrationSpec([]string{"FLOAT", "DECIMAL(38,0)", "VARCHAR(MAX)"})},
52+
"decimal": {sql.NewMigrationSpec([]string{"FLOAT", "VARCHAR(MAX)"})},
5353
"float": {sql.NewMigrationSpec([]string{"VARCHAR(MAX)"})},
5454
"bit": {sql.NewMigrationSpec([]string{"VARCHAR(MAX)"}, sql.WithCastSQL(bitToStringCast))},
5555
"date": {sql.NewMigrationSpec([]string{"VARCHAR(MAX)"})},

0 commit comments

Comments
 (0)