commit 31446d57bf0099a169da2f191ae8a069ead462cc Author: Janaki Lahorani Date: Tue Feb 13 14:06:35 2018 -0800 HIVE-18718: Return valid parquet data without errors for integer like types When data is saved as bigint in parquet table, and read as int it results in execution error. For other natively supported formats like ORC, Text etc., error is not thrown. If the data is bigger than the maximum allowed, a NULL is returned. If the data is within the allowed range, the value is returned correctly. This fix makes Parquet match other natively supported ones. Change-Id: I61d5d61a3ee78b4f019a7db4a02921891e68d17c diff --git ql/src/java/org/apache/hadoop/hive/ql/io/parquet/convert/ETypeConverter.java ql/src/java/org/apache/hadoop/hive/ql/io/parquet/convert/ETypeConverter.java index 420559ecf617c4fcd2d9d69537d3351a4b8d7812..10c7742836e5693f28fb77d66d3a8ef89f2c99d3 100644 --- ql/src/java/org/apache/hadoop/hive/ql/io/parquet/convert/ETypeConverter.java +++ ql/src/java/org/apache/hadoop/hive/ql/io/parquet/convert/ETypeConverter.java @@ -118,6 +118,28 @@ public void addInt(final int value) { parent.set(index, new DoubleWritable((float) value)); } }; + case serdeConstants.SMALLINT_TYPE_NAME: + return new PrimitiveConverter() { + @Override + public void addInt(final int value) { + if ((value >= serdeConstants.SMALLINT_MIN_VALUE) && (value <= serdeConstants.SMALLINT_MAX_VALUE)) { + parent.set(index, new IntWritable((int)value)); + } else { + parent.set(index, null); + } + } + }; + case serdeConstants.TINYINT_TYPE_NAME: + return new PrimitiveConverter() { + @Override + public void addInt(final int value) { + if ((value >= serdeConstants.TINYINT_MIN_VALUE) && (value <= serdeConstants.TINYINT_MAX_VALUE)) { + parent.set(index, new IntWritable((int)value)); + } else { + parent.set(index, null); + } + } + }; } } return new PrimitiveConverter() { @@ -147,6 +169,39 @@ public void addLong(final long value) { parent.set(index, new DoubleWritable(value)); } }; + case serdeConstants.INT_TYPE_NAME: + return new PrimitiveConverter() { + @Override + public void addLong(long value) { + if ((value >= Integer.MIN_VALUE) && (value <= Integer.MAX_VALUE)) { + parent.set(index, new IntWritable((int)value)); + } else { + parent.set(index, null); + } + } + }; + case serdeConstants.SMALLINT_TYPE_NAME: + return new PrimitiveConverter() { + @Override + public void addLong(long value) { + if ((value >= serdeConstants.SMALLINT_MIN_VALUE) && (value <= serdeConstants.SMALLINT_MAX_VALUE)) { + parent.set(index, new IntWritable((int)value)); + } else { + parent.set(index, null); + } + } + }; + case serdeConstants.TINYINT_TYPE_NAME: + return new PrimitiveConverter() { + @Override + public void addLong(long value) { + if ((value >= serdeConstants.TINYINT_MIN_VALUE) && (value <= serdeConstants.TINYINT_MAX_VALUE)) { + parent.set(index, new IntWritable((int)value)); + } else { + parent.set(index, null); + } + } + }; } } return new PrimitiveConverter() { diff --git ql/src/test/queries/clientpositive/type_change_test_int.q ql/src/test/queries/clientpositive/type_change_test_int.q new file mode 100644 index 0000000000000000000000000000000000000000..e7c5d93d56d5f4384e74f4b5d3e1dcef7e0cc1ff --- /dev/null +++ ql/src/test/queries/clientpositive/type_change_test_int.q @@ -0,0 +1,292 @@ +drop table if exists testAltCol; +create table testAltCol +(cId TINYINT, + cBigInt BIGINT, + cInt INT, + cSmallInt SMALLINT, + cTinyint TINYINT); + +insert into testAltCol values +(1, + 1234567890123456789, + 1234567890, + 12345, + 123); + +insert into testAltCol values +(2, + 1, + 2, + 3, + 4); + +insert into testAltCol values +(3, + 1234567890123456789, + 1234567890, + 12345, + 123); + +insert into testAltCol values +(4, + -1234567890123456789, + -1234567890, + -12345, + -123); + +select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltCol order by cId; +-- Create a base table to be used for loading data: End + +-- Enable change of column type +SET hive.metastore.disallow.incompatible.col.type.changes=false; + +-- Text type: Begin +drop table if exists testAltColT; + +create table testAltColT stored as textfile as select * from testAltCol; + +select cId, cInt, cSmallInt, cTinyint from testAltColT order by cId; + +-- bigint, int, smallint, and tinyint: type changed to bigint +alter table testAltColT replace columns +(cId TINYINT, + cBigInt BIGINT, + cInt BIGINT, + cSmallInt BIGINT, + cTinyint BIGINT); + +select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColT order by cId; + +-- bigint, int, smallint, and tinyint: type changed to int +alter table testAltColT replace columns +(cId TINYINT, + cBigInt INT, + cInt INT, + cSmallInt INT, + cTinyint INT); + +select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColT order by cId; + +-- bigint, int, smallint, and tinyint: type changed to smallint +alter table testAltColT replace columns +(cId TINYINT, + cBigInt SMALLINT, + cInt SMALLINT, + cSmallInt SMALLINT, + cTinyint SMALLINT); + +select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColT order by cId; + +-- bigint, int, smallint, and tinyint: type changed to tinyint +alter table testAltColT replace columns +(cId TINYINT, + cBigInt TINYINT, + cInt TINYINT, + cSmallInt TINYINT, + cTinyint TINYINT); + +select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColT order by cId; + +drop table if exists testAltColT; +-- Text type: End + +-- Sequence File type: Begin +drop table if exists testAltColSF; + +create table testAltColSF stored as sequencefile as select * from testAltCol; + +select cId, cInt, cSmallInt, cTinyint from testAltColSF order by cId; + +-- bigint, int, smallint, and tinyint: type changed to bigint +alter table testAltColSF replace columns +(cId TINYINT, + cBigInt BIGINT, + cInt BIGINT, + cSmallInt BIGINT, + cTinyint BIGINT); + +select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColSF order by cId; + +-- bigint, int, smallint, and tinyint: type changed to int +alter table testAltColSF replace columns +(cId TINYINT, + cBigInt INT, + cInt INT, + cSmallInt INT, + cTinyint INT); + +select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColSF order by cId; + +-- bigint, int, smallint, and tinyint: type changed to smallint +alter table testAltColSF replace columns +(cId TINYINT, + cBigInt SMALLINT, + cInt SMALLINT, + cSmallInt SMALLINT, + cTinyint SMALLINT); + +select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColSF order by cId; + +-- bigint, int, smallint, and tinyint: type changed to tinyint +alter table testAltColSF replace columns +(cId TINYINT, + cBigInt TINYINT, + cInt TINYINT, + cSmallInt TINYINT, + cTinyint TINYINT); + +select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColSF order by cId; + +drop table if exists testAltColSF; +-- Sequence File type: End + +-- RCFile type: Begin +drop table if exists testAltColRCF; + +create table testAltColRCF stored as rcfile as select * from testAltCol; + +select cId, cInt, cSmallInt, cTinyint from testAltColRCF order by cId; + +-- bigint, int, smallint, and tinyint: type changed to bigint +alter table testAltColRCF replace columns +(cId TINYINT, + cBigInt BIGINT, + cInt BIGINT, + cSmallInt BIGINT, + cTinyint BIGINT); + +select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColRCF order by cId; + +-- bigint, int, smallint, and tinyint: type changed to int +alter table testAltColRCF replace columns +(cId TINYINT, + cBigInt INT, + cInt INT, + cSmallInt INT, + cTinyint INT); + +select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColRCF order by cId; + +-- bigint, int, smallint, and tinyint: type changed to smallint +alter table testAltColRCF replace columns +(cId TINYINT, + cBigInt SMALLINT, + cInt SMALLINT, + cSmallInt SMALLINT, + cTinyint SMALLINT); + +select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColRCF order by cId; + +-- bigint, int, smallint, and tinyint: type changed to tinyint +alter table testAltColRCF replace columns +(cId TINYINT, + cBigInt TINYINT, + cInt TINYINT, + cSmallInt TINYINT, + cTinyint TINYINT); + +select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColRCF order by cId; + +drop table if exists testAltColRCF; +-- RCFile type: End + +-- ORC type: Begin +drop table if exists testAltColORC; + +create table testAltColORC stored as orc as select * from testAltCol; + +select cId, cInt, cSmallInt, cTinyint from testAltColORC order by cId; + +-- bigint, int, smallint, and tinyint: type changed to bigint +alter table testAltColORC replace columns +(cId TINYINT, + cBigInt BIGINT, + cInt BIGINT, + cSmallInt BIGINT, + cTinyint BIGINT); + +select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColORC order by cId; + +-- bigint, int, smallint, and tinyint: type changed to int +alter table testAltColORC replace columns +(cId TINYINT, + cBigInt INT, + cInt INT, + cSmallInt INT, + cTinyint INT); + +select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColORC order by cId; + +-- bigint, int, smallint, and tinyint: type changed to smallint +alter table testAltColORC replace columns +(cId TINYINT, + cBigInt SMALLINT, + cInt SMALLINT, + cSmallInt SMALLINT, + cTinyint SMALLINT); + +select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColORC order by cId; + +-- bigint, int, smallint, and tinyint: type changed to tinyint +alter table testAltColORC replace columns +(cId TINYINT, + cBigInt TINYINT, + cInt TINYINT, + cSmallInt TINYINT, + cTinyint TINYINT); + +select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColORC order by cId; + +drop table if exists testAltColORC; +-- ORC type: End + +-- Parquet type: Begin +drop table if exists testAltColP; + +create table testAltColP stored as parquet as select * from testAltCol; + +select cId, cInt, cSmallInt, cTinyint from testAltColP order by cId; + +-- bigint, int, smallint, and tinyint: type changed to bigint +alter table testAltColP replace columns +(cId TINYINT, + cBigInt BIGINT, + cInt BIGINT, + cSmallInt BIGINT, + cTinyint BIGINT); + +select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColP order by cId; + +-- bigint, int, smallint, and tinyint: type changed to int +alter table testAltColP replace columns +(cId TINYINT, + cBigInt INT, + cInt INT, + cSmallInt INT, + cTinyint INT); + +select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColP order by cId; + +-- bigint, int, smallint, and tinyint: type changed to smallint +alter table testAltColP replace columns +(cId TINYINT, + cBigInt SMALLINT, + cInt SMALLINT, + cSmallInt SMALLINT, + cTinyint SMALLINT); + +select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColP order by cId; + +-- bigint, int, smallint, and tinyint: type changed to tinyint +alter table testAltColP replace columns +(cId TINYINT, + cBigInt TINYINT, + cInt TINYINT, + cSmallInt TINYINT, + cTinyint TINYINT); + +select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColP order by cId; + +drop table if exists testAltColP; +-- Parquet type: End + diff --git ql/src/test/results/clientpositive/type_change_test_int.q.out ql/src/test/results/clientpositive/type_change_test_int.q.out new file mode 100644 index 0000000000000000000000000000000000000000..77b34f4cc34129d4eadb7fc1f216ec7cc7359586 --- /dev/null +++ ql/src/test/results/clientpositive/type_change_test_int.q.out @@ -0,0 +1,921 @@ +PREHOOK: query: drop table if exists testAltCol +PREHOOK: type: DROPTABLE +POSTHOOK: query: drop table if exists testAltCol +POSTHOOK: type: DROPTABLE +PREHOOK: query: create table testAltCol +(cId TINYINT, + cBigInt BIGINT, + cInt INT, + cSmallInt SMALLINT, + cTinyint TINYINT) +PREHOOK: type: CREATETABLE +PREHOOK: Output: database:default +PREHOOK: Output: default@testAltCol +POSTHOOK: query: create table testAltCol +(cId TINYINT, + cBigInt BIGINT, + cInt INT, + cSmallInt SMALLINT, + cTinyint TINYINT) +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: database:default +POSTHOOK: Output: default@testAltCol +PREHOOK: query: insert into testAltCol values +(1, + 1234567890123456789, + 1234567890, + 12345, + 123) +PREHOOK: type: QUERY +PREHOOK: Input: _dummy_database@_dummy_table +PREHOOK: Output: default@testaltcol +POSTHOOK: query: insert into testAltCol values +(1, + 1234567890123456789, + 1234567890, + 12345, + 123) +POSTHOOK: type: QUERY +POSTHOOK: Input: _dummy_database@_dummy_table +POSTHOOK: Output: default@testaltcol +POSTHOOK: Lineage: testaltcol.cbigint SCRIPT [] +POSTHOOK: Lineage: testaltcol.cid SCRIPT [] +POSTHOOK: Lineage: testaltcol.cint SCRIPT [] +POSTHOOK: Lineage: testaltcol.csmallint SCRIPT [] +POSTHOOK: Lineage: testaltcol.ctinyint SCRIPT [] +PREHOOK: query: insert into testAltCol values +(2, + 1, + 2, + 3, + 4) +PREHOOK: type: QUERY +PREHOOK: Input: _dummy_database@_dummy_table +PREHOOK: Output: default@testaltcol +POSTHOOK: query: insert into testAltCol values +(2, + 1, + 2, + 3, + 4) +POSTHOOK: type: QUERY +POSTHOOK: Input: _dummy_database@_dummy_table +POSTHOOK: Output: default@testaltcol +POSTHOOK: Lineage: testaltcol.cbigint SCRIPT [] +POSTHOOK: Lineage: testaltcol.cid SCRIPT [] +POSTHOOK: Lineage: testaltcol.cint SCRIPT [] +POSTHOOK: Lineage: testaltcol.csmallint SCRIPT [] +POSTHOOK: Lineage: testaltcol.ctinyint SCRIPT [] +PREHOOK: query: insert into testAltCol values +(3, + 1234567890123456789, + 1234567890, + 12345, + 123) +PREHOOK: type: QUERY +PREHOOK: Input: _dummy_database@_dummy_table +PREHOOK: Output: default@testaltcol +POSTHOOK: query: insert into testAltCol values +(3, + 1234567890123456789, + 1234567890, + 12345, + 123) +POSTHOOK: type: QUERY +POSTHOOK: Input: _dummy_database@_dummy_table +POSTHOOK: Output: default@testaltcol +POSTHOOK: Lineage: testaltcol.cbigint SCRIPT [] +POSTHOOK: Lineage: testaltcol.cid SCRIPT [] +POSTHOOK: Lineage: testaltcol.cint SCRIPT [] +POSTHOOK: Lineage: testaltcol.csmallint SCRIPT [] +POSTHOOK: Lineage: testaltcol.ctinyint SCRIPT [] +PREHOOK: query: insert into testAltCol values +(4, + -1234567890123456789, + -1234567890, + -12345, + -123) +PREHOOK: type: QUERY +PREHOOK: Input: _dummy_database@_dummy_table +PREHOOK: Output: default@testaltcol +POSTHOOK: query: insert into testAltCol values +(4, + -1234567890123456789, + -1234567890, + -12345, + -123) +POSTHOOK: type: QUERY +POSTHOOK: Input: _dummy_database@_dummy_table +POSTHOOK: Output: default@testaltcol +POSTHOOK: Lineage: testaltcol.cbigint SCRIPT [] +POSTHOOK: Lineage: testaltcol.cid SCRIPT [] +POSTHOOK: Lineage: testaltcol.cint SCRIPT [] +POSTHOOK: Lineage: testaltcol.csmallint SCRIPT [] +POSTHOOK: Lineage: testaltcol.ctinyint SCRIPT [] +PREHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltCol order by cId +PREHOOK: type: QUERY +PREHOOK: Input: default@testaltcol +#### A masked pattern was here #### +POSTHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltCol order by cId +POSTHOOK: type: QUERY +POSTHOOK: Input: default@testaltcol +#### A masked pattern was here #### +1 1234567890123456789 1234567890 12345 123 +2 1 2 3 4 +3 1234567890123456789 1234567890 12345 123 +4 -1234567890123456789 -1234567890 -12345 -123 +PREHOOK: query: drop table if exists testAltColT +PREHOOK: type: DROPTABLE +POSTHOOK: query: drop table if exists testAltColT +POSTHOOK: type: DROPTABLE +PREHOOK: query: create table testAltColT stored as textfile as select * from testAltCol +PREHOOK: type: CREATETABLE_AS_SELECT +PREHOOK: Input: default@testaltcol +PREHOOK: Output: database:default +PREHOOK: Output: default@testAltColT +POSTHOOK: query: create table testAltColT stored as textfile as select * from testAltCol +POSTHOOK: type: CREATETABLE_AS_SELECT +POSTHOOK: Input: default@testaltcol +POSTHOOK: Output: database:default +POSTHOOK: Output: default@testAltColT +POSTHOOK: Lineage: testaltcolt.cbigint SIMPLE [(testaltcol)testaltcol.FieldSchema(name:cbigint, type:bigint, comment:null), ] +POSTHOOK: Lineage: testaltcolt.cid SIMPLE [(testaltcol)testaltcol.FieldSchema(name:cid, type:tinyint, comment:null), ] +POSTHOOK: Lineage: testaltcolt.cint SIMPLE [(testaltcol)testaltcol.FieldSchema(name:cint, type:int, comment:null), ] +POSTHOOK: Lineage: testaltcolt.csmallint SIMPLE [(testaltcol)testaltcol.FieldSchema(name:csmallint, type:smallint, comment:null), ] +POSTHOOK: Lineage: testaltcolt.ctinyint SIMPLE [(testaltcol)testaltcol.FieldSchema(name:ctinyint, type:tinyint, comment:null), ] +PREHOOK: query: select cId, cInt, cSmallInt, cTinyint from testAltColT order by cId +PREHOOK: type: QUERY +PREHOOK: Input: default@testaltcolt +#### A masked pattern was here #### +POSTHOOK: query: select cId, cInt, cSmallInt, cTinyint from testAltColT order by cId +POSTHOOK: type: QUERY +POSTHOOK: Input: default@testaltcolt +#### A masked pattern was here #### +1 1234567890 12345 123 +2 2 3 4 +3 1234567890 12345 123 +4 -1234567890 -12345 -123 +PREHOOK: query: alter table testAltColT replace columns +(cId TINYINT, + cBigInt BIGINT, + cInt BIGINT, + cSmallInt BIGINT, + cTinyint BIGINT) +PREHOOK: type: ALTERTABLE_REPLACECOLS +PREHOOK: Input: default@testaltcolt +PREHOOK: Output: default@testaltcolt +POSTHOOK: query: alter table testAltColT replace columns +(cId TINYINT, + cBigInt BIGINT, + cInt BIGINT, + cSmallInt BIGINT, + cTinyint BIGINT) +POSTHOOK: type: ALTERTABLE_REPLACECOLS +POSTHOOK: Input: default@testaltcolt +POSTHOOK: Output: default@testaltcolt +PREHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColT order by cId +PREHOOK: type: QUERY +PREHOOK: Input: default@testaltcolt +#### A masked pattern was here #### +POSTHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColT order by cId +POSTHOOK: type: QUERY +POSTHOOK: Input: default@testaltcolt +#### A masked pattern was here #### +1 1234567890123456789 1234567890 12345 123 +2 1 2 3 4 +3 1234567890123456789 1234567890 12345 123 +4 -1234567890123456789 -1234567890 -12345 -123 +PREHOOK: query: alter table testAltColT replace columns +(cId TINYINT, + cBigInt INT, + cInt INT, + cSmallInt INT, + cTinyint INT) +PREHOOK: type: ALTERTABLE_REPLACECOLS +PREHOOK: Input: default@testaltcolt +PREHOOK: Output: default@testaltcolt +POSTHOOK: query: alter table testAltColT replace columns +(cId TINYINT, + cBigInt INT, + cInt INT, + cSmallInt INT, + cTinyint INT) +POSTHOOK: type: ALTERTABLE_REPLACECOLS +POSTHOOK: Input: default@testaltcolt +POSTHOOK: Output: default@testaltcolt +PREHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColT order by cId +PREHOOK: type: QUERY +PREHOOK: Input: default@testaltcolt +#### A masked pattern was here #### +POSTHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColT order by cId +POSTHOOK: type: QUERY +POSTHOOK: Input: default@testaltcolt +#### A masked pattern was here #### +1 NULL 1234567890 12345 123 +2 1 2 3 4 +3 NULL 1234567890 12345 123 +4 NULL -1234567890 -12345 -123 +PREHOOK: query: alter table testAltColT replace columns +(cId TINYINT, + cBigInt SMALLINT, + cInt SMALLINT, + cSmallInt SMALLINT, + cTinyint SMALLINT) +PREHOOK: type: ALTERTABLE_REPLACECOLS +PREHOOK: Input: default@testaltcolt +PREHOOK: Output: default@testaltcolt +POSTHOOK: query: alter table testAltColT replace columns +(cId TINYINT, + cBigInt SMALLINT, + cInt SMALLINT, + cSmallInt SMALLINT, + cTinyint SMALLINT) +POSTHOOK: type: ALTERTABLE_REPLACECOLS +POSTHOOK: Input: default@testaltcolt +POSTHOOK: Output: default@testaltcolt +PREHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColT order by cId +PREHOOK: type: QUERY +PREHOOK: Input: default@testaltcolt +#### A masked pattern was here #### +POSTHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColT order by cId +POSTHOOK: type: QUERY +POSTHOOK: Input: default@testaltcolt +#### A masked pattern was here #### +1 NULL NULL 12345 123 +2 1 2 3 4 +3 NULL NULL 12345 123 +4 NULL NULL -12345 -123 +PREHOOK: query: alter table testAltColT replace columns +(cId TINYINT, + cBigInt TINYINT, + cInt TINYINT, + cSmallInt TINYINT, + cTinyint TINYINT) +PREHOOK: type: ALTERTABLE_REPLACECOLS +PREHOOK: Input: default@testaltcolt +PREHOOK: Output: default@testaltcolt +POSTHOOK: query: alter table testAltColT replace columns +(cId TINYINT, + cBigInt TINYINT, + cInt TINYINT, + cSmallInt TINYINT, + cTinyint TINYINT) +POSTHOOK: type: ALTERTABLE_REPLACECOLS +POSTHOOK: Input: default@testaltcolt +POSTHOOK: Output: default@testaltcolt +PREHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColT order by cId +PREHOOK: type: QUERY +PREHOOK: Input: default@testaltcolt +#### A masked pattern was here #### +POSTHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColT order by cId +POSTHOOK: type: QUERY +POSTHOOK: Input: default@testaltcolt +#### A masked pattern was here #### +1 NULL NULL NULL 123 +2 1 2 3 4 +3 NULL NULL NULL 123 +4 NULL NULL NULL -123 +PREHOOK: query: drop table if exists testAltColT +PREHOOK: type: DROPTABLE +PREHOOK: Input: default@testaltcolt +PREHOOK: Output: default@testaltcolt +POSTHOOK: query: drop table if exists testAltColT +POSTHOOK: type: DROPTABLE +POSTHOOK: Input: default@testaltcolt +POSTHOOK: Output: default@testaltcolt +PREHOOK: query: drop table if exists testAltColSF +PREHOOK: type: DROPTABLE +POSTHOOK: query: drop table if exists testAltColSF +POSTHOOK: type: DROPTABLE +PREHOOK: query: create table testAltColSF stored as sequencefile as select * from testAltCol +PREHOOK: type: CREATETABLE_AS_SELECT +PREHOOK: Input: default@testaltcol +PREHOOK: Output: database:default +PREHOOK: Output: default@testAltColSF +POSTHOOK: query: create table testAltColSF stored as sequencefile as select * from testAltCol +POSTHOOK: type: CREATETABLE_AS_SELECT +POSTHOOK: Input: default@testaltcol +POSTHOOK: Output: database:default +POSTHOOK: Output: default@testAltColSF +POSTHOOK: Lineage: testaltcolsf.cbigint SIMPLE [(testaltcol)testaltcol.FieldSchema(name:cbigint, type:bigint, comment:null), ] +POSTHOOK: Lineage: testaltcolsf.cid SIMPLE [(testaltcol)testaltcol.FieldSchema(name:cid, type:tinyint, comment:null), ] +POSTHOOK: Lineage: testaltcolsf.cint SIMPLE [(testaltcol)testaltcol.FieldSchema(name:cint, type:int, comment:null), ] +POSTHOOK: Lineage: testaltcolsf.csmallint SIMPLE [(testaltcol)testaltcol.FieldSchema(name:csmallint, type:smallint, comment:null), ] +POSTHOOK: Lineage: testaltcolsf.ctinyint SIMPLE [(testaltcol)testaltcol.FieldSchema(name:ctinyint, type:tinyint, comment:null), ] +PREHOOK: query: select cId, cInt, cSmallInt, cTinyint from testAltColSF order by cId +PREHOOK: type: QUERY +PREHOOK: Input: default@testaltcolsf +#### A masked pattern was here #### +POSTHOOK: query: select cId, cInt, cSmallInt, cTinyint from testAltColSF order by cId +POSTHOOK: type: QUERY +POSTHOOK: Input: default@testaltcolsf +#### A masked pattern was here #### +1 1234567890 12345 123 +2 2 3 4 +3 1234567890 12345 123 +4 -1234567890 -12345 -123 +PREHOOK: query: alter table testAltColSF replace columns +(cId TINYINT, + cBigInt BIGINT, + cInt BIGINT, + cSmallInt BIGINT, + cTinyint BIGINT) +PREHOOK: type: ALTERTABLE_REPLACECOLS +PREHOOK: Input: default@testaltcolsf +PREHOOK: Output: default@testaltcolsf +POSTHOOK: query: alter table testAltColSF replace columns +(cId TINYINT, + cBigInt BIGINT, + cInt BIGINT, + cSmallInt BIGINT, + cTinyint BIGINT) +POSTHOOK: type: ALTERTABLE_REPLACECOLS +POSTHOOK: Input: default@testaltcolsf +POSTHOOK: Output: default@testaltcolsf +PREHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColSF order by cId +PREHOOK: type: QUERY +PREHOOK: Input: default@testaltcolsf +#### A masked pattern was here #### +POSTHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColSF order by cId +POSTHOOK: type: QUERY +POSTHOOK: Input: default@testaltcolsf +#### A masked pattern was here #### +1 1234567890123456789 1234567890 12345 123 +2 1 2 3 4 +3 1234567890123456789 1234567890 12345 123 +4 -1234567890123456789 -1234567890 -12345 -123 +PREHOOK: query: alter table testAltColSF replace columns +(cId TINYINT, + cBigInt INT, + cInt INT, + cSmallInt INT, + cTinyint INT) +PREHOOK: type: ALTERTABLE_REPLACECOLS +PREHOOK: Input: default@testaltcolsf +PREHOOK: Output: default@testaltcolsf +POSTHOOK: query: alter table testAltColSF replace columns +(cId TINYINT, + cBigInt INT, + cInt INT, + cSmallInt INT, + cTinyint INT) +POSTHOOK: type: ALTERTABLE_REPLACECOLS +POSTHOOK: Input: default@testaltcolsf +POSTHOOK: Output: default@testaltcolsf +PREHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColSF order by cId +PREHOOK: type: QUERY +PREHOOK: Input: default@testaltcolsf +#### A masked pattern was here #### +POSTHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColSF order by cId +POSTHOOK: type: QUERY +POSTHOOK: Input: default@testaltcolsf +#### A masked pattern was here #### +1 NULL 1234567890 12345 123 +2 1 2 3 4 +3 NULL 1234567890 12345 123 +4 NULL -1234567890 -12345 -123 +PREHOOK: query: alter table testAltColSF replace columns +(cId TINYINT, + cBigInt SMALLINT, + cInt SMALLINT, + cSmallInt SMALLINT, + cTinyint SMALLINT) +PREHOOK: type: ALTERTABLE_REPLACECOLS +PREHOOK: Input: default@testaltcolsf +PREHOOK: Output: default@testaltcolsf +POSTHOOK: query: alter table testAltColSF replace columns +(cId TINYINT, + cBigInt SMALLINT, + cInt SMALLINT, + cSmallInt SMALLINT, + cTinyint SMALLINT) +POSTHOOK: type: ALTERTABLE_REPLACECOLS +POSTHOOK: Input: default@testaltcolsf +POSTHOOK: Output: default@testaltcolsf +PREHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColSF order by cId +PREHOOK: type: QUERY +PREHOOK: Input: default@testaltcolsf +#### A masked pattern was here #### +POSTHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColSF order by cId +POSTHOOK: type: QUERY +POSTHOOK: Input: default@testaltcolsf +#### A masked pattern was here #### +1 NULL NULL 12345 123 +2 1 2 3 4 +3 NULL NULL 12345 123 +4 NULL NULL -12345 -123 +PREHOOK: query: alter table testAltColSF replace columns +(cId TINYINT, + cBigInt TINYINT, + cInt TINYINT, + cSmallInt TINYINT, + cTinyint TINYINT) +PREHOOK: type: ALTERTABLE_REPLACECOLS +PREHOOK: Input: default@testaltcolsf +PREHOOK: Output: default@testaltcolsf +POSTHOOK: query: alter table testAltColSF replace columns +(cId TINYINT, + cBigInt TINYINT, + cInt TINYINT, + cSmallInt TINYINT, + cTinyint TINYINT) +POSTHOOK: type: ALTERTABLE_REPLACECOLS +POSTHOOK: Input: default@testaltcolsf +POSTHOOK: Output: default@testaltcolsf +PREHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColSF order by cId +PREHOOK: type: QUERY +PREHOOK: Input: default@testaltcolsf +#### A masked pattern was here #### +POSTHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColSF order by cId +POSTHOOK: type: QUERY +POSTHOOK: Input: default@testaltcolsf +#### A masked pattern was here #### +1 NULL NULL NULL 123 +2 1 2 3 4 +3 NULL NULL NULL 123 +4 NULL NULL NULL -123 +PREHOOK: query: drop table if exists testAltColSF +PREHOOK: type: DROPTABLE +PREHOOK: Input: default@testaltcolsf +PREHOOK: Output: default@testaltcolsf +POSTHOOK: query: drop table if exists testAltColSF +POSTHOOK: type: DROPTABLE +POSTHOOK: Input: default@testaltcolsf +POSTHOOK: Output: default@testaltcolsf +PREHOOK: query: drop table if exists testAltColRCF +PREHOOK: type: DROPTABLE +POSTHOOK: query: drop table if exists testAltColRCF +POSTHOOK: type: DROPTABLE +PREHOOK: query: create table testAltColRCF stored as rcfile as select * from testAltCol +PREHOOK: type: CREATETABLE_AS_SELECT +PREHOOK: Input: default@testaltcol +PREHOOK: Output: database:default +PREHOOK: Output: default@testAltColRCF +POSTHOOK: query: create table testAltColRCF stored as rcfile as select * from testAltCol +POSTHOOK: type: CREATETABLE_AS_SELECT +POSTHOOK: Input: default@testaltcol +POSTHOOK: Output: database:default +POSTHOOK: Output: default@testAltColRCF +POSTHOOK: Lineage: testaltcolrcf.cbigint SIMPLE [(testaltcol)testaltcol.FieldSchema(name:cbigint, type:bigint, comment:null), ] +POSTHOOK: Lineage: testaltcolrcf.cid SIMPLE [(testaltcol)testaltcol.FieldSchema(name:cid, type:tinyint, comment:null), ] +POSTHOOK: Lineage: testaltcolrcf.cint SIMPLE [(testaltcol)testaltcol.FieldSchema(name:cint, type:int, comment:null), ] +POSTHOOK: Lineage: testaltcolrcf.csmallint SIMPLE [(testaltcol)testaltcol.FieldSchema(name:csmallint, type:smallint, comment:null), ] +POSTHOOK: Lineage: testaltcolrcf.ctinyint SIMPLE [(testaltcol)testaltcol.FieldSchema(name:ctinyint, type:tinyint, comment:null), ] +PREHOOK: query: select cId, cInt, cSmallInt, cTinyint from testAltColRCF order by cId +PREHOOK: type: QUERY +PREHOOK: Input: default@testaltcolrcf +#### A masked pattern was here #### +POSTHOOK: query: select cId, cInt, cSmallInt, cTinyint from testAltColRCF order by cId +POSTHOOK: type: QUERY +POSTHOOK: Input: default@testaltcolrcf +#### A masked pattern was here #### +1 1234567890 12345 123 +2 2 3 4 +3 1234567890 12345 123 +4 -1234567890 -12345 -123 +PREHOOK: query: alter table testAltColRCF replace columns +(cId TINYINT, + cBigInt BIGINT, + cInt BIGINT, + cSmallInt BIGINT, + cTinyint BIGINT) +PREHOOK: type: ALTERTABLE_REPLACECOLS +PREHOOK: Input: default@testaltcolrcf +PREHOOK: Output: default@testaltcolrcf +POSTHOOK: query: alter table testAltColRCF replace columns +(cId TINYINT, + cBigInt BIGINT, + cInt BIGINT, + cSmallInt BIGINT, + cTinyint BIGINT) +POSTHOOK: type: ALTERTABLE_REPLACECOLS +POSTHOOK: Input: default@testaltcolrcf +POSTHOOK: Output: default@testaltcolrcf +PREHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColRCF order by cId +PREHOOK: type: QUERY +PREHOOK: Input: default@testaltcolrcf +#### A masked pattern was here #### +POSTHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColRCF order by cId +POSTHOOK: type: QUERY +POSTHOOK: Input: default@testaltcolrcf +#### A masked pattern was here #### +1 1234567890123456789 1234567890 12345 123 +2 1 2 3 4 +3 1234567890123456789 1234567890 12345 123 +4 -1234567890123456789 -1234567890 -12345 -123 +PREHOOK: query: alter table testAltColRCF replace columns +(cId TINYINT, + cBigInt INT, + cInt INT, + cSmallInt INT, + cTinyint INT) +PREHOOK: type: ALTERTABLE_REPLACECOLS +PREHOOK: Input: default@testaltcolrcf +PREHOOK: Output: default@testaltcolrcf +POSTHOOK: query: alter table testAltColRCF replace columns +(cId TINYINT, + cBigInt INT, + cInt INT, + cSmallInt INT, + cTinyint INT) +POSTHOOK: type: ALTERTABLE_REPLACECOLS +POSTHOOK: Input: default@testaltcolrcf +POSTHOOK: Output: default@testaltcolrcf +PREHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColRCF order by cId +PREHOOK: type: QUERY +PREHOOK: Input: default@testaltcolrcf +#### A masked pattern was here #### +POSTHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColRCF order by cId +POSTHOOK: type: QUERY +POSTHOOK: Input: default@testaltcolrcf +#### A masked pattern was here #### +1 NULL 1234567890 12345 123 +2 1 2 3 4 +3 NULL 1234567890 12345 123 +4 NULL -1234567890 -12345 -123 +PREHOOK: query: alter table testAltColRCF replace columns +(cId TINYINT, + cBigInt SMALLINT, + cInt SMALLINT, + cSmallInt SMALLINT, + cTinyint SMALLINT) +PREHOOK: type: ALTERTABLE_REPLACECOLS +PREHOOK: Input: default@testaltcolrcf +PREHOOK: Output: default@testaltcolrcf +POSTHOOK: query: alter table testAltColRCF replace columns +(cId TINYINT, + cBigInt SMALLINT, + cInt SMALLINT, + cSmallInt SMALLINT, + cTinyint SMALLINT) +POSTHOOK: type: ALTERTABLE_REPLACECOLS +POSTHOOK: Input: default@testaltcolrcf +POSTHOOK: Output: default@testaltcolrcf +PREHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColRCF order by cId +PREHOOK: type: QUERY +PREHOOK: Input: default@testaltcolrcf +#### A masked pattern was here #### +POSTHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColRCF order by cId +POSTHOOK: type: QUERY +POSTHOOK: Input: default@testaltcolrcf +#### A masked pattern was here #### +1 NULL NULL 12345 123 +2 1 2 3 4 +3 NULL NULL 12345 123 +4 NULL NULL -12345 -123 +PREHOOK: query: alter table testAltColRCF replace columns +(cId TINYINT, + cBigInt TINYINT, + cInt TINYINT, + cSmallInt TINYINT, + cTinyint TINYINT) +PREHOOK: type: ALTERTABLE_REPLACECOLS +PREHOOK: Input: default@testaltcolrcf +PREHOOK: Output: default@testaltcolrcf +POSTHOOK: query: alter table testAltColRCF replace columns +(cId TINYINT, + cBigInt TINYINT, + cInt TINYINT, + cSmallInt TINYINT, + cTinyint TINYINT) +POSTHOOK: type: ALTERTABLE_REPLACECOLS +POSTHOOK: Input: default@testaltcolrcf +POSTHOOK: Output: default@testaltcolrcf +PREHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColRCF order by cId +PREHOOK: type: QUERY +PREHOOK: Input: default@testaltcolrcf +#### A masked pattern was here #### +POSTHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColRCF order by cId +POSTHOOK: type: QUERY +POSTHOOK: Input: default@testaltcolrcf +#### A masked pattern was here #### +1 NULL NULL NULL 123 +2 1 2 3 4 +3 NULL NULL NULL 123 +4 NULL NULL NULL -123 +PREHOOK: query: drop table if exists testAltColRCF +PREHOOK: type: DROPTABLE +PREHOOK: Input: default@testaltcolrcf +PREHOOK: Output: default@testaltcolrcf +POSTHOOK: query: drop table if exists testAltColRCF +POSTHOOK: type: DROPTABLE +POSTHOOK: Input: default@testaltcolrcf +POSTHOOK: Output: default@testaltcolrcf +PREHOOK: query: drop table if exists testAltColORC +PREHOOK: type: DROPTABLE +POSTHOOK: query: drop table if exists testAltColORC +POSTHOOK: type: DROPTABLE +PREHOOK: query: create table testAltColORC stored as orc as select * from testAltCol +PREHOOK: type: CREATETABLE_AS_SELECT +PREHOOK: Input: default@testaltcol +PREHOOK: Output: database:default +PREHOOK: Output: default@testAltColORC +POSTHOOK: query: create table testAltColORC stored as orc as select * from testAltCol +POSTHOOK: type: CREATETABLE_AS_SELECT +POSTHOOK: Input: default@testaltcol +POSTHOOK: Output: database:default +POSTHOOK: Output: default@testAltColORC +POSTHOOK: Lineage: testaltcolorc.cbigint SIMPLE [(testaltcol)testaltcol.FieldSchema(name:cbigint, type:bigint, comment:null), ] +POSTHOOK: Lineage: testaltcolorc.cid SIMPLE [(testaltcol)testaltcol.FieldSchema(name:cid, type:tinyint, comment:null), ] +POSTHOOK: Lineage: testaltcolorc.cint SIMPLE [(testaltcol)testaltcol.FieldSchema(name:cint, type:int, comment:null), ] +POSTHOOK: Lineage: testaltcolorc.csmallint SIMPLE [(testaltcol)testaltcol.FieldSchema(name:csmallint, type:smallint, comment:null), ] +POSTHOOK: Lineage: testaltcolorc.ctinyint SIMPLE [(testaltcol)testaltcol.FieldSchema(name:ctinyint, type:tinyint, comment:null), ] +PREHOOK: query: select cId, cInt, cSmallInt, cTinyint from testAltColORC order by cId +PREHOOK: type: QUERY +PREHOOK: Input: default@testaltcolorc +#### A masked pattern was here #### +POSTHOOK: query: select cId, cInt, cSmallInt, cTinyint from testAltColORC order by cId +POSTHOOK: type: QUERY +POSTHOOK: Input: default@testaltcolorc +#### A masked pattern was here #### +1 1234567890 12345 123 +2 2 3 4 +3 1234567890 12345 123 +4 -1234567890 -12345 -123 +PREHOOK: query: alter table testAltColORC replace columns +(cId TINYINT, + cBigInt BIGINT, + cInt BIGINT, + cSmallInt BIGINT, + cTinyint BIGINT) +PREHOOK: type: ALTERTABLE_REPLACECOLS +PREHOOK: Input: default@testaltcolorc +PREHOOK: Output: default@testaltcolorc +POSTHOOK: query: alter table testAltColORC replace columns +(cId TINYINT, + cBigInt BIGINT, + cInt BIGINT, + cSmallInt BIGINT, + cTinyint BIGINT) +POSTHOOK: type: ALTERTABLE_REPLACECOLS +POSTHOOK: Input: default@testaltcolorc +POSTHOOK: Output: default@testaltcolorc +PREHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColORC order by cId +PREHOOK: type: QUERY +PREHOOK: Input: default@testaltcolorc +#### A masked pattern was here #### +POSTHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColORC order by cId +POSTHOOK: type: QUERY +POSTHOOK: Input: default@testaltcolorc +#### A masked pattern was here #### +1 1234567890123456789 1234567890 12345 123 +2 1 2 3 4 +3 1234567890123456789 1234567890 12345 123 +4 -1234567890123456789 -1234567890 -12345 -123 +PREHOOK: query: alter table testAltColORC replace columns +(cId TINYINT, + cBigInt INT, + cInt INT, + cSmallInt INT, + cTinyint INT) +PREHOOK: type: ALTERTABLE_REPLACECOLS +PREHOOK: Input: default@testaltcolorc +PREHOOK: Output: default@testaltcolorc +POSTHOOK: query: alter table testAltColORC replace columns +(cId TINYINT, + cBigInt INT, + cInt INT, + cSmallInt INT, + cTinyint INT) +POSTHOOK: type: ALTERTABLE_REPLACECOLS +POSTHOOK: Input: default@testaltcolorc +POSTHOOK: Output: default@testaltcolorc +PREHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColORC order by cId +PREHOOK: type: QUERY +PREHOOK: Input: default@testaltcolorc +#### A masked pattern was here #### +POSTHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColORC order by cId +POSTHOOK: type: QUERY +POSTHOOK: Input: default@testaltcolorc +#### A masked pattern was here #### +1 NULL 1234567890 12345 123 +2 1 2 3 4 +3 NULL 1234567890 12345 123 +4 NULL -1234567890 -12345 -123 +PREHOOK: query: alter table testAltColORC replace columns +(cId TINYINT, + cBigInt SMALLINT, + cInt SMALLINT, + cSmallInt SMALLINT, + cTinyint SMALLINT) +PREHOOK: type: ALTERTABLE_REPLACECOLS +PREHOOK: Input: default@testaltcolorc +PREHOOK: Output: default@testaltcolorc +POSTHOOK: query: alter table testAltColORC replace columns +(cId TINYINT, + cBigInt SMALLINT, + cInt SMALLINT, + cSmallInt SMALLINT, + cTinyint SMALLINT) +POSTHOOK: type: ALTERTABLE_REPLACECOLS +POSTHOOK: Input: default@testaltcolorc +POSTHOOK: Output: default@testaltcolorc +PREHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColORC order by cId +PREHOOK: type: QUERY +PREHOOK: Input: default@testaltcolorc +#### A masked pattern was here #### +POSTHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColORC order by cId +POSTHOOK: type: QUERY +POSTHOOK: Input: default@testaltcolorc +#### A masked pattern was here #### +1 NULL NULL 12345 123 +2 1 2 3 4 +3 NULL NULL 12345 123 +4 NULL NULL -12345 -123 +PREHOOK: query: alter table testAltColORC replace columns +(cId TINYINT, + cBigInt TINYINT, + cInt TINYINT, + cSmallInt TINYINT, + cTinyint TINYINT) +PREHOOK: type: ALTERTABLE_REPLACECOLS +PREHOOK: Input: default@testaltcolorc +PREHOOK: Output: default@testaltcolorc +POSTHOOK: query: alter table testAltColORC replace columns +(cId TINYINT, + cBigInt TINYINT, + cInt TINYINT, + cSmallInt TINYINT, + cTinyint TINYINT) +POSTHOOK: type: ALTERTABLE_REPLACECOLS +POSTHOOK: Input: default@testaltcolorc +POSTHOOK: Output: default@testaltcolorc +PREHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColORC order by cId +PREHOOK: type: QUERY +PREHOOK: Input: default@testaltcolorc +#### A masked pattern was here #### +POSTHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColORC order by cId +POSTHOOK: type: QUERY +POSTHOOK: Input: default@testaltcolorc +#### A masked pattern was here #### +1 NULL NULL NULL 123 +2 1 2 3 4 +3 NULL NULL NULL 123 +4 NULL NULL NULL -123 +PREHOOK: query: drop table if exists testAltColORC +PREHOOK: type: DROPTABLE +PREHOOK: Input: default@testaltcolorc +PREHOOK: Output: default@testaltcolorc +POSTHOOK: query: drop table if exists testAltColORC +POSTHOOK: type: DROPTABLE +POSTHOOK: Input: default@testaltcolorc +POSTHOOK: Output: default@testaltcolorc +PREHOOK: query: drop table if exists testAltColP +PREHOOK: type: DROPTABLE +POSTHOOK: query: drop table if exists testAltColP +POSTHOOK: type: DROPTABLE +PREHOOK: query: create table testAltColP stored as parquet as select * from testAltCol +PREHOOK: type: CREATETABLE_AS_SELECT +PREHOOK: Input: default@testaltcol +PREHOOK: Output: database:default +PREHOOK: Output: default@testAltColP +POSTHOOK: query: create table testAltColP stored as parquet as select * from testAltCol +POSTHOOK: type: CREATETABLE_AS_SELECT +POSTHOOK: Input: default@testaltcol +POSTHOOK: Output: database:default +POSTHOOK: Output: default@testAltColP +POSTHOOK: Lineage: testaltcolp.cbigint SIMPLE [(testaltcol)testaltcol.FieldSchema(name:cbigint, type:bigint, comment:null), ] +POSTHOOK: Lineage: testaltcolp.cid SIMPLE [(testaltcol)testaltcol.FieldSchema(name:cid, type:tinyint, comment:null), ] +POSTHOOK: Lineage: testaltcolp.cint SIMPLE [(testaltcol)testaltcol.FieldSchema(name:cint, type:int, comment:null), ] +POSTHOOK: Lineage: testaltcolp.csmallint SIMPLE [(testaltcol)testaltcol.FieldSchema(name:csmallint, type:smallint, comment:null), ] +POSTHOOK: Lineage: testaltcolp.ctinyint SIMPLE [(testaltcol)testaltcol.FieldSchema(name:ctinyint, type:tinyint, comment:null), ] +PREHOOK: query: select cId, cInt, cSmallInt, cTinyint from testAltColP order by cId +PREHOOK: type: QUERY +PREHOOK: Input: default@testaltcolp +#### A masked pattern was here #### +POSTHOOK: query: select cId, cInt, cSmallInt, cTinyint from testAltColP order by cId +POSTHOOK: type: QUERY +POSTHOOK: Input: default@testaltcolp +#### A masked pattern was here #### +1 1234567890 12345 123 +2 2 3 4 +3 1234567890 12345 123 +4 -1234567890 -12345 -123 +PREHOOK: query: alter table testAltColP replace columns +(cId TINYINT, + cBigInt BIGINT, + cInt BIGINT, + cSmallInt BIGINT, + cTinyint BIGINT) +PREHOOK: type: ALTERTABLE_REPLACECOLS +PREHOOK: Input: default@testaltcolp +PREHOOK: Output: default@testaltcolp +POSTHOOK: query: alter table testAltColP replace columns +(cId TINYINT, + cBigInt BIGINT, + cInt BIGINT, + cSmallInt BIGINT, + cTinyint BIGINT) +POSTHOOK: type: ALTERTABLE_REPLACECOLS +POSTHOOK: Input: default@testaltcolp +POSTHOOK: Output: default@testaltcolp +PREHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColP order by cId +PREHOOK: type: QUERY +PREHOOK: Input: default@testaltcolp +#### A masked pattern was here #### +POSTHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColP order by cId +POSTHOOK: type: QUERY +POSTHOOK: Input: default@testaltcolp +#### A masked pattern was here #### +1 1234567890123456789 1234567890 12345 123 +2 1 2 3 4 +3 1234567890123456789 1234567890 12345 123 +4 -1234567890123456789 -1234567890 -12345 -123 +PREHOOK: query: alter table testAltColP replace columns +(cId TINYINT, + cBigInt INT, + cInt INT, + cSmallInt INT, + cTinyint INT) +PREHOOK: type: ALTERTABLE_REPLACECOLS +PREHOOK: Input: default@testaltcolp +PREHOOK: Output: default@testaltcolp +POSTHOOK: query: alter table testAltColP replace columns +(cId TINYINT, + cBigInt INT, + cInt INT, + cSmallInt INT, + cTinyint INT) +POSTHOOK: type: ALTERTABLE_REPLACECOLS +POSTHOOK: Input: default@testaltcolp +POSTHOOK: Output: default@testaltcolp +PREHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColP order by cId +PREHOOK: type: QUERY +PREHOOK: Input: default@testaltcolp +#### A masked pattern was here #### +POSTHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColP order by cId +POSTHOOK: type: QUERY +POSTHOOK: Input: default@testaltcolp +#### A masked pattern was here #### +1 NULL 1234567890 12345 123 +2 1 2 3 4 +3 NULL 1234567890 12345 123 +4 NULL -1234567890 -12345 -123 +PREHOOK: query: alter table testAltColP replace columns +(cId TINYINT, + cBigInt SMALLINT, + cInt SMALLINT, + cSmallInt SMALLINT, + cTinyint SMALLINT) +PREHOOK: type: ALTERTABLE_REPLACECOLS +PREHOOK: Input: default@testaltcolp +PREHOOK: Output: default@testaltcolp +POSTHOOK: query: alter table testAltColP replace columns +(cId TINYINT, + cBigInt SMALLINT, + cInt SMALLINT, + cSmallInt SMALLINT, + cTinyint SMALLINT) +POSTHOOK: type: ALTERTABLE_REPLACECOLS +POSTHOOK: Input: default@testaltcolp +POSTHOOK: Output: default@testaltcolp +PREHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColP order by cId +PREHOOK: type: QUERY +PREHOOK: Input: default@testaltcolp +#### A masked pattern was here #### +POSTHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColP order by cId +POSTHOOK: type: QUERY +POSTHOOK: Input: default@testaltcolp +#### A masked pattern was here #### +1 NULL NULL 12345 123 +2 1 2 3 4 +3 NULL NULL 12345 123 +4 NULL NULL -12345 -123 +PREHOOK: query: alter table testAltColP replace columns +(cId TINYINT, + cBigInt TINYINT, + cInt TINYINT, + cSmallInt TINYINT, + cTinyint TINYINT) +PREHOOK: type: ALTERTABLE_REPLACECOLS +PREHOOK: Input: default@testaltcolp +PREHOOK: Output: default@testaltcolp +POSTHOOK: query: alter table testAltColP replace columns +(cId TINYINT, + cBigInt TINYINT, + cInt TINYINT, + cSmallInt TINYINT, + cTinyint TINYINT) +POSTHOOK: type: ALTERTABLE_REPLACECOLS +POSTHOOK: Input: default@testaltcolp +POSTHOOK: Output: default@testaltcolp +PREHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColP order by cId +PREHOOK: type: QUERY +PREHOOK: Input: default@testaltcolp +#### A masked pattern was here #### +POSTHOOK: query: select cId, cBigInt, cInt, cSmallInt, cTinyint from testAltColP order by cId +POSTHOOK: type: QUERY +POSTHOOK: Input: default@testaltcolp +#### A masked pattern was here #### +1 NULL NULL NULL 123 +2 1 2 3 4 +3 NULL NULL NULL 123 +4 NULL NULL NULL -123 +PREHOOK: query: drop table if exists testAltColP +PREHOOK: type: DROPTABLE +PREHOOK: Input: default@testaltcolp +PREHOOK: Output: default@testaltcolp +POSTHOOK: query: drop table if exists testAltColP +POSTHOOK: type: DROPTABLE +POSTHOOK: Input: default@testaltcolp +POSTHOOK: Output: default@testaltcolp diff --git serde/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/serde/serdeConstants.java serde/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/serde/serdeConstants.java index 62877f9f62c634705a74b4ee0da6c7e76a701171..d5b0079b68097eb69ec2bd9ffa51c815f457f400 100644 --- serde/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/serde/serdeConstants.java +++ serde/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/serde/serdeConstants.java @@ -128,6 +128,14 @@ public static final String COLUMN_NAME_DELIMITER = "column.name.delimiter"; + public static final int SMALLINT_MAX_VALUE = 32767; + + public static final int SMALLINT_MIN_VALUE = -32768; + + public static final int TINYINT_MAX_VALUE = 127; + + public static final int TINYINT_MIN_VALUE = -128; + public static final Set PrimitiveTypes = new HashSet(); static { PrimitiveTypes.add("void");