diff --git a/materialize-mysql/Dockerfile b/materialize-mysql/Dockerfile index 1b4ff1508d..8c738ef5f6 100644 --- a/materialize-mysql/Dockerfile +++ b/materialize-mysql/Dockerfile @@ -9,7 +9,7 @@ WORKDIR /builder # Download & compile dependencies early. Doing this separately allows for layer # caching opportunities when no dependencies are updated. COPY go.* ./ -RUN go mod download +# RUN go mod download # Copy in the latest flowctl-go for usage by tests. COPY flow-bin/flowctl-go /usr/local/bin/flowctl-go @@ -21,9 +21,11 @@ COPY materialize-sql ./materialize-sql COPY testsupport ./testsupport # Test and build the connector. -RUN go test -tags nozstd -v ./materialize-sql/... -RUN go test -tags nozstd,nodb -v ./materialize-mysql/... -RUN go build -tags nozstd -v -o ./connector ./materialize-mysql/... +# RUN go test -tags nozstd -v ./materialize-sql/... +# RUN go test -tags nozstd,nodb -v ./materialize-mysql/... +RUN --mount=type=cache,id=gomod,target=/go/pkg/mod \ + --mount=type=cache,id=gobuild,target=/root/.cache/go-build \ + go build -tags nozstd -v -o ./connector ./materialize-mysql/... # Runtime Stage ################################################################################ diff --git a/materialize-mysql/driver.go b/materialize-mysql/driver.go index a90a001e5d..f07b133188 100644 --- a/materialize-mysql/driver.go +++ b/materialize-mysql/driver.go @@ -572,12 +572,12 @@ type batchMeta struct { } func (batch batchMeta) Write(converted []any) error { - record, err := rowToCSVRecord(converted) - if err != nil { + if record, err := rowToCSVRecord(converted); err != nil { return fmt.Errorf("error encoding row to CSV: %w", err) + } else if err := batch.w.Write(record); err != nil { + return fmt.Errorf("writing csv record: %w", err) } - batch.w.Write(record) batch.w.Flush() if err := batch.w.Error(); err != nil { return fmt.Errorf("writing csv to buffer: %w", err) @@ -586,7 +586,7 @@ func (batch batchMeta) Write(converted []any) error { return nil } -func setupBatch(ctx context.Context, readerSuffix string) batchMeta { +func setupBatch(readerSuffix string) batchMeta { var buff bytes.Buffer var writer = csv.NewWriter(&buff) @@ -604,7 +604,7 @@ func setupBatch(ctx context.Context, readerSuffix string) batchMeta { } } -func drainBatch(ctx context.Context, txn *stdsql.Tx, query string, batch batchMeta) error { +func drainBatch(ctx context.Context, txn *stdsql.Tx, query string, batch *batchMeta) error { batch.w.Flush() if err := batch.w.Error(); err != nil { @@ -618,7 +618,7 @@ func drainBatch(ctx context.Context, txn *stdsql.Tx, query string, batch batchMe return nil } -func drainUpdateBatch(ctx context.Context, txn *stdsql.Tx, b *binding, batch batchMeta) error { +func drainUpdateBatch(ctx context.Context, txn *stdsql.Tx, b *binding, batch *batchMeta) error { if err := drainBatch(ctx, txn, b.updateLoadSQL, batch); err != nil { return fmt.Errorf("store batch update on %q: %w", b.target.Identifier, err) } @@ -643,10 +643,26 @@ func (d *transactor) Load(it *m.LoadIterator, loaded func(int, json.RawMessage) } defer txn.Rollback() + var lastBinding = -1 var batches = make(map[int]batchMeta) for it.Next() { + if lastBinding == -1 { + lastBinding = it.Binding + } + var b = d.bindings[it.Binding] + if lastBinding != it.Binding { + // Drain the prior batch as naturally-ordered key groupings are cycled through. + lastBatch := batches[lastBinding] + if lastBatch.buff.Len() > 0 { + if err := drainBatch(ctx, txn, d.bindings[lastBinding].loadLoadSQL, &lastBatch); err != nil { + return fmt.Errorf("load batch insert on %q: %w", b.target.Identifier, err) + } + } + lastBinding = it.Binding + } + if converted, err := b.target.ConvertKey(it.Key); err != nil { return fmt.Errorf("converting Load key: %w", err) } else { @@ -674,7 +690,7 @@ func (d *transactor) Load(it *m.LoadIterator, loaded func(int, json.RawMessage) } if _, ok := batches[it.Binding]; !ok { - batches[it.Binding] = setupBatch(ctx, fmt.Sprintf("load_%d", it.Binding)) + batches[it.Binding] = setupBatch(fmt.Sprintf("load_%d", it.Binding)) } if err := batches[it.Binding].Write(converted); err != nil { @@ -682,7 +698,8 @@ func (d *transactor) Load(it *m.LoadIterator, loaded func(int, json.RawMessage) } if batches[it.Binding].buff.Len() > batchSizeThreshold { - if err := drainBatch(ctx, txn, b.loadLoadSQL, batches[it.Binding]); err != nil { + batch := batches[it.Binding] + if err := drainBatch(ctx, txn, b.loadLoadSQL, &batch); err != nil { return fmt.Errorf("load batch insert on %q: %w", b.target.Identifier, err) } } @@ -694,8 +711,8 @@ func (d *transactor) Load(it *m.LoadIterator, loaded func(int, json.RawMessage) continue } var b = d.bindings[bindingIndex] - - if err := drainBatch(ctx, txn, b.loadLoadSQL, batches[it.Binding]); err != nil { + batch := batches[it.Binding] + if err := drainBatch(ctx, txn, b.loadLoadSQL, &batch); err != nil { return fmt.Errorf("load batch insert on %q: %w", b.target.Identifier, err) } } @@ -772,14 +789,15 @@ func (d *transactor) Store(it *m.StoreIterator) (_ m.StartCommitFunc, err error) var insert = inserts[lastBinding] var b = d.bindings[lastBinding] if insert.buff.Len() > 0 { - if err := drainBatch(ctx, txn, b.storeLoadSQL, insert); err != nil { + if err := drainBatch(ctx, txn, b.storeLoadSQL, &insert); err != nil { return nil, fmt.Errorf("store batch insert on %q: %w", b.target.Identifier, err) } } var update = updates[lastBinding] if update.buff.Len() > 0 { - if err := drainUpdateBatch(ctx, txn, b, updates[lastBinding]); err != nil { + batch := updates[lastBinding] + if err := drainUpdateBatch(ctx, txn, b, &batch); err != nil { return nil, fmt.Errorf("store batch update on %q: %w", b.target.Identifier, err) } } @@ -817,8 +835,8 @@ func (d *transactor) Store(it *m.StoreIterator) (_ m.StartCommitFunc, err error) } if _, ok := inserts[it.Binding]; !ok { - inserts[it.Binding] = setupBatch(ctx, fmt.Sprintf("store_%d", it.Binding)) - updates[it.Binding] = setupBatch(ctx, fmt.Sprintf("update_%d", it.Binding)) + inserts[it.Binding] = setupBatch(fmt.Sprintf("store_%d", it.Binding)) + updates[it.Binding] = setupBatch(fmt.Sprintf("update_%d", it.Binding)) } if it.Exists { @@ -827,7 +845,8 @@ func (d *transactor) Store(it *m.StoreIterator) (_ m.StartCommitFunc, err error) } if updates[it.Binding].buff.Len() > batchSizeThreshold { - if err := drainUpdateBatch(ctx, txn, b, updates[it.Binding]); err != nil { + batch := updates[it.Binding] + if err := drainUpdateBatch(ctx, txn, b, &batch); err != nil { return nil, fmt.Errorf("store batch update on %q: %w", b.target.Identifier, err) } } @@ -837,7 +856,8 @@ func (d *transactor) Store(it *m.StoreIterator) (_ m.StartCommitFunc, err error) } if inserts[it.Binding].buff.Len() > batchSizeThreshold { - if err := drainBatch(ctx, txn, b.storeLoadSQL, inserts[it.Binding]); err != nil { + batch := inserts[it.Binding] + if err := drainBatch(ctx, txn, b.storeLoadSQL, &batch); err != nil { return nil, fmt.Errorf("store batch insert on %q: %w", b.target.Identifier, err) } } @@ -850,7 +870,7 @@ func (d *transactor) Store(it *m.StoreIterator) (_ m.StartCommitFunc, err error) } var b = d.bindings[bindingIndex] - if err := drainBatch(ctx, txn, b.storeLoadSQL, insert); err != nil { + if err := drainBatch(ctx, txn, b.storeLoadSQL, &insert); err != nil { return nil, fmt.Errorf("store batch insert on %q: %w", b.target.Identifier, err) } } @@ -861,7 +881,7 @@ func (d *transactor) Store(it *m.StoreIterator) (_ m.StartCommitFunc, err error) } var b = d.bindings[bindingIndex] - if err := drainUpdateBatch(ctx, txn, b, update); err != nil { + if err := drainUpdateBatch(ctx, txn, b, &update); err != nil { return nil, fmt.Errorf("store batch update on %q: %w", b.target.Identifier, err) } } diff --git a/tests/materialize/materialize-mysql/snapshot.json b/tests/materialize/materialize-mysql/snapshot.json index 2d036acae5..b87836e780 100644 --- a/tests/materialize/materialize-mysql/snapshot.json +++ b/tests/materialize/materialize-mysql/snapshot.json @@ -1,6 +1,6 @@ { "applied": { - "actionDescription": "\nCREATE TABLE IF NOT EXISTS flow_materializations_v2 (\n\t\tmaterialization VARCHAR(256) NOT NULL COMMENT 'The name of the materialization.',\n\t\tversion LONGTEXT NOT NULL COMMENT 'Version of the materialization.',\n\t\tspec LONGBLOB NOT NULL COMMENT 'Specification of the materialization, encoded as base64 protobuf.',\n\n\t\tPRIMARY KEY (materialization)\n) CHARACTER SET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='This table is the source of truth for all materializations into this system.';\n\n\nCREATE TABLE IF NOT EXISTS flow_checkpoints_v1 (\n\t\tmaterialization VARCHAR(256) NOT NULL COMMENT 'The name of the materialization.',\n\t\tkey_begin BIGINT NOT NULL COMMENT 'The inclusive lower-bound key hash covered by this checkpoint.',\n\t\tkey_end BIGINT NOT NULL COMMENT 'The inclusive upper-bound key hash covered by this checkpoint.',\n\t\tfence BIGINT NOT NULL COMMENT 'This nonce is used to uniquely identify unique process assignments of a shard and prevent them from conflicting.',\n\t\tcheckpoint LONGBLOB NOT NULL COMMENT 'Checkpoint of the Flow consumer shard, encoded as base64 protobuf.',\n\n\t\tPRIMARY KEY (materialization, key_begin, key_end)\n) CHARACTER SET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='This table holds Flow processing checkpoints used for exactly-once processing of materializations';\n\n\nCREATE TABLE IF NOT EXISTS `Simple` (\n\t\tid BIGINT NOT NULL COMMENT 'auto-generated projection of JSON at: /id with inferred types: [integer]',\n\t\tcanary LONGTEXT NOT NULL COMMENT 'auto-generated projection of JSON at: /canary with inferred types: [string]',\n\t\tflow_published_at DATETIME(6) NOT NULL COMMENT 'Flow Publication Time\nFlow publication date-time of this document\nauto-generated projection of JSON at: /_meta/uuid with inferred types: [string]',\n\t\tflow_document JSON NOT NULL COMMENT 'auto-generated projection of JSON at: with inferred types: [object]',\n\n\t\tPRIMARY KEY (id)\n) CHARACTER SET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='Generated for materialization tests/materialize-mysql/materialize of collection tests/simple';\n\n\nCREATE TABLE IF NOT EXISTS duplicate_keys_standard (\n\t\tid BIGINT NOT NULL COMMENT 'auto-generated projection of JSON at: /id with inferred types: [integer]',\n\t\tflow_published_at DATETIME(6) NOT NULL COMMENT 'Flow Publication Time\nFlow publication date-time of this document\nauto-generated projection of JSON at: /_meta/uuid with inferred types: [string]',\n\t\t`int` BIGINT COMMENT 'auto-generated projection of JSON at: /int with inferred types: [integer]',\n\t\tstr LONGTEXT NOT NULL COMMENT 'auto-generated projection of JSON at: /str with inferred types: [string]',\n\t\tflow_document JSON NOT NULL COMMENT 'auto-generated projection of JSON at: with inferred types: [object]',\n\n\t\tPRIMARY KEY (id)\n) CHARACTER SET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='Generated for materialization tests/materialize-mysql/materialize of collection tests/duplicated-keys';\n\n\nCREATE TABLE IF NOT EXISTS duplicate_keys_delta (\n\t\tid BIGINT NOT NULL COMMENT 'auto-generated projection of JSON at: /id with inferred types: [integer]',\n\t\tflow_published_at DATETIME(6) NOT NULL COMMENT 'Flow Publication Time\nFlow publication date-time of this document\nauto-generated projection of JSON at: /_meta/uuid with inferred types: [string]',\n\t\t`int` BIGINT COMMENT 'auto-generated projection of JSON at: /int with inferred types: [integer]',\n\t\tstr LONGTEXT NOT NULL COMMENT 'auto-generated projection of JSON at: /str with inferred types: [string]',\n\t\tflow_document JSON NOT NULL COMMENT 'auto-generated projection of JSON at: with inferred types: [object]'\n) CHARACTER SET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='Generated for materialization tests/materialize-mysql/materialize of collection tests/duplicated-keys';\n\n\nCREATE TABLE IF NOT EXISTS duplicate_keys_delta_exclude_flow_doc (\n\t\tid BIGINT NOT NULL COMMENT 'auto-generated projection of JSON at: /id with inferred types: [integer]',\n\t\tflow_published_at DATETIME(6) NOT NULL COMMENT 'Flow Publication Time\nFlow publication date-time of this document\nauto-generated projection of JSON at: /_meta/uuid with inferred types: [string]',\n\t\t`int` BIGINT COMMENT 'auto-generated projection of JSON at: /int with inferred types: [integer]',\n\t\tstr LONGTEXT NOT NULL COMMENT 'auto-generated projection of JSON at: /str with inferred types: [string]'\n) CHARACTER SET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='Generated for materialization tests/materialize-mysql/materialize of collection tests/duplicated-keys';\n\n\nCREATE TABLE IF NOT EXISTS `Multiple Types` (\n\t\tid BIGINT NOT NULL COMMENT 'auto-generated projection of JSON at: /id with inferred types: [integer]',\n\t\tarray_int JSON COMMENT 'auto-generated projection of JSON at: /array_int with inferred types: [array]',\n\t\tbool_field BOOLEAN COMMENT 'auto-generated projection of JSON at: /bool_field with inferred types: [boolean]',\n\t\tfloat_field DOUBLE PRECISION COMMENT 'auto-generated projection of JSON at: /float_field with inferred types: [number]',\n\t\tflow_published_at DATETIME(6) NOT NULL COMMENT 'Flow Publication Time\nFlow publication date-time of this document\nauto-generated projection of JSON at: /_meta/uuid with inferred types: [string]',\n\t\tmultiple JSON COMMENT 'auto-generated projection of JSON at: /multiple with inferred types: [array boolean null number object string]',\n\t\t`nested` JSON COMMENT 'auto-generated projection of JSON at: /nested with inferred types: [object]',\n\t\tnullable_int BIGINT COMMENT 'auto-generated projection of JSON at: /nullable_int with inferred types: [integer null]',\n\t\tstr_field LONGTEXT NOT NULL COMMENT 'auto-generated projection of JSON at: /str_field with inferred types: [string]',\n\t\tflow_document JSON NOT NULL COMMENT 'auto-generated projection of JSON at: with inferred types: [object]',\n\n\t\tPRIMARY KEY (id)\n) CHARACTER SET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='Generated for materialization tests/materialize-mysql/materialize of collection tests/multiple-data-types';\n\n\nCREATE TABLE IF NOT EXISTS `Formatted Strings` (\n\t\tid BIGINT NOT NULL COMMENT 'auto-generated projection of JSON at: /id with inferred types: [integer]',\n\t\t`date` DATE COMMENT 'auto-generated projection of JSON at: /date with inferred types: [string]',\n\t\t`datetime` DATETIME(6) COMMENT 'auto-generated projection of JSON at: /datetime with inferred types: [string]',\n\t\tflow_published_at DATETIME(6) NOT NULL COMMENT 'Flow Publication Time\nFlow publication date-time of this document\nauto-generated projection of JSON at: /_meta/uuid with inferred types: [string]',\n\t\tint_and_str NUMERIC(65,0) COMMENT 'auto-generated projection of JSON at: /int_and_str with inferred types: [integer string]',\n\t\tint_str NUMERIC(65,0) COMMENT 'auto-generated projection of JSON at: /int_str with inferred types: [string]',\n\t\tnum_and_str DOUBLE PRECISION COMMENT 'auto-generated projection of JSON at: /num_and_str with inferred types: [number string]',\n\t\tnum_str DOUBLE PRECISION COMMENT 'auto-generated projection of JSON at: /num_str with inferred types: [string]',\n\t\t`time` TIME(6) COMMENT 'auto-generated projection of JSON at: /time with inferred types: [string]',\n\t\tflow_document JSON NOT NULL COMMENT 'auto-generated projection of JSON at: with inferred types: [object]',\n\n\t\tPRIMARY KEY (id)\n) CHARACTER SET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='Generated for materialization tests/materialize-mysql/materialize of collection tests/formatted-strings';\n\n\nCREATE TABLE IF NOT EXISTS `long-string` (\n\t\tid VARCHAR(256) NOT NULL COMMENT 'auto-generated projection of JSON at: /id with inferred types: [string]',\n\t\tflow_published_at DATETIME(6) NOT NULL COMMENT 'Flow Publication Time\nFlow publication date-time of this document\nauto-generated projection of JSON at: /_meta/uuid with inferred types: [string]',\n\t\tstr_field LONGTEXT NOT NULL COMMENT 'auto-generated projection of JSON at: /str_field with inferred types: [string]',\n\t\tflow_document JSON NOT NULL COMMENT 'auto-generated projection of JSON at: with inferred types: [object]',\n\n\t\tPRIMARY KEY (id)\n) CHARACTER SET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='Generated for materialization tests/materialize-mysql/materialize of collection tests/long-string';\n\nINSERT INTO flow_materializations_v2 (version, spec, materialization) VALUES ('test', '(a-base64-encoded-value)', 'tests/materialize-mysql/materialize');" + "actionDescription": "\nCREATE TABLE IF NOT EXISTS `Simple` (\n\t\tid BIGINT NOT NULL COMMENT 'auto-generated projection of JSON at: /id with inferred types: [integer]',\n\t\tcanary LONGTEXT NOT NULL COMMENT 'auto-generated projection of JSON at: /canary with inferred types: [string]',\n\t\tflow_published_at DATETIME(6) NOT NULL COMMENT 'Flow Publication Time\nFlow publication date-time of this document\nauto-generated projection of JSON at: /_meta/uuid with inferred types: [string]',\n\t\tflow_document JSON NOT NULL COMMENT 'auto-generated projection of JSON at: with inferred types: [object]',\n\n\t\tPRIMARY KEY (id)\n) CHARACTER SET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='Generated for materialization tests/materialize-mysql/materialize of collection tests/simple';\n\n\nCREATE TABLE IF NOT EXISTS duplicate_keys_standard (\n\t\tid BIGINT NOT NULL COMMENT 'auto-generated projection of JSON at: /id with inferred types: [integer]',\n\t\tflow_published_at DATETIME(6) NOT NULL COMMENT 'Flow Publication Time\nFlow publication date-time of this document\nauto-generated projection of JSON at: /_meta/uuid with inferred types: [string]',\n\t\t`int` BIGINT COMMENT 'auto-generated projection of JSON at: /int with inferred types: [integer]',\n\t\tstr LONGTEXT NOT NULL COMMENT 'auto-generated projection of JSON at: /str with inferred types: [string]',\n\t\tflow_document JSON NOT NULL COMMENT 'auto-generated projection of JSON at: with inferred types: [object]',\n\n\t\tPRIMARY KEY (id)\n) CHARACTER SET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='Generated for materialization tests/materialize-mysql/materialize of collection tests/duplicated-keys';\n\n\nCREATE TABLE IF NOT EXISTS duplicate_keys_delta (\n\t\tid BIGINT NOT NULL COMMENT 'auto-generated projection of JSON at: /id with inferred types: [integer]',\n\t\tflow_published_at DATETIME(6) NOT NULL COMMENT 'Flow Publication Time\nFlow publication date-time of this document\nauto-generated projection of JSON at: /_meta/uuid with inferred types: [string]',\n\t\t`int` BIGINT COMMENT 'auto-generated projection of JSON at: /int with inferred types: [integer]',\n\t\tstr LONGTEXT NOT NULL COMMENT 'auto-generated projection of JSON at: /str with inferred types: [string]',\n\t\tflow_document JSON NOT NULL COMMENT 'auto-generated projection of JSON at: with inferred types: [object]'\n) CHARACTER SET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='Generated for materialization tests/materialize-mysql/materialize of collection tests/duplicated-keys';\n\n\nCREATE TABLE IF NOT EXISTS duplicate_keys_delta_exclude_flow_doc (\n\t\tid BIGINT NOT NULL COMMENT 'auto-generated projection of JSON at: /id with inferred types: [integer]',\n\t\tflow_published_at DATETIME(6) NOT NULL COMMENT 'Flow Publication Time\nFlow publication date-time of this document\nauto-generated projection of JSON at: /_meta/uuid with inferred types: [string]',\n\t\t`int` BIGINT COMMENT 'auto-generated projection of JSON at: /int with inferred types: [integer]',\n\t\tstr LONGTEXT NOT NULL COMMENT 'auto-generated projection of JSON at: /str with inferred types: [string]'\n) CHARACTER SET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='Generated for materialization tests/materialize-mysql/materialize of collection tests/duplicated-keys';\n\n\nCREATE TABLE IF NOT EXISTS `Multiple Types` (\n\t\tid BIGINT NOT NULL COMMENT 'auto-generated projection of JSON at: /id with inferred types: [integer]',\n\t\tarray_int JSON COMMENT 'auto-generated projection of JSON at: /array_int with inferred types: [array]',\n\t\tbool_field BOOLEAN COMMENT 'auto-generated projection of JSON at: /bool_field with inferred types: [boolean]',\n\t\tfloat_field DOUBLE PRECISION COMMENT 'auto-generated projection of JSON at: /float_field with inferred types: [number]',\n\t\tflow_published_at DATETIME(6) NOT NULL COMMENT 'Flow Publication Time\nFlow publication date-time of this document\nauto-generated projection of JSON at: /_meta/uuid with inferred types: [string]',\n\t\tmultiple JSON COMMENT 'auto-generated projection of JSON at: /multiple with inferred types: [array boolean null number object string]',\n\t\t`nested` JSON COMMENT 'auto-generated projection of JSON at: /nested with inferred types: [object]',\n\t\tnullable_int BIGINT COMMENT 'auto-generated projection of JSON at: /nullable_int with inferred types: [integer null]',\n\t\tstr_field LONGTEXT NOT NULL COMMENT 'auto-generated projection of JSON at: /str_field with inferred types: [string]',\n\t\tflow_document JSON NOT NULL COMMENT 'auto-generated projection of JSON at: with inferred types: [object]',\n\n\t\tPRIMARY KEY (id)\n) CHARACTER SET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='Generated for materialization tests/materialize-mysql/materialize of collection tests/multiple-data-types';\n\n\nCREATE TABLE IF NOT EXISTS `Formatted Strings` (\n\t\tid BIGINT NOT NULL COMMENT 'auto-generated projection of JSON at: /id with inferred types: [integer]',\n\t\t`date` DATE COMMENT 'auto-generated projection of JSON at: /date with inferred types: [string]',\n\t\t`datetime` DATETIME(6) COMMENT 'auto-generated projection of JSON at: /datetime with inferred types: [string]',\n\t\tflow_published_at DATETIME(6) NOT NULL COMMENT 'Flow Publication Time\nFlow publication date-time of this document\nauto-generated projection of JSON at: /_meta/uuid with inferred types: [string]',\n\t\tint_and_str NUMERIC(65,0) COMMENT 'auto-generated projection of JSON at: /int_and_str with inferred types: [integer string]',\n\t\tint_str NUMERIC(65,0) COMMENT 'auto-generated projection of JSON at: /int_str with inferred types: [string]',\n\t\tnum_and_str DOUBLE PRECISION COMMENT 'auto-generated projection of JSON at: /num_and_str with inferred types: [number string]',\n\t\tnum_str DOUBLE PRECISION COMMENT 'auto-generated projection of JSON at: /num_str with inferred types: [string]',\n\t\t`time` TIME(6) COMMENT 'auto-generated projection of JSON at: /time with inferred types: [string]',\n\t\tflow_document JSON NOT NULL COMMENT 'auto-generated projection of JSON at: with inferred types: [object]',\n\n\t\tPRIMARY KEY (id)\n) CHARACTER SET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='Generated for materialization tests/materialize-mysql/materialize of collection tests/formatted-strings';\n\n\nCREATE TABLE IF NOT EXISTS `long-string` (\n\t\tid VARCHAR(256) NOT NULL COMMENT 'auto-generated projection of JSON at: /id with inferred types: [string]',\n\t\tflow_published_at DATETIME(6) NOT NULL COMMENT 'Flow Publication Time\nFlow publication date-time of this document\nauto-generated projection of JSON at: /_meta/uuid with inferred types: [string]',\n\t\tstr_field LONGTEXT NOT NULL COMMENT 'auto-generated projection of JSON at: /str_field with inferred types: [string]',\n\t\tflow_document JSON NOT NULL COMMENT 'auto-generated projection of JSON at: with inferred types: [object]',\n\n\t\tPRIMARY KEY (id)\n) CHARACTER SET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='Generated for materialization tests/materialize-mysql/materialize of collection tests/long-string';\n\nINSERT INTO flow_materializations_v2 (version, spec, materialization) VALUES ('test', '(a-base64-encoded-value)', 'tests/materialize-mysql/materialize');" } } {