diff --git common/src/java/org/apache/hadoop/hive/common/type/Decimal128.java common/src/java/org/apache/hadoop/hive/common/type/Decimal128.java index d4cc32d..bd3e997 100644 --- common/src/java/org/apache/hadoop/hive/common/type/Decimal128.java +++ common/src/java/org/apache/hadoop/hive/common/type/Decimal128.java @@ -103,6 +103,13 @@ private short scale; /** + * This is the actual scale detected from the value passed to this Decimal128. + * The value is always equals or less than #scale. It is used to return the correct + * decimal string from {@link #getHiveDecimalString()}. + */ + private short actualScale; + + /** * -1 means negative, 0 means zero, 1 means positive. * * @serial @@ -127,6 +134,7 @@ public Decimal128() { this.unscaledValue = new UnsignedInt128(); this.scale = 0; this.signum = 0; + this.actualScale = 0; } /** @@ -139,6 +147,7 @@ public Decimal128(Decimal128 o) { this.unscaledValue = new UnsignedInt128(o.unscaledValue); this.scale = o.scale; this.signum = o.signum; + this.actualScale = o.actualScale; } /** @@ -178,6 +187,7 @@ public Decimal128(UnsignedInt128 unscaledVal, short scale, boolean negative) { checkScaleRange(scale); this.unscaledValue = new UnsignedInt128(unscaledVal); this.scale = scale; + this.actualScale = scale; if (unscaledValue.isZero()) { this.signum = 0; } else { @@ -264,6 +274,7 @@ public Decimal128 update(Decimal128 o) { this.unscaledValue.update(o.unscaledValue); this.scale = o.scale; this.signum = o.signum; + this.actualScale = o.actualScale; return this; } @@ -292,7 +303,7 @@ public Decimal128 update(long val) { /** * Update the value of this object with the given {@code long} with the given - * scal. + * scale. * * @param val * {@code long} value to be set to {@code Decimal128}. @@ -314,6 +325,8 @@ public Decimal128 update(long val, short scale) { if (scale != 0) { changeScaleDestructive(scale); } + // set actualScale to 0 because there is no fractional digits on integer values + this.actualScale = 0; return this; } @@ -341,6 +354,11 @@ public Decimal128 update(double val, short scale) { checkScaleRange(scale); this.scale = scale; + // Obtains the scale of the double value to keep a record of the original + // scale. This will be used to print the HiveDecimal string with the + // correct value scale. + this.actualScale = (short) BigDecimal.valueOf(val).scale(); + // Translate the double into sign, exponent and significand, according // to the formulae in JLS, Section 20.10.22. long valBits = Double.doubleToLongBits(val); @@ -364,6 +382,10 @@ public Decimal128 update(double val, short scale) { exponent++; } + // Calculate the real number of fractional digits from the double value + this.actualScale -= (exponent > 0) ? exponent : 0; + this.actualScale = (this.actualScale < 0) ? 0 : this.actualScale; + // so far same as java.math.BigDecimal, but the scaling below is // specific to ANSI SQL Numeric. @@ -426,6 +448,7 @@ public Decimal128 update(double val, short scale) { public Decimal128 update(IntBuffer buf, int precision) { int scaleAndSignum = buf.get(); this.scale = (short) (scaleAndSignum >> 16); + this.actualScale = this.scale; this.signum = (byte) (scaleAndSignum & 0xFF); this.unscaledValue.update(buf, precision); assert ((signum == 0) == unscaledValue.isZero()); @@ -442,6 +465,7 @@ public Decimal128 update(IntBuffer buf, int precision) { public Decimal128 update128(IntBuffer buf) { int scaleAndSignum = buf.get(); this.scale = (short) (scaleAndSignum >> 16); + this.actualScale = this.scale; this.signum = (byte) (scaleAndSignum & 0xFF); this.unscaledValue.update128(buf); assert ((signum == 0) == unscaledValue.isZero()); @@ -458,6 +482,7 @@ public Decimal128 update128(IntBuffer buf) { public Decimal128 update96(IntBuffer buf) { int scaleAndSignum = buf.get(); this.scale = (short) (scaleAndSignum >> 16); + this.actualScale = this.scale; this.signum = (byte) (scaleAndSignum & 0xFF); this.unscaledValue.update96(buf); assert ((signum == 0) == unscaledValue.isZero()); @@ -474,6 +499,7 @@ public Decimal128 update96(IntBuffer buf) { public Decimal128 update64(IntBuffer buf) { int scaleAndSignum = buf.get(); this.scale = (short) (scaleAndSignum >> 16); + this.actualScale = this.scale; this.signum = (byte) (scaleAndSignum & 0xFF); this.unscaledValue.update64(buf); assert ((signum == 0) == unscaledValue.isZero()); @@ -490,6 +516,7 @@ public Decimal128 update64(IntBuffer buf) { public Decimal128 update32(IntBuffer buf) { int scaleAndSignum = buf.get(); this.scale = (short) (scaleAndSignum >> 16); + this.actualScale = this.scale; this.signum = (byte) (scaleAndSignum & 0xFF); this.unscaledValue.update32(buf); assert ((signum == 0) == unscaledValue.isZero()); @@ -510,6 +537,7 @@ public Decimal128 update32(IntBuffer buf) { public Decimal128 update(int[] array, int offset, int precision) { int scaleAndSignum = array[offset]; this.scale = (short) (scaleAndSignum >> 16); + this.actualScale = this.scale; this.signum = (byte) (scaleAndSignum & 0xFF); this.unscaledValue.update(array, offset + 1, precision); return this; @@ -527,6 +555,7 @@ public Decimal128 update(int[] array, int offset, int precision) { public Decimal128 update128(int[] array, int offset) { int scaleAndSignum = array[offset]; this.scale = (short) (scaleAndSignum >> 16); + this.actualScale = this.scale; this.signum = (byte) (scaleAndSignum & 0xFF); this.unscaledValue.update128(array, offset + 1); return this; @@ -544,6 +573,7 @@ public Decimal128 update128(int[] array, int offset) { public Decimal128 update96(int[] array, int offset) { int scaleAndSignum = array[offset]; this.scale = (short) (scaleAndSignum >> 16); + this.actualScale = this.scale; this.signum = (byte) (scaleAndSignum & 0xFF); this.unscaledValue.update96(array, offset + 1); return this; @@ -561,6 +591,7 @@ public Decimal128 update96(int[] array, int offset) { public Decimal128 update64(int[] array, int offset) { int scaleAndSignum = array[offset]; this.scale = (short) (scaleAndSignum >> 16); + this.actualScale = this.scale; this.signum = (byte) (scaleAndSignum & 0xFF); this.unscaledValue.update64(array, offset + 1); return this; @@ -578,6 +609,7 @@ public Decimal128 update64(int[] array, int offset) { public Decimal128 update32(int[] array, int offset) { int scaleAndSignum = array[offset]; this.scale = (short) (scaleAndSignum >> 16); + this.actualScale = this.scale; this.signum = (byte) (scaleAndSignum & 0xFF); this.unscaledValue.update32(array, offset + 1); return this; @@ -600,7 +632,6 @@ public Decimal128 update(BigDecimal bigDecimal) { * @param scale */ public Decimal128 update(BigInteger bigInt, short scale) { - this.scale = scale; this.signum = (byte) bigInt.compareTo(BigInteger.ZERO); if (signum == 0) { update(0); @@ -609,6 +640,9 @@ public Decimal128 update(BigInteger bigInt, short scale) { } else { unscaledValue.update(bigInt); } + this.scale = scale; + this.actualScale = scale; + return this; } @@ -731,6 +765,9 @@ public Decimal128 update(char[] str, int offset, int length, short scale) { this.unscaledValue.addDestructive(accumulated); } + this.actualScale = (short) (fractionalDigits - exponent); + this.actualScale = (this.actualScale < 0) ? 0 : this.actualScale; + int scaleAdjust = scale - fractionalDigits + exponent; if (scaleAdjust > 0) { this.unscaledValue.scaleUpTenDestructive((short) scaleAdjust); @@ -924,6 +961,7 @@ public void changeScaleDestructive(short scale) { this.unscaledValue.scaleUpTenDestructive((short) -scaleDown); } this.scale = scale; + this.actualScale = scale; this.unscaledValue.throwIfExceedsTenToThirtyEight(); } @@ -1125,6 +1163,7 @@ public void multiplyDestructiveNativeDecimal128(Decimal128 right, short newScale if (this.signum == 0 || right.signum == 0) { this.zeroClear(); this.scale = newScale; + this.actualScale = newScale; return; } @@ -1154,6 +1193,7 @@ public void multiplyDestructiveNativeDecimal128(Decimal128 right, short newScale } this.scale = newScale; + this.actualScale = newScale; this.signum = (byte) (this.signum * right.signum); if (this.unscaledValue.isZero()) { this.signum = 0; // because of scaling down, this could happen @@ -1244,6 +1284,7 @@ public void divideDestructiveNativeDecimal128(Decimal128 right, short newScale, } if (this.signum == 0) { this.scale = newScale; + this.actualScale = newScale; remainder.update(this); return; } @@ -1271,6 +1312,7 @@ public void divideDestructiveNativeDecimal128(Decimal128 right, short newScale, } this.scale = newScale; + this.actualScale = newScale; this.signum = (byte) (this.unscaledValue.isZero() ? 0 : (this.signum * right.signum)); remainder.scale = scale; @@ -1731,17 +1773,13 @@ private static void checkScaleRange(short scale) { private int [] tmpArray = new int[2]; /** - * Returns the string representation of this value. It discards the trailing zeros - * in the fractional part to match the HiveDecimal's string representation. However, + * Returns the string representation of this value. It returns the original + * {@code actualScale} fractional part when this value was created. However, * don't use this string representation for the reconstruction of the object. * * @return string representation of this value */ public String getHiveDecimalString() { - if (this.signum == 0) { - return "0"; - } - StringBuilder buf = new StringBuilder(50); if (this.signum < 0) { buf.append('-'); @@ -1752,32 +1790,40 @@ public String getHiveDecimalString() { int trailingZeros = tmpArray[1]; int numIntegerDigits = unscaledLength - this.scale; if (numIntegerDigits > 0) { - // write out integer part first // then write out fractional part for (int i=0; i < numIntegerDigits; i++) { buf.append(unscaled[i]); } - if (this.scale > trailingZeros) { + if (this.actualScale > 0) { buf.append('.'); - for (int i = numIntegerDigits; i < (unscaledLength - trailingZeros); i++) { + + if (trailingZeros > this.actualScale) { + for (int i=0; i < (trailingZeros - this.scale); i++) { + buf.append("0"); + } + } + + for (int i = numIntegerDigits; i < (numIntegerDigits + this.actualScale); i++) { buf.append(unscaled[i]); } } } else { - // no integer part buf.append('0'); - if (this.scale > trailingZeros) { - + if (this.actualScale > 0) { // fractional part has, starting with zeros buf.append('.'); - for (int i = unscaledLength; i < this.scale; ++i) { - buf.append('0'); + + if (this.actualScale > trailingZeros) { + for (int i = unscaledLength; i < this.scale; ++i) { + buf.append('0'); + } } - for (int i = 0; i < (unscaledLength - trailingZeros); i++) { + + for (int i = 0; i < (numIntegerDigits + this.actualScale); i++) { buf.append(unscaled[i]); } } @@ -1836,9 +1882,10 @@ public String toFormalString() { @Override public String toString() { - return toFormalString() + "(Decimal128: scale=" + scale + ", signum=" - + signum + ", BigDecimal.toString=" + toBigDecimal().toString() - + ", unscaledValue=[" + unscaledValue.toString() + "])"; + return toFormalString() + "(Decimal128: scale=" + scale + ", actualScale=" + + this.actualScale + ", signum=" + signum + ", BigDecimal.toString=" + + toBigDecimal().toString() + ", unscaledValue=[" + unscaledValue.toString() + + "])"; } /** @@ -1956,6 +2003,7 @@ public Decimal128 updateVarianceDestructive( */ public Decimal128 fastUpdateFromInternalStorage(byte[] internalStorage, short scale) { this.scale = scale; + this.actualScale = scale; this.signum = this.unscaledValue.fastUpdateFromInternalStorage(internalStorage); return this; diff --git common/src/java/org/apache/hadoop/hive/common/type/HiveDecimal.java common/src/java/org/apache/hadoop/hive/common/type/HiveDecimal.java index ad09015..00ea481 100644 --- common/src/java/org/apache/hadoop/hive/common/type/HiveDecimal.java +++ common/src/java/org/apache/hadoop/hive/common/type/HiveDecimal.java @@ -30,7 +30,6 @@ public class HiveDecimal implements Comparable { public static final int MAX_PRECISION = 38; public static final int MAX_SCALE = 38; - /** * Default precision/scale when user doesn't specify in the column metadata, such as * decimal and decimal(8). @@ -113,7 +112,7 @@ public int compareTo(HiveDecimal dec) { @Override public int hashCode() { - return bd.hashCode(); + return trim(bd).hashCode(); } @Override @@ -169,7 +168,7 @@ public HiveDecimal subtract(HiveDecimal dec) { } public HiveDecimal multiply(HiveDecimal dec) { - return create(bd.multiply(dec.bd), false); + return create(bd.multiply(dec.bd), true); } public BigInteger unscaledValue() { @@ -202,7 +201,7 @@ public HiveDecimal remainder(HiveDecimal dec) { } public HiveDecimal divide(HiveDecimal dec) { - return create(bd.divide(dec.bd, MAX_SCALE, RoundingMode.HALF_UP), true); + return create(trim(bd.divide(dec.bd, MAX_SCALE, RoundingMode.HALF_UP)), true); } /** @@ -232,8 +231,6 @@ private static BigDecimal normalize(BigDecimal bd, boolean allowRounding) { return null; } - bd = trim(bd); - int intDigits = bd.precision() - bd.scale(); if (intDigits > MAX_PRECISION) { @@ -244,8 +241,6 @@ private static BigDecimal normalize(BigDecimal bd, boolean allowRounding) { if (bd.scale() > maxScale ) { if (allowRounding) { bd = bd.setScale(maxScale, RoundingMode.HALF_UP); - // Trimming is again necessary, because rounding may introduce new trailing 0's. - bd = trim(bd); } else { bd = null; } @@ -259,8 +254,6 @@ public static BigDecimal enforcePrecisionScale(BigDecimal bd, int maxPrecision, return null; } - bd = trim(bd); - int maxIntDigits = maxPrecision - maxScale; int intDigits = bd.precision() - bd.scale(); if (intDigits > maxIntDigits) { diff --git common/src/test/org/apache/hadoop/hive/common/type/TestDecimal128.java common/src/test/org/apache/hadoop/hive/common/type/TestDecimal128.java index 46236a5..0786cca 100644 --- common/src/test/org/apache/hadoop/hive/common/type/TestDecimal128.java +++ common/src/test/org/apache/hadoop/hive/common/type/TestDecimal128.java @@ -811,7 +811,7 @@ public void testToHiveDecimalString() { assertEquals("0.00923076923", d2.getHiveDecimalString()); Decimal128 d3 = new Decimal128("0.00923076000", (short) 15); - assertEquals("0.00923076", d3.getHiveDecimalString()); + assertEquals("0.00923076000", d3.getHiveDecimalString()); Decimal128 d4 = new Decimal128("4294967296.01", (short) 15); assertEquals("4294967296.01", d4.getHiveDecimalString()); @@ -849,15 +849,37 @@ public void testToHiveDecimalString() { d11.update(hd6.bigDecimalValue()); assertEquals(hd6.toString(), d11.getHiveDecimalString()); + // The trailing zeros from a double value are trimmed automatically + // by the double data type Decimal128 d12 = new Decimal128(27.000, (short)3); - HiveDecimal hd7 = HiveDecimal.create(new BigDecimal("27.000")); + HiveDecimal hd7 = HiveDecimal.create(new BigDecimal("27.0")); assertEquals(hd7.toString(), d12.getHiveDecimalString()); - assertEquals("27", d12.getHiveDecimalString()); + assertEquals("27.0", d12.getHiveDecimalString()); Decimal128 d13 = new Decimal128(1234123000, (short)3); HiveDecimal hd8 = HiveDecimal.create(new BigDecimal("1234123000")); assertEquals(hd8.toString(), d13.getHiveDecimalString()); assertEquals("1234123000", d13.getHiveDecimalString()); + + Decimal128 d14 = new Decimal128(1.33e4, (short)10); + HiveDecimal hd9 = HiveDecimal.create(new BigDecimal("1.33e4")); + assertEquals(hd9.toString(), d14.getHiveDecimalString()); + assertEquals("13300", d14.getHiveDecimalString()); + + Decimal128 d15 = new Decimal128(1.33e-4, (short)10); + HiveDecimal hd10 = HiveDecimal.create(new BigDecimal("1.33e-4")); + assertEquals(hd10.toString(), d15.getHiveDecimalString()); + assertEquals("0.000133", d15.getHiveDecimalString()); + + Decimal128 d16 = new Decimal128("1.33e4", (short)10); + HiveDecimal hd11 = HiveDecimal.create(new BigDecimal("1.33e4")); + assertEquals(hd11.toString(), d16.getHiveDecimalString()); + assertEquals("13300", d16.getHiveDecimalString()); + + Decimal128 d17 = new Decimal128("1.33e-4", (short)10); + HiveDecimal hd12 = HiveDecimal.create(new BigDecimal("1.33e-4")); + assertEquals(hd12.toString(), d17.getHiveDecimalString()); + assertEquals("0.000133", d17.getHiveDecimalString()); } @Test diff --git common/src/test/org/apache/hadoop/hive/common/type/TestHiveDecimal.java common/src/test/org/apache/hadoop/hive/common/type/TestHiveDecimal.java index 1384a45..769410d 100644 --- common/src/test/org/apache/hadoop/hive/common/type/TestHiveDecimal.java +++ common/src/test/org/apache/hadoop/hive/common/type/TestHiveDecimal.java @@ -50,25 +50,35 @@ public void testPrecisionScaleEnforcement() { Assert.assertEquals("-1786135888657847525803324040144343378.1", dec.toString()); dec = HiveDecimal.create("005.34000"); - Assert.assertEquals(dec.precision(), 3); - Assert.assertEquals(dec.scale(), 2); + Assert.assertEquals(dec.precision(), 6); + Assert.assertEquals(dec.scale(), 5); dec = HiveDecimal.create("178613588865784752580332404014434337809799306448796128931113691624"); Assert.assertNull(dec); - } - @Test - public void testTrailingZeroRemovalAfterEnforcement() { - String decStr = "8.090000000000000000000000000000000000000123456"; - HiveDecimal dec = HiveDecimal.create(decStr); - Assert.assertEquals("8.09", dec.toString()); + // Leaving trailing zeros + Assert.assertEquals("0.0", HiveDecimal.enforcePrecisionScale(new BigDecimal("0.0"), 2, 1).toString()); + Assert.assertEquals("0.00", HiveDecimal.enforcePrecisionScale(new BigDecimal("0.00"), 3, 2).toString()); + Assert.assertEquals("0.0000", HiveDecimal.enforcePrecisionScale(new BigDecimal("0.0000"), 10, 4).toString()); + Assert.assertEquals("100.00000", HiveDecimal.enforcePrecisionScale(new BigDecimal("100.00000"), 15, 5).toString()); + Assert.assertEquals("100.00", HiveDecimal.enforcePrecisionScale(new BigDecimal("100.00"), 15, 5).toString()); + + // Rounding numbers + Assert.assertEquals("0.01", HiveDecimal.enforcePrecisionScale(new BigDecimal("0.012"), 3, 2).toString()); + Assert.assertEquals("0.02", HiveDecimal.enforcePrecisionScale(new BigDecimal("0.015"), 3, 2).toString()); + Assert.assertEquals("0.01", HiveDecimal.enforcePrecisionScale(new BigDecimal("0.0145"), 3, 2).toString()); + + // Integers with no scale values are not modified (zeros are not null) + Assert.assertEquals("0", HiveDecimal.enforcePrecisionScale(new BigDecimal("0"), 1, 0).toString()); + Assert.assertEquals("30", HiveDecimal.enforcePrecisionScale(new BigDecimal("30"), 2, 0).toString()); + Assert.assertEquals("5", HiveDecimal.enforcePrecisionScale(new BigDecimal("5"), 3, 2).toString()); } @Test public void testMultiply() { HiveDecimal dec1 = HiveDecimal.create("0.00001786135888657847525803"); HiveDecimal dec2 = HiveDecimal.create("3.0000123456789"); - Assert.assertNull(dec1.multiply(dec2)); + Assert.assertNotNull(dec1.multiply(dec2)); dec1 = HiveDecimal.create("178613588865784752580323232232323444.4"); dec2 = HiveDecimal.create("178613588865784752580302323232.3"); @@ -77,6 +87,14 @@ public void testMultiply() { dec1 = HiveDecimal.create("47.324"); dec2 = HiveDecimal.create("9232.309"); Assert.assertEquals("436909.791116", dec1.multiply(dec2).toString()); + + dec1 = HiveDecimal.create("3.140"); + dec2 = HiveDecimal.create("1.00"); + Assert.assertEquals("3.14000", dec1.multiply(dec2).toString()); + + dec1 = HiveDecimal.create("43.010"); + dec2 = HiveDecimal.create("2"); + Assert.assertEquals("86.020", dec1.multiply(dec2).toString()); } @Test @@ -87,6 +105,9 @@ public void testPow() { HiveDecimal dec1 = HiveDecimal.create("0.000017861358882"); dec1 = dec1.pow(3); Assert.assertNull(dec1); + + dec1 = HiveDecimal.create("3.140"); + Assert.assertEquals("9.859600", dec1.pow(2).toString()); } @Test @@ -94,6 +115,14 @@ public void testDivide() { HiveDecimal dec1 = HiveDecimal.create("3.14"); HiveDecimal dec2 = HiveDecimal.create("3"); Assert.assertNotNull(dec1.divide(dec2)); + + dec1 = HiveDecimal.create("15"); + dec2 = HiveDecimal.create("5"); + Assert.assertEquals("3", dec1.divide(dec2).toString()); + + dec1 = HiveDecimal.create("3.140"); + dec2 = HiveDecimal.create("1.00"); + Assert.assertEquals("3.14", dec1.divide(dec2).toString()); } @Test @@ -101,6 +130,18 @@ public void testPlus() { HiveDecimal dec1 = HiveDecimal.create("99999999999999999999999999999999999"); HiveDecimal dec2 = HiveDecimal.create("1"); Assert.assertNotNull(dec1.add(dec2)); + + dec1 = HiveDecimal.create("3.140"); + dec2 = HiveDecimal.create("1.00"); + Assert.assertEquals("4.140", dec1.add(dec2).toString()); + } + + + @Test + public void testSubtract() { + HiveDecimal dec1 = HiveDecimal.create("3.140"); + HiveDecimal dec2 = HiveDecimal.create("1.00"); + Assert.assertEquals("2.140", dec1.subtract(dec2).toString()); } @Test @@ -112,6 +153,12 @@ public void testPosMod() { } @Test + public void testHashCode() { + Assert.assertEquals(HiveDecimal.create("9").hashCode(), HiveDecimal.create("9.00").hashCode()); + Assert.assertEquals(HiveDecimal.create("0").hashCode(), HiveDecimal.create("0.00").hashCode()); + } + + @Test public void testException() { HiveDecimal dec = HiveDecimal.create("3.1415.926"); Assert.assertNull(dec); @@ -121,7 +168,7 @@ public void testException() { @Test public void testBinaryConversion() { - testBinaryConversion("0.0"); + testBinaryConversion("0.00"); testBinaryConversion("-12.25"); testBinaryConversion("234.79"); } diff --git data/files/kv10.txt data/files/kv10.txt new file mode 100644 index 0000000..88136f5 --- /dev/null +++ data/files/kv10.txt @@ -0,0 +1,30 @@ +0,000000000000000000000000000000000000000000000,000000000000000000000000000000000000000000000 +1,-000000000000000000000000000000000000000000000,-000000000000000000000000000000000000000000000 +2,1000000000.0000,100000000000000.00000000 +3,1.0000000000000,1.0000000000000000000000 +4,10.000000000000,10.000000000000000000000 +5,100.00000000000,100.00000000000000000000 +6,1000.0000000000,1000.0000000000000000000 +7,10000.000000000,10000.000000000000000000 +8,100000.00000000,100000.00000000000000000 +9,1000000.0000000,1000000.0000000000000000 +10,10000000.000000,10000000.000000000000000 +11,100000000.00000,100000000.00000000000000 +12,1000000000.0000,1000000000.0000000000000 +13,10000000000.000,10000000000.000000000000 +14,100000000000.00,100000000000.00000000000 +15,1000000000000.0,1000000000000.0000000000 +16,10000000000000.0,100000000000000.00000000 +17,10000000000000.0,1000000000000000.0000000 +18,1.0000,1.00000000 +19,10.000,10.0000000 +20,100.00,100.000000 +21,1000.0,1000.00000 +22,100000,10000.0000 +23,0.0000,0.00000000 +24,00.000,00.0000000 +25,000.00,000.000000 +26,0000.0,0000.00000 +27,00000.,0000.00000 +28,12313.2000,134134.31252500 +29,99999.9990,134134.31242553 diff --git ql/src/java/org/apache/hadoop/hive/ql/io/orc/RecordReaderImpl.java ql/src/java/org/apache/hadoop/hive/ql/io/orc/RecordReaderImpl.java index f5023bb..e7e316a 100644 --- ql/src/java/org/apache/hadoop/hive/ql/io/orc/RecordReaderImpl.java +++ ql/src/java/org/apache/hadoop/hive/ql/io/orc/RecordReaderImpl.java @@ -1292,8 +1292,9 @@ Object nextVector(Object previousVector, long batchSize) throws IOException { BigInteger bInt = SerializationUtils.readBigInteger(valueStream); result.vector[i].update(bInt, (short) scratchScaleVector.vector[i]); - // Change the scale to match the schema if the scale in data is different. - if (scale != scratchScaleVector.vector[i]) { + // Change the scale to match the schema if the scale is less than in data. + // (HIVE-7373) If scale is bigger, then it leaves the original trailing zeros + if (scale < scratchScaleVector.vector[i]) { result.vector[i].changeScaleDestructive((short) scale); } } diff --git ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorTypeCasts.java ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorTypeCasts.java index 2a871c5..bd0d5c5 100644 --- ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorTypeCasts.java +++ ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorTypeCasts.java @@ -332,7 +332,7 @@ public void testCastDecimalToString() { StringExpr.compare(v, 0, v.length, r.vector[1], r.start[1], r.length[1])); - v = toBytes("9999999999999999"); + v = toBytes("9999999999999999.00"); Assert.assertEquals(0, StringExpr.compare(v, 0, v.length, r.vector[2], r.start[2], r.length[2])); diff --git ql/src/test/org/apache/hadoop/hive/ql/io/sarg/TestSearchArgumentImpl.java ql/src/test/org/apache/hadoop/hive/ql/io/sarg/TestSearchArgumentImpl.java index b1524f7..ca49b32 100644 --- ql/src/test/org/apache/hadoop/hive/ql/io/sarg/TestSearchArgumentImpl.java +++ ql/src/test/org/apache/hadoop/hive/ql/io/sarg/TestSearchArgumentImpl.java @@ -2828,7 +2828,7 @@ public void testBuilderComplexTypes() throws Exception { .build(); assertEquals("leaf-0 = (LESS_THAN x 1970-01-11)\n" + "leaf-1 = (LESS_THAN_EQUALS y hi)\n" + - "leaf-2 = (EQUALS z 1)\n" + + "leaf-2 = (EQUALS z 1.0)\n" + "expr = (and leaf-0 leaf-1 leaf-2)", sarg.toString()); sarg = SearchArgument.FACTORY.newBuilder() diff --git ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFOPDivide.java ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFOPDivide.java index 4c5b3a5..ce578a0 100644 --- ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFOPDivide.java +++ ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFOPDivide.java @@ -187,7 +187,7 @@ public void testDecimalDivideDecimal() throws HiveException { PrimitiveObjectInspector oi = (PrimitiveObjectInspector) udf.initialize(inputOIs); Assert.assertEquals(TypeInfoFactory.getDecimalTypeInfo(11, 7), oi.getTypeInfo()); HiveDecimalWritable res = (HiveDecimalWritable) udf.evaluate(args); - Assert.assertEquals(HiveDecimal.create("0.06171"), res.getHiveDecimal()); + Assert.assertEquals(HiveDecimal.create("0.0617100"), res.getHiveDecimal()); } @Test diff --git ql/src/test/queries/clientpositive/decimal_trailing.q ql/src/test/queries/clientpositive/decimal_trailing.q new file mode 100644 index 0000000..80afb40 --- /dev/null +++ ql/src/test/queries/clientpositive/decimal_trailing.q @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS DECIMAL_TRAILING; + +CREATE TABLE DECIMAL_TRAILING ( + id int, + a decimal(10,4), + b decimal(15,8) + ) +ROW FORMAT DELIMITED + FIELDS TERMINATED BY ',' +STORED AS TEXTFILE; + +LOAD DATA LOCAL INPATH '../../data/files/kv10.txt' INTO TABLE DECIMAL_TRAILING; + +SELECT * FROM DECIMAL_TRAILING ORDER BY id; + +DROP TABLE DECIMAL_TRAILING; diff --git ql/src/test/queries/clientpositive/literal_decimal.q ql/src/test/queries/clientpositive/literal_decimal.q index 08b21dc..1bafc24 100644 --- ql/src/test/queries/clientpositive/literal_decimal.q +++ ql/src/test/queries/clientpositive/literal_decimal.q @@ -1,5 +1,5 @@ set hive.fetch.task.conversion=more; -EXPLAIN SELECT -1BD, 0BD, 1BD, 3.14BD, -3.14BD, 99999999999999999BD, 99999999999999999.9999999999999BD, 1E-99BD, 1E99BD FROM src LIMIT 1; +EXPLAIN SELECT -1BD, 0BD, 1BD, 3.14BD, -3.14BD, 99999999999999999BD, 99999999999999999.9999999999999BD, 1E99BD FROM src LIMIT 1; -SELECT -1BD, 0BD, 1BD, 3.14BD, -3.14BD, 99999999999999999BD, 99999999999999999.9999999999999BD, 1E-99BD, 1E99BD FROM src LIMIT 1; +SELECT -1BD, 0BD, 1BD, 3.14BD, -3.14BD, 99999999999999999BD, 99999999999999999.9999999999999BD, 1E99BD FROM src LIMIT 1; diff --git ql/src/test/results/clientpositive/avro_decimal.q.out ql/src/test/results/clientpositive/avro_decimal.q.out index 88268ce..921a418 100644 --- ql/src/test/results/clientpositive/avro_decimal.q.out +++ ql/src/test/results/clientpositive/avro_decimal.q.out @@ -106,9 +106,9 @@ Mary 4.33 Cluck 5.96 Tom -12.25 Mary 33.33 -Tom 19 -Beck 0 -Beck 79.9 +Tom 19.00 +Beck 0.00 +Beck 79.90 PREHOOK: query: DROP TABLE IF EXISTS avro_dec1 PREHOOK: type: DROPTABLE POSTHOOK: query: DROP TABLE IF EXISTS avro_dec1 @@ -175,10 +175,10 @@ POSTHOOK: Input: default@avro_dec1 77.3 55.7 4.3 -6 +6.0 12.3 33.3 -19 +19.0 3.2 79.9 PREHOOK: query: DROP TABLE dec diff --git ql/src/test/results/clientpositive/avro_decimal_native.q.out ql/src/test/results/clientpositive/avro_decimal_native.q.out index c8ae0fb..60b4ccc 100644 --- ql/src/test/results/clientpositive/avro_decimal_native.q.out +++ ql/src/test/results/clientpositive/avro_decimal_native.q.out @@ -92,9 +92,9 @@ Mary 4.33 Cluck 5.96 Tom -12.25 Mary 33.33 -Tom 19 -Beck 0 -Beck 79.9 +Tom 19.00 +Beck 0.00 +Beck 79.90 PREHOOK: query: DROP TABLE IF EXISTS avro_dec1 PREHOOK: type: DROPTABLE POSTHOOK: query: DROP TABLE IF EXISTS avro_dec1 @@ -143,10 +143,10 @@ POSTHOOK: Input: default@avro_dec1 77.3 55.7 4.3 -6 +6.0 12.3 33.3 -19 +19.0 3.2 79.9 PREHOOK: query: DROP TABLE dec diff --git ql/src/test/results/clientpositive/char_pad_convert.q.out ql/src/test/results/clientpositive/char_pad_convert.q.out index 26102e4..63568af 100644 --- ql/src/test/results/clientpositive/char_pad_convert.q.out +++ ql/src/test/results/clientpositive/char_pad_convert.q.out @@ -144,7 +144,7 @@ select lpad(f, 4, ' '), POSTHOOK: type: QUERY POSTHOOK: Input: default@over1k #### A masked pattern was here #### -74.7 42 zzzzzTRUE 20 ddd45.4 yard du +74.7 42 zzzzzTRUE 20 dd45.40 yard du 26.4 37 zzzzzTRUE 20 dd29.62 history 96.9 18 zzzzFALSE 20 dd27.32 history 13.0 34 zzzzFALSE 20 dd23.91 topolog @@ -190,7 +190,7 @@ POSTHOOK: query: select rpad(f, 4, ' '), POSTHOOK: type: QUERY POSTHOOK: Input: default@over1k #### A masked pattern was here #### -74.7 42 TRUEzzzzz 20 45.4ddd yard du +74.7 42 TRUEzzzzz 20 45.40dd yard du 26.4 37 TRUEzzzzz 20 29.62dd history 96.9 18 FALSEzzzz 20 27.32dd history 13.0 34 FALSEzzzz 20 23.91dd topolog diff --git ql/src/test/results/clientpositive/decimal_2.q.out ql/src/test/results/clientpositive/decimal_2.q.out index 934590c..759ecf4 100644 --- ql/src/test/results/clientpositive/decimal_2.q.out +++ ql/src/test/results/clientpositive/decimal_2.q.out @@ -264,7 +264,7 @@ POSTHOOK: query: select cast(0.99999999999999999999 as decimal(20,19)) from deci POSTHOOK: type: QUERY POSTHOOK: Input: default@decimal_2 #### A masked pattern was here #### -1 +1.0 PREHOOK: query: select cast('0.99999999999999999999' as decimal(20,20)) from decimal_2 PREHOOK: type: QUERY PREHOOK: Input: default@decimal_2 diff --git ql/src/test/results/clientpositive/decimal_3.q.out ql/src/test/results/clientpositive/decimal_3.q.out index 8e9a30a..acaae65 100644 --- ql/src/test/results/clientpositive/decimal_3.q.out +++ ql/src/test/results/clientpositive/decimal_3.q.out @@ -33,7 +33,7 @@ POSTHOOK: type: QUERY POSTHOOK: Input: default@decimal_3 #### A masked pattern was here #### NULL 0 --1234567890.123456789 -1234567890 +-1234567890.1234567890 -1234567890 -4400 4400 -1255.49 -1255 -1.122 -11 @@ -42,7 +42,7 @@ NULL 0 -0.333 0 -0.33 0 -0.3 0 -0 0 +0.000000000000000000 0 0 0 0 0 0.01 0 @@ -53,8 +53,8 @@ NULL 0 0.33 0 0.333 0 1 1 -1 1 -1 1 +1.0 1 +1.000000000000000000 1 1.12 1 1.122 1 2 2 @@ -62,14 +62,14 @@ NULL 0 3.14 3 3.14 3 3.14 3 -3.14 4 +3.140 4 10 10 20 20 100 100 -124 124 +124.00 124 125.2 125 200 200 -1234567890.12345678 1234567890 +1234567890.1234567800 1234567890 PREHOOK: query: SELECT * FROM DECIMAL_3 ORDER BY key DESC, value DESC PREHOOK: type: QUERY PREHOOK: Input: default@decimal_3 @@ -78,14 +78,14 @@ POSTHOOK: query: SELECT * FROM DECIMAL_3 ORDER BY key DESC, value DESC POSTHOOK: type: QUERY POSTHOOK: Input: default@decimal_3 #### A masked pattern was here #### -1234567890.12345678 1234567890 +1234567890.1234567800 1234567890 200 200 125.2 125 -124 124 +124.00 124 100 100 20 20 10 10 -3.14 4 +3.140 4 3.14 3 3.14 3 3.14 3 @@ -93,8 +93,8 @@ POSTHOOK: Input: default@decimal_3 2 2 1.122 1 1.12 1 -1 1 -1 1 +1.000000000000000000 1 +1.0 1 1 1 0.333 0 0.33 0 @@ -105,7 +105,7 @@ POSTHOOK: Input: default@decimal_3 0.01 0 0 0 0 0 -0 0 +0.000000000000000000 0 -0.3 0 -0.33 0 -0.333 0 @@ -114,7 +114,7 @@ POSTHOOK: Input: default@decimal_3 -1.122 -11 -1255.49 -1255 -4400 4400 --1234567890.123456789 -1234567890 +-1234567890.1234567890 -1234567890 NULL 0 PREHOOK: query: SELECT * FROM DECIMAL_3 ORDER BY key, value PREHOOK: type: QUERY @@ -125,7 +125,7 @@ POSTHOOK: type: QUERY POSTHOOK: Input: default@decimal_3 #### A masked pattern was here #### NULL 0 --1234567890.123456789 -1234567890 +-1234567890.1234567890 -1234567890 -4400 4400 -1255.49 -1255 -1.122 -11 @@ -134,7 +134,7 @@ NULL 0 -0.333 0 -0.33 0 -0.3 0 -0 0 +0.000000000000000000 0 0 0 0 0 0.01 0 @@ -145,8 +145,8 @@ NULL 0 0.33 0 0.333 0 1 1 -1 1 -1 1 +1.0 1 +1.000000000000000000 1 1.12 1 1.122 1 2 2 @@ -154,14 +154,14 @@ NULL 0 3.14 3 3.14 3 3.14 3 -3.14 4 +3.140 4 10 10 20 20 100 100 -124 124 +124.00 124 125.2 125 200 200 -1234567890.12345678 1234567890 +1234567890.1234567800 1234567890 PREHOOK: query: SELECT DISTINCT key FROM DECIMAL_3 ORDER BY key PREHOOK: type: QUERY PREHOOK: Input: default@decimal_3 @@ -171,7 +171,7 @@ POSTHOOK: type: QUERY POSTHOOK: Input: default@decimal_3 #### A masked pattern was here #### NULL --1234567890.123456789 +-1234567890.1234567890 -4400 -1255.49 -1.122 @@ -179,7 +179,7 @@ NULL -0.333 -0.33 -0.3 -0 +0.000000000000000000 0.01 0.02 0.1 @@ -195,10 +195,10 @@ NULL 10 20 100 -124 +124.00 125.2 200 -1234567890.12345678 +1234567890.1234567800 PREHOOK: query: SELECT key, sum(value) FROM DECIMAL_3 GROUP BY key ORDER BY key PREHOOK: type: QUERY PREHOOK: Input: default@decimal_3 @@ -208,7 +208,7 @@ POSTHOOK: type: QUERY POSTHOOK: Input: default@decimal_3 #### A masked pattern was here #### NULL 0 --1234567890.123456789 -1234567890 +-1234567890.1234567890 -1234567890 -4400 4400 -1255.49 -1255 -1.122 -11 @@ -216,7 +216,7 @@ NULL 0 -0.333 0 -0.33 0 -0.3 0 -0 0 +0.000000000000000000 0 0.01 0 0.02 0 0.1 0 @@ -232,10 +232,10 @@ NULL 0 10 10 20 20 100 100 -124 124 +124.00 124 125.2 125 200 200 -1234567890.12345678 1234567890 +1234567890.1234567800 1234567890 PREHOOK: query: SELECT value, sum(key) FROM DECIMAL_3 GROUP BY value ORDER BY value PREHOOK: type: QUERY PREHOOK: Input: default@decimal_3 @@ -244,23 +244,23 @@ POSTHOOK: query: SELECT value, sum(key) FROM DECIMAL_3 GROUP BY value ORDER BY v POSTHOOK: type: QUERY POSTHOOK: Input: default@decimal_3 #### A masked pattern was here #### --1234567890 -1234567890.123456789 +-1234567890 -1234567890.1234567890 -1255 -1255.49 -11 -1.122 -1 -2.24 -0 0.33 -1 5.242 +0 0.330000000000000000 +1 5.242000000000000000 2 4 3 9.42 -4 3.14 +4 3.140 10 10 20 20 100 100 -124 124 +124 124.00 125 125.2 200 200 4400 -4400 -1234567890 1234567890.12345678 +1234567890 1234567890.1234567800 PREHOOK: query: SELECT * FROM DECIMAL_3 a JOIN DECIMAL_3 b ON (a.key = b.key) ORDER BY a.key, a.value, b.value PREHOOK: type: QUERY PREHOOK: Input: default@decimal_3 @@ -269,7 +269,7 @@ POSTHOOK: query: SELECT * FROM DECIMAL_3 a JOIN DECIMAL_3 b ON (a.key = b.key) O POSTHOOK: type: QUERY POSTHOOK: Input: default@decimal_3 #### A masked pattern was here #### --1234567890.123456789 -1234567890 -1234567890.123456789 -1234567890 +-1234567890.1234567890 -1234567890 -1234567890.1234567890 -1234567890 -4400 4400 -4400 4400 -1255.49 -1255 -1255.49 -1255 -1.122 -11 -1.122 -11 @@ -280,11 +280,7 @@ POSTHOOK: Input: default@decimal_3 -0.333 0 -0.333 0 -0.33 0 -0.33 0 -0.3 0 -0.3 0 -0 0 0 0 -0 0 0 0 -0 0 0 0 -0 0 0 0 -0 0 0 0 +0.000000000000000000 0 0.000000000000000000 0 0 0 0 0 0 0 0 0 0 0 0 0 @@ -297,14 +293,8 @@ POSTHOOK: Input: default@decimal_3 0.33 0 0.33 0 0.333 0 0.333 0 1 1 1 1 -1 1 1 1 -1 1 1 1 -1 1 1 1 -1 1 1 1 -1 1 1 1 -1 1 1 1 -1 1 1 1 -1 1 1 1 +1.0 1 1.0 1 +1.000000000000000000 1 1.000000000000000000 1 1.12 1 1.12 1 1.122 1 1.122 1 2 2 2 2 @@ -320,20 +310,14 @@ POSTHOOK: Input: default@decimal_3 3.14 3 3.14 3 3.14 3 3.14 3 3.14 3 3.14 3 -3.14 3 3.14 4 -3.14 3 3.14 4 -3.14 3 3.14 4 -3.14 4 3.14 3 -3.14 4 3.14 3 -3.14 4 3.14 3 -3.14 4 3.14 4 +3.140 4 3.140 4 10 10 10 10 20 20 20 20 100 100 100 100 -124 124 124 124 +124.00 124 124.00 124 125.2 125 125.2 125 200 200 200 200 -1234567890.12345678 1234567890 1234567890.12345678 1234567890 +1234567890.1234567800 1234567890 1234567890.1234567800 1234567890 PREHOOK: query: SELECT * FROM DECIMAL_3 WHERE key=3.14 ORDER BY key, value PREHOOK: type: QUERY PREHOOK: Input: default@decimal_3 @@ -345,7 +329,7 @@ POSTHOOK: Input: default@decimal_3 3.14 3 3.14 3 3.14 3 -3.14 4 +3.140 4 PREHOOK: query: SELECT * FROM DECIMAL_3 WHERE key=3.140 ORDER BY key, value PREHOOK: type: QUERY PREHOOK: Input: default@decimal_3 @@ -357,7 +341,7 @@ POSTHOOK: Input: default@decimal_3 3.14 3 3.14 3 3.14 3 -3.14 4 +3.140 4 PREHOOK: query: DROP TABLE DECIMAL_3 PREHOOK: type: DROPTABLE PREHOOK: Input: default@decimal_3 diff --git ql/src/test/results/clientpositive/decimal_4.q.out ql/src/test/results/clientpositive/decimal_4.q.out index 50662af..a31d27a 100644 --- ql/src/test/results/clientpositive/decimal_4.q.out +++ ql/src/test/results/clientpositive/decimal_4.q.out @@ -57,7 +57,7 @@ POSTHOOK: type: QUERY POSTHOOK: Input: default@decimal_4_1 #### A masked pattern was here #### NULL 0 --1234567890.123456789 -1234567890 +-1234567890.1234567890 -1234567890 -4400 4400 -1255.49 -1255 -1.122 -11 @@ -66,7 +66,7 @@ NULL 0 -0.333 0 -0.33 0 -0.3 0 -0 0 +0.0000000000000000000000000 0 0 0 0 0 0.01 0 @@ -78,7 +78,7 @@ NULL 0 0.333 0 0.9999999999999999999999999 1 1 1 -1 1 +1.0 1 1.12 1 1.122 1 2 2 @@ -86,14 +86,14 @@ NULL 0 3.14 3 3.14 3 3.14 3 -3.14 4 +3.140 4 10 10 20 20 100 100 -124 124 +124.00 124 125.2 125 200 200 -1234567890.12345678 1234567890 +1234567890.1234567800 1234567890 PREHOOK: query: SELECT * FROM DECIMAL_4_2 ORDER BY key PREHOOK: type: QUERY PREHOOK: Input: default@decimal_4_2 @@ -103,7 +103,7 @@ POSTHOOK: type: QUERY POSTHOOK: Input: default@decimal_4_2 #### A masked pattern was here #### NULL NULL --1234567890.123456789 -3703703670.370370367 +-1234567890.1234567890 -3703703670.3703703670 -4400 -13200 -1255.49 -3766.47 -1.122 -3.366 @@ -112,7 +112,7 @@ NULL NULL -0.333 -0.999 -0.33 -0.99 -0.3 -0.9 -0 0 +0.0000000000000000000000000 0.0000000000000000000000000 0 0 0 0 0.01 0.03 @@ -124,7 +124,7 @@ NULL NULL 0.333 0.999 0.9999999999999999999999999 2.9999999999999999999999997 1 3 -1 3 +1.0 3.0 1.12 3.36 1.122 3.366 2 6 @@ -132,14 +132,14 @@ NULL NULL 3.14 9.42 3.14 9.42 3.14 9.42 -3.14 9.42 +3.140 9.420 10 30 20 60 100 300 -124 372 +124.00 372.00 125.2 375.6 200 600 -1234567890.12345678 3703703670.37037034 +1234567890.1234567800 3703703670.3703703400 PREHOOK: query: DROP TABLE DECIMAL_4_1 PREHOOK: type: DROPTABLE PREHOOK: Input: default@decimal_4_1 diff --git ql/src/test/results/clientpositive/decimal_5.q.out ql/src/test/results/clientpositive/decimal_5.q.out index 0f24b8a..6df5097 100644 --- ql/src/test/results/clientpositive/decimal_5.q.out +++ ql/src/test/results/clientpositive/decimal_5.q.out @@ -43,7 +43,7 @@ NULL -0.333 -0.33 -0.3 -0 +0.00000 0 0 0.01 @@ -54,8 +54,8 @@ NULL 0.33 0.333 1 -1 -1 +1.0 +1.00000 1.12 1.122 2 @@ -63,11 +63,11 @@ NULL 3.14 3.14 3.14 -3.14 +3.140 10 20 100 -124 +124.00 125.2 200 PREHOOK: query: SELECT DISTINCT key FROM DECIMAL_5 ORDER BY key @@ -86,7 +86,7 @@ NULL -0.333 -0.33 -0.3 -0 +0.00000 0.01 0.02 0.1 @@ -102,7 +102,7 @@ NULL 10 20 100 -124 +124.00 125.2 200 PREHOOK: query: SELECT cast(key as decimal) FROM DECIMAL_5 @@ -161,7 +161,7 @@ POSTHOOK: Input: default@decimal_5 #### A masked pattern was here #### NULL NULL -0 +0.000 0 100 10 @@ -180,7 +180,7 @@ NULL -0.3 -0.33 -0.333 -1 +1.0 2 3.14 -1.12 @@ -188,13 +188,13 @@ NULL -1.122 1.12 1.122 -124 +124.00 125.2 NULL 3.14 3.14 -3.14 -1 +3.140 +1.000 NULL NULL PREHOOK: query: DROP TABLE DECIMAL_5 diff --git ql/src/test/results/clientpositive/decimal_6.q.out ql/src/test/results/clientpositive/decimal_6.q.out index c0cad1f..720966f 100644 --- ql/src/test/results/clientpositive/decimal_6.q.out +++ ql/src/test/results/clientpositive/decimal_6.q.out @@ -91,16 +91,16 @@ NULL -0.333 -0.3 -0.3 -0 -0 +0.00000 +0.0000 0 0 0.333 0.333 -1 -1 -1 -1 +1.0 +1.0 +1.0000 +1.00000 1.12 1.12 1.122 @@ -111,14 +111,14 @@ NULL 3.14 3.14 3.14 -3.14 -3.14 +3.140 +3.140 10 10 10.7343 10.73433 -124 -124 +124.00 +124.00 125.2 125.2 23232.23435 diff --git ql/src/test/results/clientpositive/decimal_precision.q.out ql/src/test/results/clientpositive/decimal_precision.q.out index f3f2cbc..94c63cb 100644 --- ql/src/test/results/clientpositive/decimal_precision.q.out +++ ql/src/test/results/clientpositive/decimal_precision.q.out @@ -76,13 +76,13 @@ NULL NULL NULL NULL +0.0000000000 +0.0000000000 +0.0000000000 +0.0000000000 0 -0 -0 -0 -0 -0.123456789 -0.123456789 +0.1234567890 +0.1234567890 1.2345678901 1.2345678901 1.2345678901 @@ -106,7 +106,7 @@ NULL 123456789.0123456 123456789.0123456789 1234567890.123456 -1234567890.123456789 +1234567890.1234567890 PREHOOK: query: SELECT dec, dec + 1, dec - 1 FROM DECIMAL_PRECISION ORDER BY dec PREHOOK: type: QUERY PREHOOK: Input: default@decimal_precision @@ -159,13 +159,13 @@ NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +0.0000000000 1.0000000000 -1.0000000000 +0.0000000000 1.0000000000 -1.0000000000 +0.0000000000 1.0000000000 -1.0000000000 +0.0000000000 1.0000000000 -1.0000000000 0 1 -1 -0 1 -1 -0 1 -1 -0 1 -1 -0 1 -1 -0.123456789 1.123456789 -0.876543211 -0.123456789 1.123456789 -0.876543211 +0.1234567890 1.1234567890 -0.8765432110 +0.1234567890 1.1234567890 -0.8765432110 1.2345678901 2.2345678901 0.2345678901 1.2345678901 2.2345678901 0.2345678901 1.2345678901 2.2345678901 0.2345678901 @@ -189,7 +189,7 @@ NULL NULL NULL 123456789.0123456 123456790.0123456 123456788.0123456 123456789.0123456789 123456790.0123456789 123456788.0123456789 1234567890.123456 1234567891.123456 1234567889.123456 -1234567890.123456789 1234567891.123456789 1234567889.123456789 +1234567890.1234567890 1234567891.1234567890 1234567889.1234567890 PREHOOK: query: SELECT dec, dec * 2, dec / 3 FROM DECIMAL_PRECISION ORDER BY dec PREHOOK: type: QUERY PREHOOK: Input: default@decimal_precision @@ -242,13 +242,13 @@ NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +0.0000000000 0.0000000000 0 +0.0000000000 0.0000000000 0 +0.0000000000 0.0000000000 0 +0.0000000000 0.0000000000 0 0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0.123456789 0.246913578 0.041152263 -0.123456789 0.246913578 0.041152263 +0.1234567890 0.2469135780 0.041152263 +0.1234567890 0.2469135780 0.041152263 1.2345678901 2.4691357802 0.411522630033 1.2345678901 2.4691357802 0.411522630033 1.2345678901 2.4691357802 0.411522630033 @@ -258,9 +258,9 @@ NULL NULL NULL 123.4567890123 246.9135780246 41.1522630041 123.4567890123 246.9135780246 41.1522630041 123.4567890123 246.9135780246 41.1522630041 -1234.5678901235 2469.135780247 411.522630041167 -1234.5678901235 2469.135780247 411.522630041167 -1234.5678901235 2469.135780247 411.522630041167 +1234.5678901235 2469.1357802470 411.522630041167 +1234.5678901235 2469.1357802470 411.522630041167 +1234.5678901235 2469.1357802470 411.522630041167 12345.6789012346 24691.3578024692 4115.226300411533 12345.6789012346 24691.3578024692 4115.226300411533 123456.7890123456 246913.5780246912 41152.2630041152 @@ -272,7 +272,7 @@ NULL NULL NULL 123456789.0123456 246913578.0246912 41152263.0041152 123456789.0123456789 246913578.0246913578 41152263.0041152263 1234567890.123456 2469135780.246912 411522630.041152 -1234567890.123456789 2469135780.246913578 411522630.041152263 +1234567890.1234567890 2469135780.2469135780 411522630.041152263 PREHOOK: query: SELECT dec, dec / 9 FROM DECIMAL_PRECISION ORDER BY dec PREHOOK: type: QUERY PREHOOK: Input: default@decimal_precision @@ -325,13 +325,13 @@ NULL NULL NULL NULL NULL NULL NULL NULL +0.0000000000 0 +0.0000000000 0 +0.0000000000 0 +0.0000000000 0 0 0 -0 0 -0 0 -0 0 -0 0 -0.123456789 0.013717421 -0.123456789 0.013717421 +0.1234567890 0.013717421 +0.1234567890 0.013717421 1.2345678901 0.137174210011 1.2345678901 0.137174210011 1.2345678901 0.137174210011 @@ -355,7 +355,7 @@ NULL NULL 123456789.0123456 13717421.001371733333 123456789.0123456789 13717421.0013717421 1234567890.123456 137174210.013717333333 -1234567890.123456789 137174210.013717421 +1234567890.1234567890 137174210.013717421 PREHOOK: query: SELECT dec, dec / 27 FROM DECIMAL_PRECISION ORDER BY dec PREHOOK: type: QUERY PREHOOK: Input: default@decimal_precision @@ -408,13 +408,13 @@ NULL NULL NULL NULL NULL NULL NULL NULL +0.0000000000 0 +0.0000000000 0 +0.0000000000 0 +0.0000000000 0 0 0 -0 0 -0 0 -0 0 -0 0 -0.123456789 0.0045724736667 -0.123456789 0.0045724736667 +0.1234567890 0.0045724736667 +0.1234567890 0.0045724736667 1.2345678901 0.0457247366704 1.2345678901 0.0457247366704 1.2345678901 0.0457247366704 @@ -438,7 +438,7 @@ NULL NULL 123456789.0123456 4572473.6671239111111 123456789.0123456789 4572473.6671239140333 1234567890.123456 45724736.6712391111111 -1234567890.123456789 45724736.6712391403333 +1234567890.1234567890 45724736.6712391403333 PREHOOK: query: SELECT dec, dec * dec FROM DECIMAL_PRECISION ORDER BY dec PREHOOK: type: QUERY PREHOOK: Input: default@decimal_precision @@ -491,13 +491,13 @@ NULL NULL NULL NULL NULL NULL NULL NULL +0.0000000000 0.00000000000000000000 +0.0000000000 0.00000000000000000000 +0.0000000000 0.00000000000000000000 +0.0000000000 0.00000000000000000000 0 0 -0 0 -0 0 -0 0 -0 0 -0.123456789 0.015241578750190521 -0.123456789 0.015241578750190521 +0.1234567890 0.01524157875019052100 +0.1234567890 0.01524157875019052100 1.2345678901 1.52415787526596567801 1.2345678901 1.52415787526596567801 1.2345678901 1.52415787526596567801 @@ -521,7 +521,7 @@ NULL NULL 123456789.0123456 15241578753238817.26870921383936 123456789.0123456789 15241578753238836.75019051998750190521 1234567890.123456 NULL -1234567890.123456789 NULL +1234567890.1234567890 NULL PREHOOK: query: EXPLAIN SELECT avg(dec), sum(dec) FROM DECIMAL_PRECISION PREHOOK: type: QUERY POSTHOOK: query: EXPLAIN SELECT avg(dec), sum(dec) FROM DECIMAL_PRECISION diff --git ql/src/test/results/clientpositive/decimal_trailing.q.out ql/src/test/results/clientpositive/decimal_trailing.q.out new file mode 100644 index 0000000..c6991fd --- /dev/null +++ ql/src/test/results/clientpositive/decimal_trailing.q.out @@ -0,0 +1,80 @@ +PREHOOK: query: DROP TABLE IF EXISTS DECIMAL_TRAILING +PREHOOK: type: DROPTABLE +POSTHOOK: query: DROP TABLE IF EXISTS DECIMAL_TRAILING +POSTHOOK: type: DROPTABLE +PREHOOK: query: CREATE TABLE DECIMAL_TRAILING ( + id int, + a decimal(10,4), + b decimal(15,8) + ) +ROW FORMAT DELIMITED + FIELDS TERMINATED BY ',' +STORED AS TEXTFILE +PREHOOK: type: CREATETABLE +PREHOOK: Output: database:default +PREHOOK: Output: default@DECIMAL_TRAILING +POSTHOOK: query: CREATE TABLE DECIMAL_TRAILING ( + id int, + a decimal(10,4), + b decimal(15,8) + ) +ROW FORMAT DELIMITED + FIELDS TERMINATED BY ',' +STORED AS TEXTFILE +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: database:default +POSTHOOK: Output: default@DECIMAL_TRAILING +PREHOOK: query: LOAD DATA LOCAL INPATH '../../data/files/kv10.txt' INTO TABLE DECIMAL_TRAILING +PREHOOK: type: LOAD +#### A masked pattern was here #### +PREHOOK: Output: default@decimal_trailing +POSTHOOK: query: LOAD DATA LOCAL INPATH '../../data/files/kv10.txt' INTO TABLE DECIMAL_TRAILING +POSTHOOK: type: LOAD +#### A masked pattern was here #### +POSTHOOK: Output: default@decimal_trailing +PREHOOK: query: SELECT * FROM DECIMAL_TRAILING ORDER BY id +PREHOOK: type: QUERY +PREHOOK: Input: default@decimal_trailing +#### A masked pattern was here #### +POSTHOOK: query: SELECT * FROM DECIMAL_TRAILING ORDER BY id +POSTHOOK: type: QUERY +POSTHOOK: Input: default@decimal_trailing +#### A masked pattern was here #### +0 0 0 +1 0 0 +2 NULL NULL +3 1.0000 1.00000000 +4 10.0000 10.00000000 +5 100.0000 100.00000000 +6 1000.0000 1000.00000000 +7 10000.0000 10000.00000000 +8 100000.0000 100000.00000000 +9 NULL 1000000.00000000 +10 NULL NULL +11 NULL NULL +12 NULL NULL +13 NULL NULL +14 NULL NULL +15 NULL NULL +16 NULL NULL +17 NULL NULL +18 1.0000 1.00000000 +19 10.000 10.0000000 +20 100.00 100.000000 +21 1000.0 1000.00000 +22 100000 10000.0000 +23 0.0000 0.00000000 +24 0.000 0.0000000 +25 0.00 0.000000 +26 0.0 0.00000 +27 0 0.00000 +28 12313.2000 134134.31252500 +29 99999.9990 134134.31242553 +PREHOOK: query: DROP TABLE DECIMAL_TRAILING +PREHOOK: type: DROPTABLE +PREHOOK: Input: default@decimal_trailing +PREHOOK: Output: default@decimal_trailing +POSTHOOK: query: DROP TABLE DECIMAL_TRAILING +POSTHOOK: type: DROPTABLE +POSTHOOK: Input: default@decimal_trailing +POSTHOOK: Output: default@decimal_trailing diff --git ql/src/test/results/clientpositive/decimal_udf.q.out ql/src/test/results/clientpositive/decimal_udf.q.out index 1d5fee9..c5c2031 100644 --- ql/src/test/results/clientpositive/decimal_udf.q.out +++ ql/src/test/results/clientpositive/decimal_udf.q.out @@ -57,7 +57,7 @@ POSTHOOK: Input: default@decimal_udf #### A masked pattern was here #### -8800 NULL -0 +0.0000000000 0 200 20 @@ -76,7 +76,7 @@ NULL -0.6 -0.66 -0.666 -2 +2.0 4 6.28 -2.24 @@ -84,15 +84,15 @@ NULL -2.244 2.24 2.244 -248 +248.00 250.4 -2510.98 6.28 6.28 -6.28 -2 --2469135780.246913578 -2469135780.24691356 +6.280 +2.0000000000 +-2469135780.2469135780 +2469135780.2469135600 PREHOOK: query: EXPLAIN SELECT key + value FROM DECIMAL_UDF PREHOOK: type: QUERY POSTHOOK: query: EXPLAIN SELECT key + value FROM DECIMAL_UDF @@ -124,7 +124,7 @@ POSTHOOK: Input: default@decimal_udf #### A masked pattern was here #### 0 NULL -0 +0.0000000000 0 200 20 @@ -143,7 +143,7 @@ NULL -0.3 -0.33 -0.333 -2 +2.0 4 6.14 -2.12 @@ -151,15 +151,15 @@ NULL -12.122 2.12 2.122 -248 +248.00 250.2 -2510.49 6.14 6.14 -7.14 -2 --2469135780.123456789 -2469135780.12345678 +7.140 +2.0000000000 +-2469135780.1234567890 +2469135780.1234567800 PREHOOK: query: EXPLAIN SELECT key + (value/2) FROM DECIMAL_UDF PREHOOK: type: QUERY POSTHOOK: query: EXPLAIN SELECT key + (value/2) FROM DECIMAL_UDF @@ -327,42 +327,42 @@ POSTHOOK: Input: default@decimal_udf #### A masked pattern was here #### 0 NULL +0.0000000000 0 0 0 0 +0.0 +0.00 0 0 0 0 +0.0 +0.00 +0.0 +0.00 +0.000 +0.0 +0.00 +0.000 +0.0 0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 +0.00 +0.00 +0.00 +0.000 +0.00 +0.000 +0.00 +0.0 +0.00 +0.00 +0.00 +0.000 +0.0000000000 +0.0000000000 +0.0000000000 PREHOOK: query: EXPLAIN SELECT key - value FROM DECIMAL_UDF PREHOOK: type: QUERY POSTHOOK: query: EXPLAIN SELECT key - value FROM DECIMAL_UDF @@ -394,7 +394,7 @@ POSTHOOK: Input: default@decimal_udf #### A masked pattern was here #### -8800 NULL -0 +0.0000000000 0 0 0 @@ -413,7 +413,7 @@ NULL -0.3 -0.33 -0.333 -0 +0.0 0 0.14 -0.12 @@ -421,15 +421,15 @@ NULL 9.878 0.12 0.122 -0 +0.00 0.2 -0.49 0.14 0.14 --0.86 -0 --0.123456789 -0.12345678 +-0.860 +0.0000000000 +-0.1234567890 +0.1234567800 PREHOOK: query: EXPLAIN SELECT key - (value/2) FROM DECIMAL_UDF PREHOOK: type: QUERY POSTHOOK: query: EXPLAIN SELECT key - (value/2) FROM DECIMAL_UDF @@ -597,7 +597,7 @@ POSTHOOK: Input: default@decimal_udf #### A masked pattern was here #### 19360000 NULL -0 +0.00000000000000000000 0 10000 100 @@ -616,7 +616,7 @@ NULL 0.09 0.1089 0.110889 -1 +1.00 4 9.8596 1.2544 @@ -624,13 +624,13 @@ NULL 1.258884 1.2544 1.258884 -15376 +15376.0000 15675.04 1576255.1401 9.8596 9.8596 -9.8596 -1 +9.859600 +1.00000000000000000000 NULL NULL PREHOOK: query: EXPLAIN SELECT key * value FROM DECIMAL_UDF @@ -664,26 +664,26 @@ POSTHOOK: Input: default@decimal_udf #### A masked pattern was here #### -19360000 NULL -0 +0.0000000000 0 10000 100 1 -0 -0 +0.0 +0.00 40000 400 4 0 -0 -0 -0 -0 -0 -0 -0 -0 -1 +0.0 +0.00 +0.0 +0.00 +0.000 +0.0 +0.00 +0.000 +1.0 4 9.42 1.12 @@ -691,15 +691,15 @@ NULL 12.342 1.12 1.122 -15376 -15650 +15376.00 +15650.0 1575639.95 9.42 9.42 -12.56 -1 -1524157875171467887.50190521 -1524157875171467876.3907942 +12.560 +1.0000000000 +1524157875171467887.5019052100 +1524157875171467876.3907942000 PREHOOK: query: EXPLAIN SELECT key * (value/2) FROM DECIMAL_UDF PREHOOK: type: QUERY POSTHOOK: query: EXPLAIN SELECT key * (value/2) FROM DECIMAL_UDF @@ -1023,7 +1023,7 @@ POSTHOOK: Input: default@decimal_udf 0.785 1 1.0000000001 -1.00000000009999999271 +1.000000000099999992710 PREHOOK: query: EXPLAIN SELECT key / (value/2) FROM DECIMAL_UDF WHERE value is not null and value <> 0 PREHOOK: type: QUERY POSTHOOK: query: EXPLAIN SELECT key / (value/2) FROM DECIMAL_UDF WHERE value is not null and value <> 0 @@ -1180,7 +1180,7 @@ POSTHOOK: Input: default@decimal_udf #### A masked pattern was here #### 4400 NULL -0 +0.0000000000 0 100 10 @@ -1199,7 +1199,7 @@ NULL 0.3 0.33 0.333 -1 +1.0 2 3.14 1.12 @@ -1207,15 +1207,15 @@ NULL 1.122 1.12 1.122 -124 +124.00 125.2 1255.49 3.14 3.14 -3.14 -1 -1234567890.123456789 -1234567890.12345678 +3.140 +1.0000000000 +1234567890.1234567890 +1234567890.1234567800 PREHOOK: query: -- avg EXPLAIN SELECT value, sum(key) / count(key), avg(key), sum(key) FROM DECIMAL_UDF GROUP BY value ORDER BY value PREHOOK: type: QUERY @@ -1304,23 +1304,23 @@ POSTHOOK: query: SELECT value, sum(key) / count(key), avg(key), sum(key) FROM DE POSTHOOK: type: QUERY POSTHOOK: Input: default@decimal_udf #### A masked pattern was here #### --1234567890 -1234567890.123456789 -1234567890.123456789 -1234567890.123456789 +-1234567890 -1234567890.123456789 -1234567890.123456789 -1234567890.1234567890 -1255 -1255.49 -1255.49 -1255.49 -11 -1.122 -1.122 -1.122 -1 -1.12 -1.12 -2.24 -0 0.02538461538461538461538 0.02538461538462 0.33 -1 1.0484 1.0484 5.242 +0 0.02538461538461538461538 0.02538461538462 0.3300000000 +1 1.0484 1.0484 5.2420000000 2 2 2 4 3 3.14 3.14 9.42 -4 3.14 3.14 3.14 +4 3.14 3.14 3.140 10 10 10 10 20 20 20 20 100 100 100 100 -124 124 124 124 +124 124 124 124.00 125 125.2 125.2 125.2 200 200 200 200 4400 -4400 -4400 -4400 -1234567890 1234567890.12345678 1234567890.12345678 1234567890.12345678 +1234567890 1234567890.12345678 1234567890.12345678 1234567890.1234567800 PREHOOK: query: -- negative EXPLAIN SELECT -key FROM DECIMAL_UDF PREHOOK: type: QUERY @@ -1354,7 +1354,7 @@ POSTHOOK: Input: default@decimal_udf #### A masked pattern was here #### 4400 NULL -0 +0.0000000000 0 -100 -10 @@ -1373,7 +1373,7 @@ NULL 0.3 0.33 0.333 --1 +-1.0 -2 -3.14 1.12 @@ -1381,15 +1381,15 @@ NULL 1.122 -1.12 -1.122 --124 +-124.00 -125.2 1255.49 -3.14 -3.14 --3.14 --1 -1234567890.123456789 --1234567890.12345678 +-3.140 +-1.0000000000 +1234567890.1234567890 +-1234567890.1234567800 PREHOOK: query: -- positive EXPLAIN SELECT +key FROM DECIMAL_UDF PREHOOK: type: QUERY @@ -1423,7 +1423,7 @@ POSTHOOK: Input: default@decimal_udf #### A masked pattern was here #### -4400 NULL -0 +0.0000000000 0 100 10 @@ -1442,7 +1442,7 @@ NULL -0.3 -0.33 -0.333 -1 +1.0 2 3.14 -1.12 @@ -1450,15 +1450,15 @@ NULL -1.122 1.12 1.122 -124 +124.00 125.2 -1255.49 3.14 3.14 -3.14 -1 --1234567890.123456789 -1234567890.12345678 +3.140 +1.0000000000 +-1234567890.1234567890 +1234567890.1234567800 PREHOOK: query: -- ceiling EXPlAIN SELECT CEIL(key) FROM DECIMAL_UDF PREHOOK: type: QUERY @@ -1628,42 +1628,42 @@ POSTHOOK: query: SELECT ROUND(key, 2) FROM DECIMAL_UDF POSTHOOK: type: QUERY POSTHOOK: Input: default@decimal_udf #### A masked pattern was here #### --4400 +-4400.00 NULL -0 -0 -100 -10 -1 -0.1 +0.00 +0.00 +100.00 +10.00 +1.00 +0.10 0.01 -200 -20 -2 -0 -0.2 +200.00 +20.00 +2.00 +0.00 +0.20 0.02 -0.3 +0.30 0.33 0.33 --0.3 +-0.30 -0.33 -0.33 -1 -2 +1.00 +2.00 3.14 -1.12 -1.12 -1.12 1.12 1.12 -124 -125.2 +124.00 +125.20 -1255.49 3.14 3.14 3.14 -1 +1.00 -1234567890.12 1234567890.12 PREHOOK: query: -- power @@ -1772,38 +1772,38 @@ NULL NULL 1 1 -0 -0 -0 +0.0 +0.00 +0.000 1 1 0 NULL +0.0 +0.00 +0.10 +0.010 +0.0010 +0.10 +0.010 +0.0010 +0.0 0 -0 -0.1 -0.01 -0.001 -0.1 -0.01 -0.001 -0 -0 -1 +1.00 -0.12 -0.12 -0.122 0.44 0.439 -1 -1 +1.00 +1.0 -626.745 -1 -1 -1 -0 +1.00 +1.00 +1.000 +0.0000000000 -617283944.0617283945 -1 +1.0000000000 PREHOOK: query: -- stddev, var EXPLAIN SELECT value, stddev(key), variance(key) FROM DECIMAL_UDF GROUP BY value PREHOOK: type: QUERY @@ -2095,7 +2095,7 @@ POSTHOOK: query: SELECT MIN(key) FROM DECIMAL_UDF POSTHOOK: type: QUERY POSTHOOK: Input: default@decimal_udf #### A masked pattern was here #### --1234567890.123456789 +-1234567890.1234567890 PREHOOK: query: -- max EXPLAIN SELECT MAX(key) FROM DECIMAL_UDF PREHOOK: type: QUERY @@ -2158,7 +2158,7 @@ POSTHOOK: query: SELECT MAX(key) FROM DECIMAL_UDF POSTHOOK: type: QUERY POSTHOOK: Input: default@decimal_udf #### A masked pattern was here #### -1234567890.12345678 +1234567890.1234567800 PREHOOK: query: -- count EXPLAIN SELECT COUNT(key) FROM DECIMAL_UDF PREHOOK: type: QUERY diff --git ql/src/test/results/clientpositive/literal_decimal.q.out ql/src/test/results/clientpositive/literal_decimal.q.out index 2f2df6a..5d028b5 100644 --- ql/src/test/results/clientpositive/literal_decimal.q.out +++ ql/src/test/results/clientpositive/literal_decimal.q.out @@ -1,6 +1,6 @@ -PREHOOK: query: EXPLAIN SELECT -1BD, 0BD, 1BD, 3.14BD, -3.14BD, 99999999999999999BD, 99999999999999999.9999999999999BD, 1E-99BD, 1E99BD FROM src LIMIT 1 +PREHOOK: query: EXPLAIN SELECT -1BD, 0BD, 1BD, 3.14BD, -3.14BD, 99999999999999999BD, 99999999999999999.9999999999999BD, 1E99BD FROM src LIMIT 1 PREHOOK: type: QUERY -POSTHOOK: query: EXPLAIN SELECT -1BD, 0BD, 1BD, 3.14BD, -3.14BD, 99999999999999999BD, 99999999999999999.9999999999999BD, 1E-99BD, 1E99BD FROM src LIMIT 1 +POSTHOOK: query: EXPLAIN SELECT -1BD, 0BD, 1BD, 3.14BD, -3.14BD, 99999999999999999BD, 99999999999999999.9999999999999BD, 1E99BD FROM src LIMIT 1 POSTHOOK: type: QUERY STAGE DEPENDENCIES: Stage-0 is a root stage @@ -14,20 +14,20 @@ STAGE PLANS: alias: src Statistics: Num rows: 0 Data size: 5812 Basic stats: PARTIAL Column stats: COMPLETE Select Operator - expressions: (- 1) (type: decimal(1,0)), 0 (type: decimal(1,0)), 1 (type: decimal(1,0)), 3.14 (type: decimal(3,2)), (- 3.14) (type: decimal(3,2)), 99999999999999999 (type: decimal(17,0)), 99999999999999999.9999999999999 (type: decimal(30,13)), 1E-99 (type: decimal(1,0)), 1E99 (type: decimal(1,0)) - outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8 + expressions: (- 1) (type: decimal(1,0)), 0 (type: decimal(1,0)), 1 (type: decimal(1,0)), 3.14 (type: decimal(3,2)), (- 3.14) (type: decimal(3,2)), 99999999999999999 (type: decimal(17,0)), 99999999999999999.9999999999999 (type: decimal(30,13)), 1E99 (type: decimal(1,0)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7 Statistics: Num rows: 0 Data size: 5812 Basic stats: PARTIAL Column stats: COMPLETE Limit Number of rows: 1 Statistics: Num rows: 0 Data size: 5812 Basic stats: PARTIAL Column stats: COMPLETE ListSink -PREHOOK: query: SELECT -1BD, 0BD, 1BD, 3.14BD, -3.14BD, 99999999999999999BD, 99999999999999999.9999999999999BD, 1E-99BD, 1E99BD FROM src LIMIT 1 +PREHOOK: query: SELECT -1BD, 0BD, 1BD, 3.14BD, -3.14BD, 99999999999999999BD, 99999999999999999.9999999999999BD, 1E99BD FROM src LIMIT 1 PREHOOK: type: QUERY PREHOOK: Input: default@src #### A masked pattern was here #### -POSTHOOK: query: SELECT -1BD, 0BD, 1BD, 3.14BD, -3.14BD, 99999999999999999BD, 99999999999999999.9999999999999BD, 1E-99BD, 1E99BD FROM src LIMIT 1 +POSTHOOK: query: SELECT -1BD, 0BD, 1BD, 3.14BD, -3.14BD, 99999999999999999BD, 99999999999999999.9999999999999BD, 1E99BD FROM src LIMIT 1 POSTHOOK: type: QUERY POSTHOOK: Input: default@src #### A masked pattern was here #### --1 0 1 3.14 -3.14 99999999999999999 99999999999999999.9999999999999 0 NULL +-1 0 1 3.14 -3.14 99999999999999999 99999999999999999.9999999999999 NULL diff --git ql/src/test/results/clientpositive/orc_predicate_pushdown.q.out ql/src/test/results/clientpositive/orc_predicate_pushdown.q.out index f25b442..bc8d242 100644 --- ql/src/test/results/clientpositive/orc_predicate_pushdown.q.out +++ ql/src/test/results/clientpositive/orc_predicate_pushdown.q.out @@ -259,7 +259,7 @@ POSTHOOK: query: SELECT * FROM orc_pred WHERE t>2 limit 1 POSTHOOK: type: QUERY POSTHOOK: Input: default@orc_pred #### A masked pattern was here #### -124 336 65664 4294967435 74.72 42.47 true bob davidson 2013-03-01 09:11:58.703302 45.4 yard duty +124 336 65664 4294967435 74.72 42.47 true bob davidson 2013-03-01 09:11:58.703302 45.40 yard duty PREHOOK: query: SELECT * FROM orc_pred WHERE t>2 limit 1 PREHOOK: type: QUERY PREHOOK: Input: default@orc_pred @@ -268,7 +268,7 @@ POSTHOOK: query: SELECT * FROM orc_pred WHERE t>2 limit 1 POSTHOOK: type: QUERY POSTHOOK: Input: default@orc_pred #### A masked pattern was here #### -124 336 65664 4294967435 74.72 42.47 true bob davidson 2013-03-01 09:11:58.703302 45.4 yard duty +124 336 65664 4294967435 74.72 42.47 true bob davidson 2013-03-01 09:11:58.703302 45.40 yard duty PREHOOK: query: SELECT SUM(HASH(t)) FROM orc_pred WHERE t IS NOT NULL AND t < 0 diff --git ql/src/test/results/clientpositive/parquet_decimal.q.out ql/src/test/results/clientpositive/parquet_decimal.q.out index cd87b92..5767c57 100644 --- ql/src/test/results/clientpositive/parquet_decimal.q.out +++ ql/src/test/results/clientpositive/parquet_decimal.q.out @@ -63,9 +63,9 @@ Mary 4.33 Cluck 5.96 Tom -12.25 Mary 33.33 -Tom 19 -Beck 0 -Beck 79.9 +Tom 19.00 +Beck 0.00 +Beck 79.90 PREHOOK: query: TRUNCATE TABLE parq_dec PREHOOK: type: TRUNCATETABLE PREHOOK: Output: default@parq_dec @@ -140,12 +140,12 @@ POSTHOOK: Input: default@parq_dec1 77.3 55.7 4.3 -6 +6.0 12.3 33.3 0.2 3.2 -8 +8.0 PREHOOK: query: DROP TABLE dec PREHOOK: type: DROPTABLE PREHOOK: Input: default@dec diff --git ql/src/test/results/clientpositive/parquet_decimal1.q.out ql/src/test/results/clientpositive/parquet_decimal1.q.out index bd146f8..0f71b1e 100644 --- ql/src/test/results/clientpositive/parquet_decimal1.q.out +++ ql/src/test/results/clientpositive/parquet_decimal1.q.out @@ -28,7 +28,7 @@ POSTHOOK: query: SELECT * FROM dec_comp POSTHOOK: type: QUERY POSTHOOK: Input: default@dec_comp #### A masked pattern was here #### -[3.14,6.28,7.3] {"k1":92.77,"k2":29.39} {"i":5,"d":9.03} +[3.14,6.28,7.30] {"k1":92.77,"k2":29.39} {"i":5,"d":9.03} [12.4,1.33,0.34] {"k2":2.79,"k4":29.09} {"i":11,"d":0.03} PREHOOK: query: DROP TABLE IF EXISTS parq_dec_comp PREHOOK: type: DROPTABLE @@ -72,8 +72,8 @@ POSTHOOK: query: SELECT * FROM parq_dec_comp POSTHOOK: type: QUERY POSTHOOK: Input: default@parq_dec_comp #### A masked pattern was here #### -[3.14,6.28,7.3] {"k2":29.39,"k1":92.77} {"i":5,"d":9.03} -[12.4,1.33,0.34] {"k4":29.09,"k2":2.79} {"i":11,"d":0.03} +[3.14,6.28,7.30] {"k2":29.39,"k1":92.77} {"i":5,"d":9.03} +[12.40,1.33,0.34] {"k4":29.09,"k2":2.79} {"i":11,"d":0.03} PREHOOK: query: DROP TABLE dec_comp PREHOOK: type: DROPTABLE PREHOOK: Input: default@dec_comp diff --git ql/src/test/results/clientpositive/serde_regex.q.out ql/src/test/results/clientpositive/serde_regex.q.out index 65e7dec..60182b7 100644 --- ql/src/test/results/clientpositive/serde_regex.q.out +++ ql/src/test/results/clientpositive/serde_regex.q.out @@ -201,7 +201,7 @@ POSTHOOK: type: QUERY POSTHOOK: Input: default@serde_regex1 #### A masked pattern was here #### NULL 0 --1234567890.123456789 -1234567890 +-1234567890.1234567890 -1234567890 -4400 4400 -1255.49 -1255 -1.122 -11 @@ -210,7 +210,7 @@ NULL 0 -0.333 0 -0.33 0 -0.3 0 -0 0 +0.000000000000000000 0 0 0 0 0 0.01 0 @@ -221,8 +221,8 @@ NULL 0 0.33 0 0.333 0 1 1 -1 1 -1 1 +1.0 1 +1.000000000000000000 1 1.12 1 1.122 1 2 2 @@ -230,14 +230,14 @@ NULL 0 3.14 3 3.14 3 3.14 3 -3.14 4 +3.140 4 10 10 20 20 100 100 -124 124 +124.00 124 125.2 125 200 200 -1234567890.12345678 1234567890 +1234567890.1234567800 1234567890 PREHOOK: query: DROP TABLE serde_regex1 PREHOOK: type: DROPTABLE PREHOOK: Input: default@serde_regex1 diff --git ql/src/test/results/clientpositive/tez/mapjoin_decimal.q.out ql/src/test/results/clientpositive/tez/mapjoin_decimal.q.out index 07529b8..173b643 100644 --- ql/src/test/results/clientpositive/tez/mapjoin_decimal.q.out +++ ql/src/test/results/clientpositive/tez/mapjoin_decimal.q.out @@ -149,112 +149,112 @@ POSTHOOK: type: QUERY POSTHOOK: Input: default@t1 POSTHOOK: Input: default@t2 #### A masked pattern was here #### -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -45 45 -45 45 -45 45 -45 45 -45 45 -79 79 -79 79 -79 79 -79 79 -79 79 -79 79 -17 17 -17 17 -17 17 -17 17 -17 17 -17 17 -17 17 -17 17 -17 17 -17 17 -6 6 -6 6 -6 6 -6 6 -6 6 -6 6 -62 62 -62 62 -62 62 -62 62 -62 62 -62 62 -62 62 -62 62 -62 62 -62 62 -62 62 -62 62 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -89 89 -89 89 -89 89 -89 89 -89 89 -89 89 -89 89 -89 89 -89 89 -89 89 -89 89 -89 89 -70 70 -70 70 -70 70 -70 70 -70 70 -70 70 -70 70 -14 14 -14 14 -14 14 -14 14 -14 14 -14 14 -14 14 -14 14 -14 14 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +45.00 45 +45.00 45 +45.00 45 +45.00 45 +45.00 45 +79.00 79 +79.00 79 +79.00 79 +79.00 79 +79.00 79 +79.00 79 +17.00 17 +17.00 17 +17.00 17 +17.00 17 +17.00 17 +17.00 17 +17.00 17 +17.00 17 +17.00 17 +17.00 17 +6.00 6 +6.00 6 +6.00 6 +6.00 6 +6.00 6 +6.00 6 +62.00 62 +62.00 62 +62.00 62 +62.00 62 +62.00 62 +62.00 62 +62.00 62 +62.00 62 +62.00 62 +62.00 62 +62.00 62 +62.00 62 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +89.00 89 +89.00 89 +89.00 89 +89.00 89 +89.00 89 +89.00 89 +89.00 89 +89.00 89 +89.00 89 +89.00 89 +89.00 89 +89.00 89 +70.00 70 +70.00 70 +70.00 70 +70.00 70 +70.00 70 +70.00 70 +70.00 70 +14.00 14 +14.00 14 +14.00 14 +14.00 14 +14.00 14 +14.00 14 +14.00 14 +14.00 14 +14.00 14 PREHOOK: query: select t1.dec, t2.dec from t1 join t2 on (t1.dec=t2.dec) PREHOOK: type: QUERY PREHOOK: Input: default@t1 @@ -265,112 +265,112 @@ POSTHOOK: type: QUERY POSTHOOK: Input: default@t1 POSTHOOK: Input: default@t2 #### A masked pattern was here #### -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -45 45 -45 45 -45 45 -45 45 -45 45 -79 79 -79 79 -79 79 -79 79 -79 79 -79 79 -17 17 -17 17 -17 17 -17 17 -17 17 -17 17 -17 17 -17 17 -17 17 -17 17 -6 6 -6 6 -6 6 -6 6 -6 6 -6 6 -62 62 -62 62 -62 62 -62 62 -62 62 -62 62 -62 62 -62 62 -62 62 -62 62 -62 62 -62 62 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -89 89 -89 89 -89 89 -89 89 -89 89 -89 89 -89 89 -89 89 -89 89 -89 89 -89 89 -89 89 -70 70 -70 70 -70 70 -70 70 -70 70 -70 70 -70 70 -14 14 -14 14 -14 14 -14 14 -14 14 -14 14 -14 14 -14 14 -14 14 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +45.00 45 +45.00 45 +45.00 45 +45.00 45 +45.00 45 +79.00 79 +79.00 79 +79.00 79 +79.00 79 +79.00 79 +79.00 79 +17.00 17 +17.00 17 +17.00 17 +17.00 17 +17.00 17 +17.00 17 +17.00 17 +17.00 17 +17.00 17 +17.00 17 +6.00 6 +6.00 6 +6.00 6 +6.00 6 +6.00 6 +6.00 6 +62.00 62 +62.00 62 +62.00 62 +62.00 62 +62.00 62 +62.00 62 +62.00 62 +62.00 62 +62.00 62 +62.00 62 +62.00 62 +62.00 62 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +89.00 89 +89.00 89 +89.00 89 +89.00 89 +89.00 89 +89.00 89 +89.00 89 +89.00 89 +89.00 89 +89.00 89 +89.00 89 +89.00 89 +70.00 70 +70.00 70 +70.00 70 +70.00 70 +70.00 70 +70.00 70 +70.00 70 +14.00 14 +14.00 14 +14.00 14 +14.00 14 +14.00 14 +14.00 14 +14.00 14 +14.00 14 +14.00 14 PREHOOK: query: select t1.dec, t2.dec from t1 join t2 on (t1.dec=t2.dec) PREHOOK: type: QUERY PREHOOK: Input: default@t1 @@ -381,109 +381,109 @@ POSTHOOK: type: QUERY POSTHOOK: Input: default@t1 POSTHOOK: Input: default@t2 #### A masked pattern was here #### -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -9 9 -45 45 -45 45 -45 45 -45 45 -45 45 -79 79 -79 79 -79 79 -79 79 -79 79 -79 79 -17 17 -17 17 -17 17 -17 17 -17 17 -17 17 -17 17 -17 17 -17 17 -17 17 -6 6 -6 6 -6 6 -6 6 -6 6 -6 6 -62 62 -62 62 -62 62 -62 62 -62 62 -62 62 -62 62 -62 62 -62 62 -62 62 -62 62 -62 62 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -64 64 -89 89 -89 89 -89 89 -89 89 -89 89 -89 89 -89 89 -89 89 -89 89 -89 89 -89 89 -89 89 -70 70 -70 70 -70 70 -70 70 -70 70 -70 70 -70 70 -14 14 -14 14 -14 14 -14 14 -14 14 -14 14 -14 14 -14 14 -14 14 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +9.00 9 +45.00 45 +45.00 45 +45.00 45 +45.00 45 +45.00 45 +79.00 79 +79.00 79 +79.00 79 +79.00 79 +79.00 79 +79.00 79 +17.00 17 +17.00 17 +17.00 17 +17.00 17 +17.00 17 +17.00 17 +17.00 17 +17.00 17 +17.00 17 +17.00 17 +6.00 6 +6.00 6 +6.00 6 +6.00 6 +6.00 6 +6.00 6 +62.00 62 +62.00 62 +62.00 62 +62.00 62 +62.00 62 +62.00 62 +62.00 62 +62.00 62 +62.00 62 +62.00 62 +62.00 62 +62.00 62 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +64.00 64 +89.00 89 +89.00 89 +89.00 89 +89.00 89 +89.00 89 +89.00 89 +89.00 89 +89.00 89 +89.00 89 +89.00 89 +89.00 89 +89.00 89 +70.00 70 +70.00 70 +70.00 70 +70.00 70 +70.00 70 +70.00 70 +70.00 70 +14.00 14 +14.00 14 +14.00 14 +14.00 14 +14.00 14 +14.00 14 +14.00 14 +14.00 14 +14.00 14 diff --git ql/src/test/results/clientpositive/tez/vector_data_types.q.out ql/src/test/results/clientpositive/tez/vector_data_types.q.out index f577e13..a3bf59d 100644 --- ql/src/test/results/clientpositive/tez/vector_data_types.q.out +++ ql/src/test/results/clientpositive/tez/vector_data_types.q.out @@ -157,7 +157,7 @@ POSTHOOK: query: SELECT t, si, i, b, f, d, bo, s, ts, dec, bin FROM over1korc OR POSTHOOK: type: QUERY POSTHOOK: Input: default@over1korc #### A masked pattern was here #### -108 301 65536 4294967357 90.05 17.59 true ethan johnson 2013-03-01 09:11:58.703271 75.7 undecided +108 301 65536 4294967357 90.05 17.59 true ethan johnson 2013-03-01 09:11:58.703271 75.70 undecided 118 497 65536 4294967381 50.32 12.72 false david nixon 2013-03-01 09:11:58.703285 83.48 values clariffication 18 280 65536 4294967320 32.92 45.94 false holly white 2013-03-01 09:11:58.703086 58.86 topology 69 489 65536 4294967404 33.52 17.99 false oscar ichabod 2013-03-01 09:11:58.703247 32.68 topology @@ -239,7 +239,7 @@ POSTHOOK: query: SELECT t, si, i, b, f, d, bo, s, ts, dec, bin FROM over1korc OR POSTHOOK: type: QUERY POSTHOOK: Input: default@over1korc #### A masked pattern was here #### -108 301 65536 4294967357 90.05 17.59 true ethan johnson 1860-11-12 20:05:55.011470936 75.7 undecided +108 301 65536 4294967357 90.05 17.59 true ethan johnson 1860-11-12 20:05:55.011470936 75.70 undecided 118 497 65536 4294967381 50.32 12.72 false david nixon 1860-11-12 20:05:55.011484936 83.48 values clariffication 18 280 65536 4294967320 32.92 45.94 false holly white 1860-11-12 20:05:55.011285936 58.86 topologyariffication 69 489 65536 4294967404 33.52 17.99 false oscar ichabod 1860-11-12 20:05:55.011446936 32.68 topologyariffication diff --git ql/src/test/results/clientpositive/tez/vector_decimal_aggregate.q.out ql/src/test/results/clientpositive/tez/vector_decimal_aggregate.q.out index 437e830..d6b80b3 100644 --- ql/src/test/results/clientpositive/tez/vector_decimal_aggregate.q.out +++ ql/src/test/results/clientpositive/tez/vector_decimal_aggregate.q.out @@ -107,11 +107,11 @@ POSTHOOK: query: SELECT cint, POSTHOOK: type: QUERY POSTHOOK: Input: default@decimal_vgby #### A masked pattern was here #### -NULL 3072 9318.4351351351 -4298.1513513514 5018444.1081079808 1633.60810810806667 5695.483082135364 5696.4103077145055 3072 11160.715384615385 -5147.907692307693 6010604.3076923073536 1956.576923076922966667 6821.495748565159 6822.606289190924 --3728 6 5831542.269248378 -3367.6517567568 5817556.0411483778 969592.67352472963333 2174330.2092403853 2381859.406131774 6 6984454.211097692 -4033.445769230769 6967702.8672438458471 1161283.811207307641183333 2604201.2704476737 2852759.5602156054 --563 2 -515.621072973 -3367.6517567568 -3883.2728297298 -1941.6364148649 1426.0153418918999 2016.6902366556308 2 -617.5607769230769 -4033.445769230769 -4651.0065461538459 -2325.50327307692295 1707.9424961538462 2415.395441814127 -762 2 5831542.269248378 1531.2194054054 5833073.4886537834 2916536.7443268917 2915005.5249214866 4122440.3477364695 2 6984454.211097692 1833.9456923076925 6986288.1567899996925 3493144.07839499984625 3491310.1327026924 4937458.140118758 -6981 3 5831542.269248378 -515.621072973 5830511.027102432 1943503.67570081066667 2749258.455012492 3367140.1929065133 3 6984454.211097692 -617.5607769230769 6983219.0895438458462 2327739.696514615282066667 3292794.4113115156 4032833.0678006653 -253665376 1024 9767.0054054054 -9779.5486486487 -347484.0818378374 -339.33992366976309 5708.9563478862 5711.745967572779 1024 11697.969230769231 -11712.99230769231 -416182.64030769233089 -406.428359675480791885 6837.632716002934 6840.973851172274 -528534767 1024 5831542.269248378 -9777.1594594595 11646372.8607481068 11373.41099682432305 257528.92988206653 257654.7686043977 1024 6984454.211097692 -11710.130769230771 13948892.79980307629003 13621.965624807691689482 308443.1074570801 308593.82484083984 -626923679 1024 9723.4027027027 -9778.9513513514 10541.0525297287 10.29399661106318 5742.09145323734 5744.897264034267 1024 11645.746153846154 -11712.276923076923 12625.04759999997746 12.329148046874977988 6877.318722794877 6880.679250101603 +NULL 3072 9318.4351351351 -4298.1513513514 5018444.1081079808 1633.60810810806667 5695.483082135364 5696.4103077145055 3072 11160.71538461538500 -5147.90769230769300 6010604.30769230735360 1956.576923076922966667 6821.495748565159 6822.606289190924 +-3728 6 5831542.2692483780 -3367.6517567568 5817556.0411483778 969592.67352472963333 2174330.2092403853 2381859.406131774 6 6984454.21109769200000 -4033.445769230769 6967702.86724384584710 1161283.811207307641183333 2604201.2704476737 2852759.5602156054 +-563 2 -515.6210729730 -3367.6517567568 -3883.2728297298 -1941.6364148649 1426.0153418918999 2016.6902366556308 2 -617.56077692307690 -4033.445769230769 -4651.00654615384590 -2325.50327307692295 1707.9424961538462 2415.395441814127 +762 2 5831542.2692483780 1531.2194054054 5833073.4886537834 2916536.7443268917 2915005.5249214866 4122440.3477364695 2 6984454.21109769200000 1833.9456923076925 6986288.15678999969250 3493144.07839499984625 3491310.1327026924 4937458.140118758 +6981 3 5831542.269248378 -515.6210729730 5830511.0271024320 1943503.67570081066667 2749258.455012492 3367140.1929065133 3 6984454.211097692 -617.56077692307690 6983219.08954384584620 2327739.696514615282066667 3292794.4113115156 4032833.0678006653 +253665376 1024 9767.0054054054 -9779.5486486487 -347484.0818378374 -339.33992366976309 5708.9563478862 5711.745967572779 1024 11697.96923076923100 -11712.99230769231000 -416182.64030769233089 -406.428359675480791885 6837.632716002934 6840.973851172274 +528534767 1024 5831542.2692483780 -9777.1594594595 11646372.8607481068 11373.41099682432305 257528.92988206653 257654.7686043977 1024 6984454.21109769200000 -11710.13076923077100 13948892.79980307629003 13621.965624807691689482 308443.1074570801 308593.82484083984 +626923679 1024 9723.4027027027 -9778.9513513514 10541.0525297287 10.29399661106318 5742.09145323734 5744.897264034267 1024 11645.74615384615400 -11712.27692307692300 12625.04759999997746 12.329148046874977988 6877.318722794877 6880.679250101603 diff --git ql/src/test/results/clientpositive/udf_case.q.out ql/src/test/results/clientpositive/udf_case.q.out index 6c186bd..baf431c 100644 --- ql/src/test/results/clientpositive/udf_case.q.out +++ ql/src/test/results/clientpositive/udf_case.q.out @@ -196,4 +196,4 @@ FROM src tablesample (1 rows) POSTHOOK: type: QUERY POSTHOOK: Input: default@src #### A masked pattern was here #### -123 123.0 abcd +123.0 123.0 abcd diff --git ql/src/test/results/clientpositive/udf_when.q.out ql/src/test/results/clientpositive/udf_when.q.out index cbb1210..1b57833 100644 --- ql/src/test/results/clientpositive/udf_when.q.out +++ ql/src/test/results/clientpositive/udf_when.q.out @@ -179,4 +179,4 @@ FROM src tablesample (1 rows) POSTHOOK: type: QUERY POSTHOOK: Input: default@src #### A masked pattern was here #### -123 123.0 abcd +123.0 123.0 abcd diff --git ql/src/test/results/clientpositive/vector_between_in.q.out ql/src/test/results/clientpositive/vector_between_in.q.out index bbd23d2..e7b64e2 100644 --- ql/src/test/results/clientpositive/vector_between_in.q.out +++ ql/src/test/results/clientpositive/vector_between_in.q.out @@ -640,34 +640,34 @@ POSTHOOK: Input: default@decimal_date_test -18.5162162162 -17.3216216216 -16.7243243243 --16.127027027 +-16.1270270270 -15.5297297297 -10.7513513514 -9.5567567568 -8.3621621622 --5.972972973 +-5.9729729730 -3.5837837838 4.1810810811 4.7783783784 4.7783783784 5.3756756757 -5.972972973 -5.972972973 +5.9729729730 +5.9729729730 11.3486486486 11.3486486486 11.9459459459 14.9324324324 19.1135135135 20.3081081081 -22.1 +22.1000000000 24.4891891892 33.4486486486 34.6432432432 40.0189189189 42.4081081081 43.0054054054 -44.2 -44.2 +44.2000000000 +44.2000000000 44.7972972973 45.9918918919 PREHOOK: query: SELECT COUNT(*) FROM decimal_date_test WHERE cdecimal1 NOT BETWEEN -2000 AND 4390.1351351351 diff --git ql/src/test/results/clientpositive/vector_data_types.q.out ql/src/test/results/clientpositive/vector_data_types.q.out index a1183ad..6b0598c 100644 --- ql/src/test/results/clientpositive/vector_data_types.q.out +++ ql/src/test/results/clientpositive/vector_data_types.q.out @@ -151,7 +151,7 @@ POSTHOOK: query: SELECT t, si, i, b, f, d, bo, s, ts, dec, bin FROM over1korc OR POSTHOOK: type: QUERY POSTHOOK: Input: default@over1korc #### A masked pattern was here #### -108 301 65536 4294967357 90.05 17.59 true ethan johnson 2013-03-01 09:11:58.703271 75.7 undecided +108 301 65536 4294967357 90.05 17.59 true ethan johnson 2013-03-01 09:11:58.703271 75.70 undecided 118 497 65536 4294967381 50.32 12.72 false david nixon 2013-03-01 09:11:58.703285 83.48 values clariffication 18 280 65536 4294967320 32.92 45.94 false holly white 2013-03-01 09:11:58.703086 58.86 topology 69 489 65536 4294967404 33.52 17.99 false oscar ichabod 2013-03-01 09:11:58.703247 32.68 topology @@ -226,7 +226,7 @@ POSTHOOK: query: SELECT t, si, i, b, f, d, bo, s, ts, dec, bin FROM over1korc OR POSTHOOK: type: QUERY POSTHOOK: Input: default@over1korc #### A masked pattern was here #### -108 301 65536 4294967357 90.05 17.59 true ethan johnson 1860-11-12 20:05:55.011470936 75.7 undecided +108 301 65536 4294967357 90.05 17.59 true ethan johnson 1860-11-12 20:05:55.011470936 75.70 undecided 118 497 65536 4294967381 50.32 12.72 false david nixon 1860-11-12 20:05:55.011484936 83.48 values clariffication 18 280 65536 4294967320 32.92 45.94 false holly white 1860-11-12 20:05:55.011285936 58.86 topology 69 489 65536 4294967404 33.52 17.99 false oscar ichabod 1860-11-12 20:05:55.011446936 32.68 topology diff --git ql/src/test/results/clientpositive/vector_decimal_aggregate.q.out ql/src/test/results/clientpositive/vector_decimal_aggregate.q.out index 2c4d552..874836d 100644 --- ql/src/test/results/clientpositive/vector_decimal_aggregate.q.out +++ ql/src/test/results/clientpositive/vector_decimal_aggregate.q.out @@ -101,11 +101,11 @@ POSTHOOK: query: SELECT cint, POSTHOOK: type: QUERY POSTHOOK: Input: default@decimal_vgby #### A masked pattern was here #### -NULL 3072 9318.4351351351 -4298.1513513514 5018444.1081079808 1633.60810810806667 5695.483082135364 5696.4103077145055 3072 11160.715384615385 -5147.907692307693 6010604.3076923073536 1956.576923076922966667 6821.495748565159 6822.606289190924 --3728 6 5831542.269248378 -3367.6517567568 5817556.0411483778 969592.67352472963333 2174330.2092403853 2381859.406131774 6 6984454.211097692 -4033.445769230769 6967702.8672438458471 1161283.811207307641183333 2604201.2704476737 2852759.5602156054 --563 2 -515.621072973 -3367.6517567568 -3883.2728297298 -1941.6364148649 1426.0153418918999 2016.6902366556308 2 -617.5607769230769 -4033.445769230769 -4651.0065461538459 -2325.50327307692295 1707.9424961538462 2415.395441814127 -762 2 5831542.269248378 1531.2194054054 5833073.4886537834 2916536.7443268917 2915005.5249214866 4122440.3477364695 2 6984454.211097692 1833.9456923076925 6986288.1567899996925 3493144.07839499984625 3491310.1327026924 4937458.140118758 -6981 3 5831542.269248378 -515.621072973 5830511.027102432 1943503.67570081066667 2749258.455012492 3367140.1929065133 3 6984454.211097692 -617.5607769230769 6983219.0895438458462 2327739.696514615282066667 3292794.4113115156 4032833.0678006653 -253665376 1024 9767.0054054054 -9779.5486486487 -347484.0818378374 -339.33992366976309 5708.9563478862 5711.745967572779 1024 11697.969230769231 -11712.99230769231 -416182.64030769233089 -406.428359675480791885 6837.632716002934 6840.973851172274 -528534767 1024 5831542.269248378 -9777.1594594595 11646372.8607481068 11373.41099682432305 257528.92988206653 257654.7686043977 1024 6984454.211097692 -11710.130769230771 13948892.79980307629003 13621.965624807691689482 308443.1074570801 308593.82484083984 -626923679 1024 9723.4027027027 -9778.9513513514 10541.0525297287 10.29399661106318 5742.09145323734 5744.897264034267 1024 11645.746153846154 -11712.276923076923 12625.04759999997746 12.329148046874977988 6877.318722794877 6880.679250101603 +NULL 3072 9318.4351351351 -4298.1513513514 5018444.1081079808 1633.60810810806667 5695.483082135364 5696.4103077145055 3072 11160.71538461538500 -5147.90769230769300 6010604.30769230735360 1956.576923076922966667 6821.495748565159 6822.606289190924 +-3728 6 5831542.2692483780 -3367.6517567568 5817556.0411483778 969592.67352472963333 2174330.2092403853 2381859.406131774 6 6984454.21109769200000 -4033.445769230769 6967702.86724384584710 1161283.811207307641183333 2604201.2704476737 2852759.5602156054 +-563 2 -515.6210729730 -3367.6517567568 -3883.2728297298 -1941.6364148649 1426.0153418918999 2016.6902366556308 2 -617.56077692307690 -4033.445769230769 -4651.00654615384590 -2325.50327307692295 1707.9424961538462 2415.395441814127 +762 2 5831542.2692483780 1531.2194054054 5833073.4886537834 2916536.7443268917 2915005.5249214866 4122440.3477364695 2 6984454.21109769200000 1833.9456923076925 6986288.15678999969250 3493144.07839499984625 3491310.1327026924 4937458.140118758 +6981 3 5831542.269248378 -515.6210729730 5830511.0271024320 1943503.67570081066667 2749258.455012492 3367140.1929065133 3 6984454.211097692 -617.56077692307690 6983219.08954384584620 2327739.696514615282066667 3292794.4113115156 4032833.0678006653 +253665376 1024 9767.0054054054 -9779.5486486487 -347484.0818378374 -339.33992366976309 5708.9563478862 5711.745967572779 1024 11697.96923076923100 -11712.99230769231000 -416182.64030769233089 -406.428359675480791885 6837.632716002934 6840.973851172274 +528534767 1024 5831542.2692483780 -9777.1594594595 11646372.8607481068 11373.41099682432305 257528.92988206653 257654.7686043977 1024 6984454.21109769200000 -11710.13076923077100 13948892.79980307629003 13621.965624807691689482 308443.1074570801 308593.82484083984 +626923679 1024 9723.4027027027 -9778.9513513514 10541.0525297287 10.29399661106318 5742.09145323734 5744.897264034267 1024 11645.74615384615400 -11712.27692307692300 12625.04759999997746 12.329148046874977988 6877.318722794877 6880.679250101603 diff --git ql/src/test/results/clientpositive/vector_decimal_cast.q.out ql/src/test/results/clientpositive/vector_decimal_cast.q.out index a508732..aa0696f 100644 --- ql/src/test/results/clientpositive/vector_decimal_cast.q.out +++ ql/src/test/results/clientpositive/vector_decimal_cast.q.out @@ -46,13 +46,13 @@ POSTHOOK: query: SELECT cdouble, cint, cboolean1, ctimestamp1, CAST(cdouble AS D POSTHOOK: type: QUERY POSTHOOK: Input: default@alltypesorc #### A masked pattern was here #### --13326.0 528534767 true 1969-12-31 15:59:46.674 -13326 528534767 1 -13 --15813.0 528534767 true 1969-12-31 15:59:55.787 -15813 528534767 1 -4 --9566.0 528534767 true 1969-12-31 15:59:44.187 -9566 528534767 1 -16 -15007.0 528534767 true 1969-12-31 15:59:50.434 15007 528534767 1 -10 -7021.0 528534767 true 1969-12-31 16:00:15.007 7021 528534767 1 15 -4963.0 528534767 true 1969-12-31 16:00:07.021 4963 528534767 1 7 --7824.0 528534767 true 1969-12-31 16:00:04.963 -7824 528534767 1 5 --15431.0 528534767 true 1969-12-31 15:59:52.176 -15431 528534767 1 -8 --15549.0 528534767 true 1969-12-31 15:59:44.569 -15549 528534767 1 -15 -5780.0 528534767 true 1969-12-31 15:59:44.451 5780 528534767 1 -16 +-13326.0 528534767 true 1969-12-31 15:59:46.674 -13326.0000000000 528534767.00000000000000 1.00 -13 +-15813.0 528534767 true 1969-12-31 15:59:55.787 -15813.0000000000 528534767.00000000000000 1.00 -4 +-9566.0 528534767 true 1969-12-31 15:59:44.187 -9566.0000000000 528534767.00000000000000 1.00 -16 +15007.0 528534767 true 1969-12-31 15:59:50.434 15007.0000000000 528534767.00000000000000 1.00 -10 +7021.0 528534767 true 1969-12-31 16:00:15.007 7021.0000000000 528534767.00000000000000 1.00 15 +4963.0 528534767 true 1969-12-31 16:00:07.021 4963.0000000000 528534767.00000000000000 1.00 7 +-7824.0 528534767 true 1969-12-31 16:00:04.963 -7824.0000000000 528534767.00000000000000 1.00 5 +-15431.0 528534767 true 1969-12-31 15:59:52.176 -15431.0000000000 528534767.00000000000000 1.00 -8 +-15549.0 528534767 true 1969-12-31 15:59:44.569 -15549.0000000000 528534767.00000000000000 1.00 -15 +5780.0 528534767 true 1969-12-31 15:59:44.451 5780.0000000000 528534767.00000000000000 1.00 -16 diff --git ql/src/test/results/clientpositive/vector_decimal_expressions.q.out ql/src/test/results/clientpositive/vector_decimal_expressions.q.out index 094eb8e..def9f8d 100644 --- ql/src/test/results/clientpositive/vector_decimal_expressions.q.out +++ ql/src/test/results/clientpositive/vector_decimal_expressions.q.out @@ -53,13 +53,13 @@ POSTHOOK: query: SELECT cdecimal1 + cdecimal2, cdecimal1 - (2*cdecimal2), ((cdec POSTHOOK: type: QUERY POSTHOOK: Input: default@decimal_test #### A masked pattern was here #### -19699.417463617423 -12507.913305613346 0.8351496686995997 2.8303425077026896E7 3.6405405405 8963 10735 -17 8963 true 10735.776923076923 8963.641 10735.776923076923 1969-12-31 18:29:23.64054054 -9216.339708939685 -5851.80644490647 0.8353975893550668 6195112.1797296945 3.6243243243 4193 5022 -98 4193 true 5022.715384615385 4193.6245 5022.715384615385 1969-12-31 17:09:53.624324324 -6514.8403326403464 -4136.5212058211928 0.8355907765708067 3095563.9418919063 4.3864864865 2964 3550 -34 2964 true 3550.4538461538464 2964.3865 3550.4538461538464 1969-12-31 16:49:24.386486486 -7587.301455301477 -4817.467775467754 0.8354976172734904 4198623.24324327 2.3783783784 3452 4134 38 3452 true 4134.923076923077 3452.3784 4134.923076923077 1969-12-31 16:57:32.378378378 -19197.972972973 -12189.527027027 0.835155361813429 2.6880848817567654E7 5.472972973 8735 10462 -34 8735 true 10462.5 8735.473 10462.5 1969-12-31 18:25:35.472972973 -17098.9945945946 -10856.8054054054 0.8351828165813104 2.132423090270272E7 0.3945945946 7780 9318 102 7780 true 9318.6 7780.3945 9318.6 1969-12-31 18:09:40.394594594 -12433.723076923077 -7894.646153846154 0.8352770361086894 1.12754688E7 7.6 5657 6776 120 5657 true 6776.123076923077 5657.6 6776.123076923077 1969-12-31 17:34:17.6 -7247.316839916862 -4601.598544698524 0.8355241651897876 3830775.6932432684 7.6783783784 3297 3949 109 3297 true 3949.638461538462 3297.6785 3949.638461538462 1969-12-31 16:54:57.678378378 -14757.1700623700465 -9369.891476091493 0.8352226654922171 1.5883214124324286E7 4.8162162162 6714 8042 106 6714 true 8042.3538461538465 6714.8164 8042.3538461538465 1969-12-31 17:51:54.816216216 -10964.832016631993 -6961.991060291086 0.8353232978714221 8768719.779729689 9.2243243243 4989 5975 87 4989 true 5975.607692307693 4989.224 5975.607692307693 1969-12-31 17:23:09.224324324 +19699.41746361742300 -12507.91330561334600 0.8351496686995997 2.8303425077026896E7 3.6405405405 8963 10735 -17 8963 true 10735.776923076923 8963.641 10735.776923076923 1969-12-31 18:29:23.64054054 +9216.33970893968500 -5851.80644490647000 0.8353975893550668 6195112.1797296945 3.6243243243 4193 5022 -98 4193 true 5022.715384615385 4193.6245 5022.715384615385 1969-12-31 17:09:53.624324324 +6514.84033264034640 -4136.52120582119280 0.8355907765708067 3095563.9418919063 4.3864864865 2964 3550 -34 2964 true 3550.4538461538464 2964.3865 3550.4538461538464 1969-12-31 16:49:24.386486486 +7587.30145530147700 -4817.46777546775400 0.8354976172734904 4198623.24324327 2.3783783784 3452 4134 38 3452 true 4134.923076923077 3452.3784 4134.923076923077 1969-12-31 16:57:32.378378378 +19197.97297297300000 -12189.52702702700000 0.835155361813429 2.6880848817567654E7 5.4729729730 8735 10462 -34 8735 true 10462.5 8735.473 10462.5 1969-12-31 18:25:35.472972973 +17098.99459459460000 -10856.80540540540000 0.8351828165813104 2.132423090270272E7 0.3945945946 7780 9318 102 7780 true 9318.6 7780.3945 9318.6 1969-12-31 18:09:40.394594594 +12433.72307692307700 -7894.64615384615400 0.8352770361086894 1.12754688E7 7.6000000000 5657 6776 120 5657 true 6776.123076923077 5657.6 6776.123076923077 1969-12-31 17:34:17.6 +7247.31683991686200 -4601.59854469852400 0.8355241651897876 3830775.6932432684 7.6783783784 3297 3949 109 3297 true 3949.638461538462 3297.6785 3949.638461538462 1969-12-31 16:54:57.678378378 +14757.17006237004650 -9369.89147609149300 0.8352226654922171 1.5883214124324286E7 4.8162162162 6714 8042 106 6714 true 8042.3538461538465 6714.8164 8042.3538461538465 1969-12-31 17:51:54.816216216 +10964.83201663199300 -6961.99106029108600 0.8353232978714221 8768719.779729689 9.2243243243 4989 5975 87 4989 true 5975.607692307693 4989.224 5975.607692307693 1969-12-31 17:23:09.224324324 diff --git ql/src/test/results/clientpositive/vector_decimal_mapjoin.q.out ql/src/test/results/clientpositive/vector_decimal_mapjoin.q.out index 3327c90..5476b8e 100644 --- ql/src/test/results/clientpositive/vector_decimal_mapjoin.q.out +++ ql/src/test/results/clientpositive/vector_decimal_mapjoin.q.out @@ -114,8 +114,8 @@ POSTHOOK: Input: default@decimal_mapjoin 6981 6981 NULL NULL 6981 6981 NULL NULL 6981 6981 NULL NULL -6981 6981 -515.621072973 NULL -6981 6981 -515.621072973 NULL +6981 6981 -515.6210729730 NULL +6981 6981 -515.6210729730 NULL 6981 6981 NULL NULL 6981 6981 NULL NULL 6981 6981 NULL NULL @@ -124,8 +124,8 @@ POSTHOOK: Input: default@decimal_mapjoin 6981 6981 NULL NULL 6981 6981 NULL NULL 6981 6981 NULL NULL -6981 6981 -515.621072973 NULL -6981 6981 -515.621072973 NULL +6981 6981 -515.6210729730 NULL +6981 6981 -515.6210729730 NULL 6981 6981 NULL NULL 6981 6981 NULL NULL 6981 6981 NULL NULL @@ -134,8 +134,8 @@ POSTHOOK: Input: default@decimal_mapjoin 6981 6981 NULL NULL 6981 6981 NULL NULL 6981 6981 NULL NULL -6981 6981 -515.621072973 NULL -6981 6981 -515.621072973 NULL +6981 6981 -515.6210729730 NULL +6981 6981 -515.6210729730 NULL 6981 6981 NULL NULL 6981 6981 NULL NULL 6981 6981 NULL NULL @@ -144,8 +144,8 @@ POSTHOOK: Input: default@decimal_mapjoin 6981 6981 NULL NULL 6981 6981 NULL NULL 6981 6981 NULL NULL -6981 6981 -515.621072973 NULL -6981 6981 -515.621072973 NULL +6981 6981 -515.6210729730 NULL +6981 6981 -515.6210729730 NULL 6981 6981 NULL 6984454.211097692 6981 6981 NULL 6984454.211097692 6981 6981 NULL 6984454.211097692 @@ -154,8 +154,8 @@ POSTHOOK: Input: default@decimal_mapjoin 6981 6981 NULL 6984454.211097692 6981 6981 NULL 6984454.211097692 6981 6981 NULL 6984454.211097692 -6981 6981 -515.621072973 6984454.211097692 -6981 6981 -515.621072973 6984454.211097692 +6981 6981 -515.6210729730 6984454.211097692 +6981 6981 -515.6210729730 6984454.211097692 6981 6981 NULL NULL 6981 6981 NULL NULL 6981 6981 NULL NULL @@ -164,8 +164,8 @@ POSTHOOK: Input: default@decimal_mapjoin 6981 6981 NULL NULL 6981 6981 NULL NULL 6981 6981 NULL NULL -6981 6981 -515.621072973 NULL -6981 6981 -515.621072973 NULL +6981 6981 -515.6210729730 NULL +6981 6981 -515.6210729730 NULL 6981 6981 NULL NULL 6981 6981 NULL NULL 6981 6981 NULL NULL @@ -174,8 +174,8 @@ POSTHOOK: Input: default@decimal_mapjoin 6981 6981 NULL NULL 6981 6981 NULL NULL 6981 6981 NULL NULL -6981 6981 -515.621072973 NULL -6981 6981 -515.621072973 NULL +6981 6981 -515.6210729730 NULL +6981 6981 -515.6210729730 NULL 6981 6981 NULL NULL 6981 6981 NULL NULL 6981 6981 NULL NULL @@ -184,8 +184,8 @@ POSTHOOK: Input: default@decimal_mapjoin 6981 6981 NULL NULL 6981 6981 NULL NULL 6981 6981 NULL NULL -6981 6981 -515.621072973 NULL -6981 6981 -515.621072973 NULL +6981 6981 -515.6210729730 NULL +6981 6981 -515.6210729730 NULL 6981 6981 NULL -617.5607769230769 6981 6981 NULL -617.5607769230769 6981 6981 NULL -617.5607769230769 @@ -194,8 +194,8 @@ POSTHOOK: Input: default@decimal_mapjoin 6981 6981 NULL -617.5607769230769 6981 6981 NULL -617.5607769230769 6981 6981 NULL -617.5607769230769 -6981 6981 -515.621072973 -617.5607769230769 -6981 6981 -515.621072973 -617.5607769230769 +6981 6981 -515.6210729730 -617.5607769230769 +6981 6981 -515.6210729730 -617.5607769230769 6981 6981 NULL -617.5607769230769 6981 6981 NULL -617.5607769230769 6981 6981 NULL -617.5607769230769 @@ -204,5 +204,5 @@ POSTHOOK: Input: default@decimal_mapjoin 6981 6981 NULL -617.5607769230769 6981 6981 NULL -617.5607769230769 6981 6981 NULL -617.5607769230769 -6981 6981 -515.621072973 -617.5607769230769 -6981 6981 -515.621072973 -617.5607769230769 +6981 6981 -515.6210729730 -617.5607769230769 +6981 6981 -515.6210729730 -617.5607769230769 diff --git ql/src/test/results/clientpositive/vector_decimal_math_funcs.q.out ql/src/test/results/clientpositive/vector_decimal_math_funcs.q.out index d60d855..2e98ceb 100644 --- ql/src/test/results/clientpositive/vector_decimal_math_funcs.q.out +++ ql/src/test/results/clientpositive/vector_decimal_math_funcs.q.out @@ -192,14 +192,14 @@ and sin(cdecimal1) >= -1.0 POSTHOOK: type: QUERY POSTHOOK: Input: default@decimal_test #### A masked pattern was here #### --119.4594594595 -119.46 -119 -120 -119 1.316485E-52 NULL NULL NULL NULL NULL NULL NULL NULL 119.4594594595 -0.07885666683797002 NaN 0.9968859644388647 NaN -1.5624254815943668 -6844.522849943508 -2.0849608902209606 -119.4594594595 119.4594594595 -1 NULL -9318.4351351351 9318.44 9318 9318 9319 Infinity 9.13974998962673 3.969342986470191 13.185871984999437 NULL 13.185871984999437 173.867220004793 173.867220004793 96.53204201266593 9318.4351351351 0.4540668481851705 NaN 0.8909676185918236 NaN 1.5706890126394983 533907.0049096602 162.63737424163023 9318.4351351351 -9318.4351351351 1 -0.9607267417229353 -9318.4351351351 9318.44 9318 9318 9319 Infinity 9.13974998962673 3.969342986470191 13.185871984999437 NULL 13.185871984999437 173.867220004793 173.867220004793 96.53204201266593 9318.4351351351 0.4540668481851705 NaN 0.8909676185918236 NaN 1.5706890126394983 533907.0049096602 162.63737424163023 9318.4351351351 -9318.4351351351 1 -0.9607267417229353 -9318.4351351351 9318.44 9318 9318 9319 Infinity 9.13974998962673 3.969342986470191 13.185871984999437 NULL 13.185871984999437 173.867220004793 173.867220004793 96.53204201266593 9318.4351351351 0.4540668481851705 NaN 0.8909676185918236 NaN 1.5706890126394983 533907.0049096602 162.63737424163023 9318.4351351351 -9318.4351351351 1 -0.9607267417229353 --4298.1513513514 -4298.15 -4298 -4299 -4298 0.0 NULL NULL NULL NULL NULL NULL NULL NULL 4298.1513513514 -0.43730633941118113 NaN 0.899312607223313 NaN -1.5705636686355597 -246265.93214088667 -75.01689283012556 -4298.1513513514 4298.1513513514 -1 NULL --4298.1513513514 -4298.15 -4298 -4299 -4298 0.0 NULL NULL NULL NULL NULL NULL NULL NULL 4298.1513513514 -0.43730633941118113 NaN 0.899312607223313 NaN -1.5705636686355597 -246265.93214088667 -75.01689283012556 -4298.1513513514 4298.1513513514 -1 NULL --4298.1513513514 -4298.15 -4298 -4299 -4298 0.0 NULL NULL NULL NULL NULL NULL NULL NULL 4298.1513513514 -0.43730633941118113 NaN 0.899312607223313 NaN -1.5705636686355597 -246265.93214088667 -75.01689283012556 -4298.1513513514 4298.1513513514 -1 NULL --4298.1513513514 -4298.15 -4298 -4299 -4298 0.0 NULL NULL NULL NULL NULL NULL NULL NULL 4298.1513513514 -0.43730633941118113 NaN 0.899312607223313 NaN -1.5705636686355597 -246265.93214088667 -75.01689283012556 -4298.1513513514 4298.1513513514 -1 NULL --4298.1513513514 -4298.15 -4298 -4299 -4298 0.0 NULL NULL NULL NULL NULL NULL NULL NULL 4298.1513513514 -0.43730633941118113 NaN 0.899312607223313 NaN -1.5705636686355597 -246265.93214088667 -75.01689283012556 -4298.1513513514 4298.1513513514 -1 NULL --4298.1513513514 -4298.15 -4298 -4299 -4298 0.0 NULL NULL NULL NULL NULL NULL NULL NULL 4298.1513513514 -0.43730633941118113 NaN 0.899312607223313 NaN -1.5705636686355597 -246265.93214088667 -75.01689283012556 -4298.1513513514 4298.1513513514 -1 NULL --4298.1513513514 -4298.15 -4298 -4299 -4298 0.0 NULL NULL NULL NULL NULL NULL NULL NULL 4298.1513513514 -0.43730633941118113 NaN 0.899312607223313 NaN -1.5705636686355597 -246265.93214088667 -75.01689283012556 -4298.1513513514 4298.1513513514 -1 NULL +-119.4594594595 -119.46 -119 -120 -119 1.316485E-52 NULL NULL NULL NULL NULL NULL NULL NULL 119.459459459500000000 -0.07885666683797002 NaN 0.9968859644388647 NaN -1.5624254815943668 -6844.522849943508 -2.0849608902209606 -119.4594594595 119.4594594595 -1 NULL +9318.4351351351 9318.44 9318 9318 9319 Infinity 9.13974998962673 3.969342986470191 13.185871984999437 NULL 13.185871984999437 173.867220004793 173.867220004793 96.53204201266593 9318.435135135100000000 0.4540668481851705 NaN 0.8909676185918236 NaN 1.5706890126394983 533907.0049096602 162.63737424163023 9318.4351351351 -9318.4351351351 1 -0.9607267417229353 +9318.4351351351 9318.44 9318 9318 9319 Infinity 9.13974998962673 3.969342986470191 13.185871984999437 NULL 13.185871984999437 173.867220004793 173.867220004793 96.53204201266593 9318.435135135100000000 0.4540668481851705 NaN 0.8909676185918236 NaN 1.5706890126394983 533907.0049096602 162.63737424163023 9318.4351351351 -9318.4351351351 1 -0.9607267417229353 +9318.4351351351 9318.44 9318 9318 9319 Infinity 9.13974998962673 3.969342986470191 13.185871984999437 NULL 13.185871984999437 173.867220004793 173.867220004793 96.53204201266593 9318.435135135100000000 0.4540668481851705 NaN 0.8909676185918236 NaN 1.5706890126394983 533907.0049096602 162.63737424163023 9318.4351351351 -9318.4351351351 1 -0.9607267417229353 +-4298.1513513514 -4298.15 -4298 -4299 -4298 0.0 NULL NULL NULL NULL NULL NULL NULL NULL 4298.151351351400000000 -0.43730633941118113 NaN 0.899312607223313 NaN -1.5705636686355597 -246265.93214088667 -75.01689283012556 -4298.1513513514 4298.1513513514 -1 NULL +-4298.1513513514 -4298.15 -4298 -4299 -4298 0.0 NULL NULL NULL NULL NULL NULL NULL NULL 4298.151351351400000000 -0.43730633941118113 NaN 0.899312607223313 NaN -1.5705636686355597 -246265.93214088667 -75.01689283012556 -4298.1513513514 4298.1513513514 -1 NULL +-4298.1513513514 -4298.15 -4298 -4299 -4298 0.0 NULL NULL NULL NULL NULL NULL NULL NULL 4298.151351351400000000 -0.43730633941118113 NaN 0.899312607223313 NaN -1.5705636686355597 -246265.93214088667 -75.01689283012556 -4298.1513513514 4298.1513513514 -1 NULL +-4298.1513513514 -4298.15 -4298 -4299 -4298 0.0 NULL NULL NULL NULL NULL NULL NULL NULL 4298.151351351400000000 -0.43730633941118113 NaN 0.899312607223313 NaN -1.5705636686355597 -246265.93214088667 -75.01689283012556 -4298.1513513514 4298.1513513514 -1 NULL +-4298.1513513514 -4298.15 -4298 -4299 -4298 0.0 NULL NULL NULL NULL NULL NULL NULL NULL 4298.151351351400000000 -0.43730633941118113 NaN 0.899312607223313 NaN -1.5705636686355597 -246265.93214088667 -75.01689283012556 -4298.1513513514 4298.1513513514 -1 NULL +-4298.1513513514 -4298.15 -4298 -4299 -4298 0.0 NULL NULL NULL NULL NULL NULL NULL NULL 4298.151351351400000000 -0.43730633941118113 NaN 0.899312607223313 NaN -1.5705636686355597 -246265.93214088667 -75.01689283012556 -4298.1513513514 4298.1513513514 -1 NULL +-4298.1513513514 -4298.15 -4298 -4299 -4298 0.0 NULL NULL NULL NULL NULL NULL NULL NULL 4298.151351351400000000 -0.43730633941118113 NaN 0.899312607223313 NaN -1.5705636686355597 -246265.93214088667 -75.01689283012556 -4298.1513513514 4298.1513513514 -1 NULL diff --git ql/src/test/results/clientpositive/windowing_decimal.q.out ql/src/test/results/clientpositive/windowing_decimal.q.out index 08dd6ab..2354b6b 100644 --- ql/src/test/results/clientpositive/windowing_decimal.q.out +++ ql/src/test/results/clientpositive/windowing_decimal.q.out @@ -99,8 +99,8 @@ from part_dec POSTHOOK: type: QUERY POSTHOOK: Input: default@part_dec #### A masked pattern was here #### -Manufacturer#1 1173.15 1173.15 2346.3 -Manufacturer#1 1173.15 1173.15 2346.3 +Manufacturer#1 1173.15 1173.15 2346.30 +Manufacturer#1 1173.15 1173.15 2346.30 Manufacturer#1 1414.42 1173.15 3760.72 Manufacturer#1 1602.59 1173.15 5363.31 Manufacturer#1 1632.66 1173.15 6995.97 @@ -118,7 +118,7 @@ Manufacturer#3 1922.98 1190.27 7532.61 Manufacturer#4 1206.26 1206.26 1206.26 Manufacturer#4 1290.35 1206.26 2496.61 Manufacturer#4 1375.42 1206.26 3872.03 -Manufacturer#4 1620.67 1206.26 5492.7 +Manufacturer#4 1620.67 1206.26 5492.70 Manufacturer#4 1844.92 1206.26 7337.62 Manufacturer#5 1018.1 1018.1 1018.1 Manufacturer#5 1464.48 1018.1 2482.58 @@ -139,8 +139,8 @@ from part_dec POSTHOOK: type: QUERY POSTHOOK: Input: default@part_dec #### A masked pattern was here #### -Manufacturer#1 1173.15 1173.15 2346.3 -Manufacturer#1 1173.15 1173.15 2346.3 +Manufacturer#1 1173.15 1173.15 2346.30 +Manufacturer#1 1173.15 1173.15 2346.30 Manufacturer#1 1414.42 1414.42 1414.42 Manufacturer#1 1602.59 1602.59 1602.59 Manufacturer#1 1632.66 1632.66 1632.66 diff --git ql/src/test/results/clientpositive/windowing_navfn.q.out ql/src/test/results/clientpositive/windowing_navfn.q.out index f2f2cb4..e5bc4f4 100644 --- ql/src/test/results/clientpositive/windowing_navfn.q.out +++ ql/src/test/results/clientpositive/windowing_navfn.q.out @@ -277,13 +277,13 @@ POSTHOOK: Input: default@over10k 65536 98.42 65536 0.93 65536 83.48 -65536 75.7 +65536 75.70 65536 88.04 65536 94.09 65536 33.45 65536 44.41 65536 22.15 -65536 20.5 +65536 20.50 65536 58.86 65536 30.91 65536 74.47 @@ -300,9 +300,9 @@ POSTHOOK: Input: default@over10k 65536 80.26 65536 35.07 65536 95.88 -65536 30.6 +65536 30.60 65536 46.97 -65536 58.8 +65536 58.80 65536 5.72 65536 29.27 65536 62.25 @@ -326,7 +326,7 @@ POSTHOOK: Input: default@over10k 65537 35.86 65537 47.75 65537 1.12 -65537 52.9 +65537 52.90 65537 53.92 65537 43.45 65537 7.52 @@ -340,20 +340,20 @@ POSTHOOK: Input: default@over10k 65537 56.48 65537 83.21 65537 56.52 -65537 36.6 -65537 59.7 +65537 36.60 +65537 59.70 65537 80.14 -65537 66.3 +65537 66.30 65537 94.87 65537 40.92 -65537 25.2 +65537 25.20 65537 7.36 65538 NULL 65538 53.35 65538 54.64 65538 76.67 65538 15.17 -65538 1.2 +65538 1.20 65538 13.71 65538 81.59 65538 43.33 diff --git ql/src/test/results/clientpositive/windowing_rank.q.out ql/src/test/results/clientpositive/windowing_rank.q.out index 6a74a8e..67975f3 100644 --- ql/src/test/results/clientpositive/windowing_rank.q.out +++ ql/src/test/results/clientpositive/windowing_rank.q.out @@ -508,16 +508,16 @@ where rnk = 1 limit 10 POSTHOOK: type: QUERY POSTHOOK: Input: default@over10k #### A masked pattern was here #### -2013-03-01 09:11:58.70307 0.5 1 -2013-03-01 09:11:58.70307 0.5 1 -2013-03-01 09:11:58.70307 0.5 1 -2013-03-01 09:11:58.70307 0.5 1 -2013-03-01 09:11:58.70307 0.5 1 -2013-03-01 09:11:58.70307 0.5 1 -2013-03-01 09:11:58.70307 0.5 1 -2013-03-01 09:11:58.70307 0.5 1 -2013-03-01 09:11:58.70307 0.5 1 -2013-03-01 09:11:58.70307 0.5 1 +2013-03-01 09:11:58.70307 0.50 1 +2013-03-01 09:11:58.70307 0.50 1 +2013-03-01 09:11:58.70307 0.50 1 +2013-03-01 09:11:58.70307 0.50 1 +2013-03-01 09:11:58.70307 0.50 1 +2013-03-01 09:11:58.70307 0.50 1 +2013-03-01 09:11:58.70307 0.50 1 +2013-03-01 09:11:58.70307 0.50 1 +2013-03-01 09:11:58.70307 0.50 1 +2013-03-01 09:11:58.70307 0.50 1 PREHOOK: query: select ts, dec, rnk from (select ts, dec, @@ -546,16 +546,16 @@ where dec = 89.5 limit 10 POSTHOOK: type: QUERY POSTHOOK: Input: default@over10k #### A masked pattern was here #### -2013-03-01 09:11:58.703124 89.5 1 -2013-03-01 09:11:58.703124 89.5 1 -2013-03-01 09:11:58.703124 89.5 1 -2013-03-01 09:11:58.703124 89.5 1 -2013-03-01 09:11:58.703124 89.5 1 -2013-03-01 09:11:58.703124 89.5 1 -2013-03-01 09:11:58.703124 89.5 1 -2013-03-01 09:11:58.703124 89.5 1 -2013-03-01 09:11:58.703124 89.5 1 -2013-03-01 09:11:58.703124 89.5 1 +2013-03-01 09:11:58.703124 89.50 1 +2013-03-01 09:11:58.703124 89.50 1 +2013-03-01 09:11:58.703124 89.50 1 +2013-03-01 09:11:58.703124 89.50 1 +2013-03-01 09:11:58.703124 89.50 1 +2013-03-01 09:11:58.703124 89.50 1 +2013-03-01 09:11:58.703124 89.50 1 +2013-03-01 09:11:58.703124 89.50 1 +2013-03-01 09:11:58.703124 89.50 1 +2013-03-01 09:11:58.703124 89.50 1 PREHOOK: query: select ts, dec, rnk from (select ts, dec, @@ -586,13 +586,13 @@ where rnk = 1 limit 10 POSTHOOK: type: QUERY POSTHOOK: Input: default@over10k #### A masked pattern was here #### -2013-03-01 09:11:58.70307 37.3 1 -2013-03-01 09:11:58.70307 37.3 1 -2013-03-01 09:11:58.70307 37.3 1 -2013-03-01 09:11:58.70307 37.3 1 -2013-03-01 09:11:58.70307 37.3 1 -2013-03-01 09:11:58.70307 37.3 1 -2013-03-01 09:11:58.70307 37.3 1 -2013-03-01 09:11:58.70307 37.3 1 -2013-03-01 09:11:58.70307 37.3 1 -2013-03-01 09:11:58.70307 37.3 1 +2013-03-01 09:11:58.70307 37.30 1 +2013-03-01 09:11:58.70307 37.30 1 +2013-03-01 09:11:58.70307 37.30 1 +2013-03-01 09:11:58.70307 37.30 1 +2013-03-01 09:11:58.70307 37.30 1 +2013-03-01 09:11:58.70307 37.30 1 +2013-03-01 09:11:58.70307 37.30 1 +2013-03-01 09:11:58.70307 37.30 1 +2013-03-01 09:11:58.70307 37.30 1 +2013-03-01 09:11:58.70307 37.30 1 diff --git serde/src/java/org/apache/hadoop/hive/serde2/binarysortable/BinarySortableSerDe.java serde/src/java/org/apache/hadoop/hive/serde2/binarysortable/BinarySortableSerDe.java index 523ad7d..06a8c2f 100644 --- serde/src/java/org/apache/hadoop/hive/serde2/binarysortable/BinarySortableSerDe.java +++ serde/src/java/org/apache/hadoop/hive/serde2/binarysortable/BinarySortableSerDe.java @@ -776,7 +776,7 @@ static void serialize(ByteStream.Output buffer, Object o, ObjectInspector oi, // get the scale factor to turn big decimal into a decimal < 1 int factor = dec.precision() - dec.scale(); - factor = sign == 1 ? factor : -factor; + factor = sign != -1 ? factor : -factor; // convert the absolute big decimal to string dec.scaleByPowerOfTen(Math.abs(dec.scale()));