Skip to content

Files

Latest commit

006c944 · Jun 11, 2024

History

History

add_nullable_column_to_landing_data_source

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
May 27, 2024
Jan 10, 2024
May 27, 2024
Jan 19, 2024
May 27, 2024
Jun 11, 2024

Tinybird Versions - Add Column to a Landing Data Source

Pull Request

  • Just a add the desired column

Depending on the use case, there are different options:

  1. If you're already sending the new column to the Data Source, just add the new column with the proper type.
SCHEMA >
    `timestamp` DateTime `json:$.timestamp`,
    `session_id` String `json:$.session_id`,
    `action` LowCardinality(String) `json:$.action`,
    `version` LowCardinality(String) `json:$.version`,
    `environment` Nullable(String) `json:$.environment`,
+   `new_column` String `json:$.new_column`,
    `payload` String `json:$.payload`
  1. If you're using the Events API and not always sending data with the new column (for example you have several clients and need to migrate them gradually). You'll need to add it as Nullable. In other case, the rows sent without the new_column value will fail and be stored into the Quarantine Data Source.
SCHEMA >
    `timestamp` DateTime `json:$.timestamp`,
    `session_id` String `json:$.session_id`,
    `action` LowCardinality(String) `json:$.action`,
    `version` LowCardinality(String) `json:$.version`,
    `environment` Nullable(String) `json:$.environment`,
+   `new_column` Nullable(String) `json:$.new_column`,
    `payload` String `json:$.payload`
  1. If you want to perform a backfill operation to ingest a default value for the new column read this example