Saving all output to "!!{outputDirectory}!!/newline.q.raw". Enter "record" with no arguments to stop it. >>> !run !!{qFileDirectory}!!/newline.q >>> add file ../data/scripts/newline.py; No rows affected >>> set hive.transform.escape.input=true; No rows affected >>> >>> create table tmp_tmp(key string, value string) stored as rcfile; No rows affected >>> insert overwrite table tmp_tmp SELECT TRANSFORM(key, value) USING 'python newline.py' AS key, value FROM src limit 6; 'key','value' No rows selected >>> >>> select * from tmp_tmp ORDER BY key ASC, value ASC; 'key','value' '1 2','' '1 2','' '1','' '2','' '1','' '2','' '1','' '2','' '1','' '2','' 10 rows selected >>> >>> drop table tmp_tmp; No rows affected >>> >>> add file ../data/scripts/escapednewline.py; No rows affected >>> add file ../data/scripts/escapedtab.py; No rows affected >>> add file ../data/scripts/doubleescapedtab.py; No rows affected >>> add file ../data/scripts/escapedcarriagereturn.py; No rows affected >>> >>> create table tmp_tmp(key string, value string) stored as rcfile; No rows affected >>> insert overwrite table tmp_tmp SELECT TRANSFORM(key, value) USING 'python escapednewline.py' AS key, value FROM src limit 5; 'key','value' No rows selected >>> >>> select * from tmp_tmp ORDER BY key ASC, value ASC; 'key','value' '1\n2','' '1\n2','' '1\n2','' '1\n2','' '1\n2','' 5 rows selected >>> >>> SELECT TRANSFORM(key, value) USING 'cat' AS (key, value) FROM tmp_tmp; 'key','value' '1\n2','' '1\n2','' '1\n2','' '1\n2','' '1\n2','' 5 rows selected >>> >>> insert overwrite table tmp_tmp SELECT TRANSFORM(key, value) USING 'python escapedcarriagereturn.py' AS key, value FROM src limit 5; 'key','value' No rows selected >>> >>> select * from tmp_tmp ORDER BY key ASC, value ASC; 'key','value' '1\r2','' '1\r2','' '1\r2','' '1\r2','' '1\r2','' 5 rows selected >>> >>> SELECT TRANSFORM(key, value) USING 'cat' AS (key, value) FROM tmp_tmp; 'key','value' '1\r2','' '1\r2','' '1\r2','' '1\r2','' '1\r2','' 5 rows selected >>> >>> insert overwrite table tmp_tmp SELECT TRANSFORM(key, value) USING 'python escapedtab.py' AS key, value FROM src limit 5; 'key','value' No rows selected >>> >>> select * from tmp_tmp ORDER BY key ASC, value ASC; 'key','value' '1\t2','' '1\t2','' '1\t2','' '1\t2','' '1\t2','' 5 rows selected >>> >>> SELECT TRANSFORM(key, value) USING 'cat' AS (key, value) FROM tmp_tmp; 'key','value' '1\t2','' '1\t2','' '1\t2','' '1\t2','' '1\t2','' 5 rows selected >>> >>> insert overwrite table tmp_tmp SELECT TRANSFORM(key, value) USING 'python doubleescapedtab.py' AS key, value FROM src limit 5; 'key','value' No rows selected >>> >>> select * from tmp_tmp ORDER BY key ASC, value ASC; 'key','value' '1\ 2','' '1\ 2','' '1\ 2','' '1\\t2','' '1\\t2','' 5 rows selected >>> >>> SELECT TRANSFORM(key, value) USING 'cat' AS (key, value) FROM tmp_tmp; 'key','value' '1\ 2','' '1\\t2','' '1\ 2','' '1\\t2','' '1\ 2','' 5 rows selected >>> >>> SELECT key FROM (SELECT TRANSFORM ('a\tb', 'c') USING 'cat' AS (key, value) FROM src limit 1)a ORDER BY key ASC; 'key' 'a b' 1 row selected >>> >>> SELECT value FROM (SELECT TRANSFORM ('a\tb', 'c') USING 'cat' AS (key, value) FROM src limit 1)a ORDER BY value ASC; 'value' 'c' 1 row selected >>> !record