MariaDB: LOAD DATA INFILE with dynamic_columns

I have a table that looks like this (using MariaDB):

CREATE TABLE table1 (
  id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY
  ,c_id varchar(40) NULL
  ,email varchar(150) NULL
  ,dynamic_columns BLOB NULL
  ,created_at TIMESTAMP NOT NULL DEFAULT 0
  ,updated_at TIMESTAMP NULL DEFAULT current_timestamp ON UPDATE current_timestamp
);

      

I am loading data from some legacy tables into this table and I am using MariaDB dynamic_columns

to store up to 3 dynamic columns based on the old table. ( https://mariadb.com/kb/en/mariadb/documentation/nosql/dynamic-columns/ )

I would like to use LOAD DATA INFILE

swift / bulk to insert stale data into a new table, but I cannot figure out how to do it with dynamic columns.

Google search has become zilch.

+3


source to share


1 answer


Dynamic columns are stored in an internal binary format. To create or modify a dynamic column outside of the MariaDB server, you must use the Dynamic API for the MariaDB / C connector:

https://mariadb.com/kb/en/mariadb/dynamic-columns-api/



You will also find some examples in the Connector / C test suite:

https://github.com/MariaDB/mariadb-connector-c/blob/master/unittest/libmariadb/dyncol.c

0


source







All Articles