Hi,
I am facing a scenario in memSQL which I want to handle.
I have a memSQL table which is getting loaded from csv file.
The column order in the file can be changed from the application which is generating the file.
Meaning if today Col1 is the first in the file, tomorrow it can be 3rd column and so on.
I want to write a pre process step (SP etc), which can check the column order from the file and compare with the table column order. If there is change in order, it can change the column ordinal position in the table as coming in the file before loading, so that there wont be any manual intervention.
Is it possible or a recommended idea to change the ORDINAL_POSITION of the columns in information_schema.columns table to solve this problem?
update information_schema.columns set ORDINAL_POSITION=2 where table_schema=‘schema1’ and table_name=‘test_table_2’ and column_name=‘DIVISION’ and ORDINAL_POSITION=1;