Setting textinputformat.record.delimiter
to a non-default value, is useful for loading multi-row text, as shown in the demo below.
However, I'm failing to set this parameter back to its default value without exiting the cli and reopen it.
None of the following options worked (nor some other trials)
set textinputformat.record.delimiter='\n';
set textinputformat.record.delimiter='\r';
set textinputformat.record.delimiter='\r\n';
set textinputformat.record.delimiter='
';
reset;
Any thought?
Thanks
Demo
create table mytable (mycol string);
insert into mytable select concat('Hello',unhex('A'),'world');
select concat('>>>',mycol,'<<<') as mycol from mytable;
NewLine is interpreted is record delimiter, causing the insert of 2 records
+-------------+
| mycol |
+-------------+
| >>>Hello<<< |
| >>>world<<< |
+-------------+
set textinputformat.record.delimiter='\0';
truncate table mytable;
insert into mytable select concat('Hello',unhex('A'),'world');
select concat('>>>',mycol,'<<<') as mycol from mytable;
The whole text was inserted as a single record
+----------+
| mycol |
+----------+
| >>>Hello |
| world |
| <<< |
+----------+
Trying to change the delimiter back to newline
set textinputformat.record.delimiter='\n';
truncate table mytable;
insert into mytable select concat('Hello',unhex('A'),'world');
select concat('>>>',mycol,'<<<') as mycol from mytable;
Still get the same results
+----------+
| mycol |
+----------+
| >>>Hello |
| world |
| <<< |
+----------+