Hi,
I am trying to alter the FS pipeline for memSQL 6.8.12.
The scenario is, the columns in the input file is changing as per the user input.
I want to alter the columns selection in the pipeline through a python script dynamically.
I am trying to get the syntax for the change, but not able to do successfully.
Can you please suggest on this.
Below is the scenario.
Initial Pipiline:
CREATE PIPELINE test_memsql_PIPELINE
AS LOAD DATA FS ‘/base/location/test_file_memsql.csv’
BATCH_INTERVAL 2500
ENABLE OUT_OF_ORDER OPTIMIZATION
SKIP ALL ERRORS
INTO TABLE test_memsql
FIELDS TERMINATED BY ‘,’ ENCLOSED BY ‘’ ESCAPED BY ‘\’
LINES TERMINATED BY ‘\n’ STARTING BY ‘’
IGNORE 1 LINES
(
COB_DATE,
BU_CATEGORY,
BU_AREA,
PNL
);
Pipeline structure needed after ALTER PIPELINE
CREATE PIPELINE test_memsql_PIPELINE
AS LOAD DATA FS ‘/base/location/test_file_memsql.csv’
BATCH_INTERVAL 2500
ENABLE OUT_OF_ORDER OPTIMIZATION
SKIP ALL ERRORS
INTO TABLE test_memsql
FIELDS TERMINATED BY ‘,’ ENCLOSED BY ‘’ ESCAPED BY ‘\’
LINES TERMINATED BY ‘\n’ STARTING BY ‘’
IGNORE 1 LINES
( BU_CATEGORY,
COB_DATE,
DIVISION,
PNL,
BU_AREA,
TOTAL_AMOUNT
);
I tried something like below, but looks like this is not syntactically correct.
alter pipeline test_memsql_PIPELINE columns (BU_CATEGORY,COB_DATE,DIVISION,PNL,BU_AREA,TOTAL_AMOUNT);
alter pipeline test_memsql_PIPELINE set fields (BU_CATEGORY,COB_DATE,DIVISION,PNL,BU_AREA,TOTAL_AMOUNT);
alter pipeline test_memsql_PIPELINE set columns (BU_CATEGORY,COB_DATE,DIVISION,PNL,BU_AREA,TOTAL_AMOUNT);
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘columns (BU_CATEGORY,COB_DATE,DIVISION,PNL,BU_AREA,TOTAL_AMOUNT)’ at line 1
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘fields (BU_CATEGORY,COB_DATE,DIVISION,PNL,BU_AREA,TOTAL_AMOUNT)’ at line 1
PS: Just to mention, I tried CREATE OR REPLACE PIPELINE for the pipeline modification. It looks working as expected.
- The pipeline columns changed to new columns.
- The pipeline didn’t stop and remain in running state.
- Only the new files are read.
Can RELACE PIPELINE option be safely used in this scenario?
Thanks