PREHOOK: query: -- test comment indent processing for multi-line comments CREATE TABLE test_table( col1 INT COMMENT 'col1 one line comment', col2 STRING COMMENT 'col2 two lines comment', col3 STRING COMMENT 'col3 three lines comment', col4 STRING COMMENT 'col4 very long comment that is greater than 80 chars and is likely to spill into multiple lines', col5 STRING COMMENT 'col5 very long multi-line comment where each line is very long by itself and is likely to spill into multiple lines. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin in dolor nisl, sodales adipiscing tortor. Integer venenatis', col6 STRING COMMENT 'This comment has a very long single word ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvzxyz123 which will not fit in a line by itself for small column widths.', col7_NoComment STRING) COMMENT 'table comment two lines' PREHOOK: type: CREATETABLE PREHOOK: Output: database:default PREHOOK: Output: default@test_table POSTHOOK: query: -- test comment indent processing for multi-line comments CREATE TABLE test_table( col1 INT COMMENT 'col1 one line comment', col2 STRING COMMENT 'col2 two lines comment', col3 STRING COMMENT 'col3 three lines comment', col4 STRING COMMENT 'col4 very long comment that is greater than 80 chars and is likely to spill into multiple lines', col5 STRING COMMENT 'col5 very long multi-line comment where each line is very long by itself and is likely to spill into multiple lines. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin in dolor nisl, sodales adipiscing tortor. Integer venenatis', col6 STRING COMMENT 'This comment has a very long single word ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvzxyz123 which will not fit in a line by itself for small column widths.', col7_NoComment STRING) COMMENT 'table comment two lines' POSTHOOK: type: CREATETABLE POSTHOOK: Output: database:default POSTHOOK: Output: default@test_table PREHOOK: query: -- There will be an extra tab at the end of each comment line in the output. -- This is because DESCRIBE command separates the column, type and -- comment field using a \t. DESCRIBE PRETTY uses spaces instead -- of \t to separate columns. Hive gets confused when it parses the string -- table description constructed in MetaDataPrettyFormatUtils, and adds a tab -- at the end of each line. -- There are three ways to address this: -- 1. Pad each row to the full terminal width with extra spaces. -- 2. Assume a maximum tab width of 8, and subtract 2 * 8 spaces from the -- available line width. This approach wastes upto 2 * 8 - 2 columns. -- 3. Since the pretty output is meant only for human consumption, do nothing. -- Just add a comment to the unit test file explaining what is happening. -- This is the approach chosen. DESCRIBE PRETTY test_table PREHOOK: type: DESCTABLE PREHOOK: Input: default@test_table POSTHOOK: query: -- There will be an extra tab at the end of each comment line in the output. -- This is because DESCRIBE command separates the column, type and -- comment field using a \t. DESCRIBE PRETTY uses spaces instead -- of \t to separate columns. Hive gets confused when it parses the string -- table description constructed in MetaDataPrettyFormatUtils, and adds a tab -- at the end of each line. -- There are three ways to address this: -- 1. Pad each row to the full terminal width with extra spaces. -- 2. Assume a maximum tab width of 8, and subtract 2 * 8 spaces from the -- available line width. This approach wastes upto 2 * 8 - 2 columns. -- 3. Since the pretty output is meant only for human consumption, do nothing. -- Just add a comment to the unit test file explaining what is happening. -- This is the approach chosen. DESCRIBE PRETTY test_table POSTHOOK: type: DESCTABLE POSTHOOK: Input: default@test_table col_name data_type comment col1 int col1 one line comment col2 string col2 two lines comment col3 string col3 three lines comment col4 string col4 very long comment that is greater than 80 chars and is likely to spill into multiple lines col5 string col5 very long multi-line comment where each line is very long by itself and is likely to spill into multiple lines. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin in dolor nisl, sodales adipiscing tortor. Integer venenatis col6 string This comment has a very long single word ABCDEF GHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvzxyz12 3 which will not fit in a line by itself for small column widths. col7_nocomment string PREHOOK: query: DESCRIBE PRETTY test_table PREHOOK: type: DESCTABLE PREHOOK: Input: default@test_table POSTHOOK: query: DESCRIBE PRETTY test_table POSTHOOK: type: DESCTABLE POSTHOOK: Input: default@test_table col_name data_type comment col1 int col1 one line comment col2 string col2 two lines comment col3 string col3 three lines comment col4 string col4 very long comment that is greater than 80 chars and is likely to spill into multiple lines col5 string col5 very long multi-line comment where each line is very long by itself and is likely to spill into multiple lines. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin in dolor nisl, sodales adipiscing tortor. Integer venenatis col6 string This comment has a very long single word ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvzxyz123 which will not fit in a line by itself for small column widths. col7_nocomment string PREHOOK: query: DESCRIBE PRETTY test_table PREHOOK: type: DESCTABLE PREHOOK: Input: default@test_table POSTHOOK: query: DESCRIBE PRETTY test_table POSTHOOK: type: DESCTABLE POSTHOOK: Input: default@test_table col_name data_type comment col1 int col1 one line comment col2 string col2 two lines comment col3 string col3 three lines comment col4 string col4 very long comment that is greater than 80 chars and is likely to spill into multiple lines col5 string col5 very long multi-line comment where each line is very long by itself and is likely to spill into multiple lines. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin in dolor nisl, sodales adipiscing tortor. Integer venenatis col6 string This comment has a very long single word ABCDE FGHIJKLMNOPQRSTUV XYZabcdefghijklmn opqrstuvzxyz123 which will not fit in a line by itself for small column widths. col7_nocomment string PREHOOK: query: DESCRIBE PRETTY test_table PREHOOK: type: DESCTABLE PREHOOK: Input: default@test_table POSTHOOK: query: DESCRIBE PRETTY test_table POSTHOOK: type: DESCTABLE POSTHOOK: Input: default@test_table col_name data_type comment col1 int col1 one line comment col2 string col2 two lines comment col3 string col3 three lines comment col4 string col4 very long comment that is greater than 80 chars and is likely to spill into multiple lines col5 string col5 very long multi-line comment where each line is very long by itself and is likely to spill into multiple lines. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin in dolor nisl, sodales adipiscing tortor. Integer venenatis col6 string This comment has a very long single word ABCDEFGHIJ KLMNOPQRSTUVXYZabcdefghijkl mnopqrstuvzxyz123 which will not fit in a line by itself for small column widths. col7_nocomment string PREHOOK: query: CREATE TABLE test_table_very_long_column_name( col1 INT COMMENT 'col1 one line comment', col2_abcdefghiklmnopqrstuvxyz STRING COMMENT 'col2 two lines comment', col3 STRING COMMENT 'col3 three lines comment', col4 STRING COMMENT 'col4 very long comment that is greater than 80 chars and is likely to spill into multiple lines') PREHOOK: type: CREATETABLE PREHOOK: Output: database:default PREHOOK: Output: default@test_table_very_long_column_name POSTHOOK: query: CREATE TABLE test_table_very_long_column_name( col1 INT COMMENT 'col1 one line comment', col2_abcdefghiklmnopqrstuvxyz STRING COMMENT 'col2 two lines comment', col3 STRING COMMENT 'col3 three lines comment', col4 STRING COMMENT 'col4 very long comment that is greater than 80 chars and is likely to spill into multiple lines') POSTHOOK: type: CREATETABLE POSTHOOK: Output: database:default POSTHOOK: Output: default@test_table_very_long_column_name PREHOOK: query: DESCRIBE PRETTY test_table_very_long_column_name PREHOOK: type: DESCTABLE PREHOOK: Input: default@test_table_very_long_column_name POSTHOOK: query: DESCRIBE PRETTY test_table_very_long_column_name POSTHOOK: type: DESCTABLE POSTHOOK: Input: default@test_table_very_long_column_name col_name data_type comment col1 int col1 one line comment col2_abcdefghiklmnopqrstuvxyz string col2 two lines comment col3 string col3 three lines comment col4 string col4 very long comment that is greater than 80 chars and is likely to spill into multiple lines PREHOOK: query: DESCRIBE PRETTY test_table_very_long_column_name PREHOOK: type: DESCTABLE PREHOOK: Input: default@test_table_very_long_column_name POSTHOOK: query: DESCRIBE PRETTY test_table_very_long_column_name POSTHOOK: type: DESCTABLE POSTHOOK: Input: default@test_table_very_long_column_name col_name data_type comment col1 int col1 one line comment col2_abcdefghiklmnopqrstuvxyz string col2 two lines comment col3 string col3 three lines comment col4 string col4 very long comment that is greater than 80 chars and is likely to spill into multiple lines PREHOOK: query: CREATE TABLE test_table_partitioned( col1 INT COMMENT 'col1 one line comment', col2 STRING COMMENT 'col2 two lines comment', col3 STRING COMMENT 'col3 three lines comment', col4 STRING COMMENT 'col4 very long comment that is greater than 80 chars and is likely to spill into multiple lines', col5 STRING COMMENT 'col5 very long multi-line comment where each line is very long by itself and is likely to spill into multiple lines. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin in dolor nisl, sodales adipiscing tortor. Integer venenatis', col6 STRING COMMENT 'This comment has a very long single word ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvzxyz123 which will not fit in a line by itself for small column widths.', col7_NoComment STRING) COMMENT 'table comment two lines' PARTITIONED BY (ds STRING) PREHOOK: type: CREATETABLE PREHOOK: Output: database:default PREHOOK: Output: default@test_table_partitioned POSTHOOK: query: CREATE TABLE test_table_partitioned( col1 INT COMMENT 'col1 one line comment', col2 STRING COMMENT 'col2 two lines comment', col3 STRING COMMENT 'col3 three lines comment', col4 STRING COMMENT 'col4 very long comment that is greater than 80 chars and is likely to spill into multiple lines', col5 STRING COMMENT 'col5 very long multi-line comment where each line is very long by itself and is likely to spill into multiple lines. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin in dolor nisl, sodales adipiscing tortor. Integer venenatis', col6 STRING COMMENT 'This comment has a very long single word ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvzxyz123 which will not fit in a line by itself for small column widths.', col7_NoComment STRING) COMMENT 'table comment two lines' PARTITIONED BY (ds STRING) POSTHOOK: type: CREATETABLE POSTHOOK: Output: database:default POSTHOOK: Output: default@test_table_partitioned PREHOOK: query: DESCRIBE PRETTY test_table_partitioned PREHOOK: type: DESCTABLE PREHOOK: Input: default@test_table_partitioned POSTHOOK: query: DESCRIBE PRETTY test_table_partitioned POSTHOOK: type: DESCTABLE POSTHOOK: Input: default@test_table_partitioned col_name data_type comment col1 int col1 one line comment col2 string col2 two lines comment col3 string col3 three lines comment col4 string col4 very long comment that is greater than 80 chars and is likely to spill into multiple lines col5 string col5 very long multi-line comment where each line is very long by itself and is likely to spill into multiple lines. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin in dolor nisl, sodales adipiscing tortor. Integer venenatis col6 string This comment has a very long single word ABCDEFGHIJ KLMNOPQRSTUVXYZabcdefghijkl mnopqrstuvzxyz123 which will not fit in a line by itself for small column widths. col7_nocomment string ds string # Partition Information col_name data_type comment ds string