This is an automated email from the ASF dual-hosted git repository.

abstractdog pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new 46a37ce461f HIVE-27213 : parquet logical decimal type to INT32 is not 
working while compute statastics (#4515) (Kirti Ruge reviewed Laszlo Bodor)
46a37ce461f is described below

commit 46a37ce461fde6249262061a5e099f0cefd12506
Author: rkirtir <[email protected]>
AuthorDate: Mon Aug 7 12:16:03 2023 +0530

    HIVE-27213 : parquet logical decimal type to INT32 is not working while 
compute statastics (#4515) (Kirti Ruge reviewed Laszlo Bodor)
---
 data/files/web_sales.parquet                       | Bin 0 -> 34965846 bytes
 .../hive/ql/io/parquet/convert/ETypeConverter.java |   5 +
 .../parquet_int_decimal_with_dictsupport.q         |  37 +++++++
 .../parquet_int_decimal_with_dictsupport.q.out     | 112 +++++++++++++++++++++
 4 files changed, 154 insertions(+)

diff --git a/data/files/web_sales.parquet b/data/files/web_sales.parquet
new file mode 100644
index 00000000000..b70b09b8501
Binary files /dev/null and b/data/files/web_sales.parquet differ
diff --git 
a/ql/src/java/org/apache/hadoop/hive/ql/io/parquet/convert/ETypeConverter.java 
b/ql/src/java/org/apache/hadoop/hive/ql/io/parquet/convert/ETypeConverter.java
index a728b43e1d4..c1bbd35ddea 100644
--- 
a/ql/src/java/org/apache/hadoop/hive/ql/io/parquet/convert/ETypeConverter.java
+++ 
b/ql/src/java/org/apache/hadoop/hive/ql/io/parquet/convert/ETypeConverter.java
@@ -707,6 +707,11 @@ public enum ETypeConverter {
                   (DecimalTypeInfo) hiveTypeInfo);
             }
 
+            // TODO HIVE-27529 Add dictionary encoding support for parquet 
decimal types
+            @Override
+            public boolean hasDictionarySupport() {
+              return false;
+            }
             @Override
             public void addInt(final int value) {
               addDecimal(value);
diff --git 
a/ql/src/test/queries/clientpositive/parquet_int_decimal_with_dictsupport.q 
b/ql/src/test/queries/clientpositive/parquet_int_decimal_with_dictsupport.q
new file mode 100644
index 00000000000..c34869ef760
--- /dev/null
+++ b/ql/src/test/queries/clientpositive/parquet_int_decimal_with_dictsupport.q
@@ -0,0 +1,37 @@
+CREATE TABLE `web_sales`(
+  `ws_sold_time_sk` int,
+  `ws_ship_date_sk` int,
+  `ws_item_sk` int,
+  `ws_bill_customer_sk` int,
+  `ws_bill_cdemo_sk` int,
+  `ws_bill_hdemo_sk` int,
+  `ws_bill_addr_sk` int,
+  `ws_ship_customer_sk` int,
+  `ws_ship_cdemo_sk` int,
+  `ws_ship_hdemo_sk` int,
+  `ws_ship_addr_sk` int,
+  `ws_web_page_sk` int,
+  `ws_web_site_sk` int,
+  `ws_ship_mode_sk` int,
+  `ws_warehouse_sk` int,
+  `ws_promo_sk` int,
+  `ws_order_number` bigint,
+  `ws_quantity` int,
+  `ws_wholesale_cost` decimal(7,2),
+  `ws_list_price` decimal(7,2),
+  `ws_sales_price` decimal(7,2),
+  `ws_ext_discount_amt` decimal(7,2),
+  `ws_ext_sales_price` decimal(7,2),
+  `ws_ext_wholesale_cost` decimal(7,2),
+  `ws_ext_list_price` decimal(7,2),
+  `ws_ext_tax` decimal(7,2),
+  `ws_coupon_amt` decimal(7,2),
+  `ws_ext_ship_cost` decimal(7,2),
+  `ws_net_paid` decimal(7,2),
+  `ws_net_paid_inc_tax` decimal(7,2),
+  `ws_net_paid_inc_ship` decimal(7,2),
+  `ws_net_paid_inc_ship_tax` decimal(7,2),
+  `ws_net_profit` decimal(7,2),
+  `ws_sold_date_sk` int) STORED AS PARQUET ;
+LOAD DATA LOCAL INPATH '../../data/files/web_sales.parquet' INTO TABLE 
web_sales;
+select * from web_sales limit 20;
\ No newline at end of file
diff --git 
a/ql/src/test/results/clientpositive/llap/parquet_int_decimal_with_dictsupport.q.out
 
b/ql/src/test/results/clientpositive/llap/parquet_int_decimal_with_dictsupport.q.out
new file mode 100644
index 00000000000..09b91fe1303
--- /dev/null
+++ 
b/ql/src/test/results/clientpositive/llap/parquet_int_decimal_with_dictsupport.q.out
@@ -0,0 +1,112 @@
+PREHOOK: query: CREATE TABLE `web_sales`(
+  `ws_sold_time_sk` int,
+  `ws_ship_date_sk` int,
+  `ws_item_sk` int,
+  `ws_bill_customer_sk` int,
+  `ws_bill_cdemo_sk` int,
+  `ws_bill_hdemo_sk` int,
+  `ws_bill_addr_sk` int,
+  `ws_ship_customer_sk` int,
+  `ws_ship_cdemo_sk` int,
+  `ws_ship_hdemo_sk` int,
+  `ws_ship_addr_sk` int,
+  `ws_web_page_sk` int,
+  `ws_web_site_sk` int,
+  `ws_ship_mode_sk` int,
+  `ws_warehouse_sk` int,
+  `ws_promo_sk` int,
+  `ws_order_number` bigint,
+  `ws_quantity` int,
+  `ws_wholesale_cost` decimal(7,2),
+  `ws_list_price` decimal(7,2),
+  `ws_sales_price` decimal(7,2),
+  `ws_ext_discount_amt` decimal(7,2),
+  `ws_ext_sales_price` decimal(7,2),
+  `ws_ext_wholesale_cost` decimal(7,2),
+  `ws_ext_list_price` decimal(7,2),
+  `ws_ext_tax` decimal(7,2),
+  `ws_coupon_amt` decimal(7,2),
+  `ws_ext_ship_cost` decimal(7,2),
+  `ws_net_paid` decimal(7,2),
+  `ws_net_paid_inc_tax` decimal(7,2),
+  `ws_net_paid_inc_ship` decimal(7,2),
+  `ws_net_paid_inc_ship_tax` decimal(7,2),
+  `ws_net_profit` decimal(7,2),
+  `ws_sold_date_sk` int) STORED AS PARQUET
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@web_sales
+POSTHOOK: query: CREATE TABLE `web_sales`(
+  `ws_sold_time_sk` int,
+  `ws_ship_date_sk` int,
+  `ws_item_sk` int,
+  `ws_bill_customer_sk` int,
+  `ws_bill_cdemo_sk` int,
+  `ws_bill_hdemo_sk` int,
+  `ws_bill_addr_sk` int,
+  `ws_ship_customer_sk` int,
+  `ws_ship_cdemo_sk` int,
+  `ws_ship_hdemo_sk` int,
+  `ws_ship_addr_sk` int,
+  `ws_web_page_sk` int,
+  `ws_web_site_sk` int,
+  `ws_ship_mode_sk` int,
+  `ws_warehouse_sk` int,
+  `ws_promo_sk` int,
+  `ws_order_number` bigint,
+  `ws_quantity` int,
+  `ws_wholesale_cost` decimal(7,2),
+  `ws_list_price` decimal(7,2),
+  `ws_sales_price` decimal(7,2),
+  `ws_ext_discount_amt` decimal(7,2),
+  `ws_ext_sales_price` decimal(7,2),
+  `ws_ext_wholesale_cost` decimal(7,2),
+  `ws_ext_list_price` decimal(7,2),
+  `ws_ext_tax` decimal(7,2),
+  `ws_coupon_amt` decimal(7,2),
+  `ws_ext_ship_cost` decimal(7,2),
+  `ws_net_paid` decimal(7,2),
+  `ws_net_paid_inc_tax` decimal(7,2),
+  `ws_net_paid_inc_ship` decimal(7,2),
+  `ws_net_paid_inc_ship_tax` decimal(7,2),
+  `ws_net_profit` decimal(7,2),
+  `ws_sold_date_sk` int) STORED AS PARQUET
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@web_sales
+PREHOOK: query: LOAD DATA LOCAL INPATH '../../data/files/web_sales.parquet' 
INTO TABLE web_sales
+PREHOOK: type: LOAD
+#### A masked pattern was here ####
+PREHOOK: Output: default@web_sales
+POSTHOOK: query: LOAD DATA LOCAL INPATH '../../data/files/web_sales.parquet' 
INTO TABLE web_sales
+POSTHOOK: type: LOAD
+#### A masked pattern was here ####
+POSTHOOK: Output: default@web_sales
+PREHOOK: query: select * from web_sales limit 20
+PREHOOK: type: QUERY
+PREHOOK: Input: default@web_sales
+#### A masked pattern was here ####
+POSTHOOK: query: select * from web_sales limit 20
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@web_sales
+#### A masked pattern was here ####
+36228  2451934 193496  11011037        1079649 2308    2682120 8857028 895855  
5556    2265368 758     5       1       18      1435    720421  38      24.97   
50.18   16.05   1296.94 609.90  948.86  1906.84 29.76   237.86  877.04  372.04  
401.80  1249.08 1278.84 -576.82 NULL
+36228  2451890 52490   11011037        1079649 2308    2682120 8857028 895855  
5556    2265368 1313    1       6       17      795     720421  99      17.28   
49.93   7.98    4153.05 790.02  1710.72 4943.07 39.50   0.00    2076.03 790.02  
829.52  2866.05 2905.55 -920.70 NULL
+36228  2451897 192200  11011037        1079649 2308    2682120 8857028 895855  
5556    2265368 2015    20      18      3       901     720421  77      23.79   
62.09   27.31   2678.06 2102.87 1831.83 4780.93 39.74   1535.09 955.57  567.78  
607.52  1523.35 1563.09 -1264.05        NULL
+36228  2451833 171553  11011037        1079649 2308    2682120 8857028 895855  
5556    2265368 1346    49      18      10      1335    720421  40      59.52   
64.87   46.70   726.80  1868.00 2380.80 2594.80 26.15   1344.96 337.20  523.04  
549.19  860.24  886.39  -1857.76        NULL
+36228  2451829 279083  11011037        1079649 2308    2682120 8857028 895855  
5556    2265368 443     20      11      9       240     720421  82      11.35   
24.62   24.12   41.00   1977.84 930.70  2018.84 178.00  0.00    423.94  1977.84 
2155.84 2401.78 2579.78 1047.14 NULL
+36228  2451936 271355  11011037        1079649 2308    2682120 8857028 895855  
5556    2265368 905     35      16      4       419     720421  33      81.47   
133.61  129.60  132.33  4276.80 2688.51 4409.13 213.84  0.00    88.11   4276.80 
4490.64 4364.91 4578.75 1588.29 NULL
+36228  2451883 69872   11011037        1079649 2308    2682120 8857028 895855  
5556    2265368 2867    19      12      11      963     720421  16      18.47   
44.88   27.37   280.16  437.92  295.52  718.08  5.91    240.85  7.04    197.07  
202.98  204.11  210.02  -98.45  NULL
+36228  2451839 264911  11011037        1079649 2308    2682120 8857028 895855  
5556    2265368 2570    29      6       9       1019    720421  50      58.34   
138.26  33.18   5254.00 1659.00 2917.00 6913.00 149.31  0.00    3249.00 1659.00 
1808.31 4908.00 5057.31 -1258.00        NULL
+36228  2451911 66467   11011037        1079649 2308    2682120 8857028 895855  
5556    2265368 2695    35      11      9       194     720421  60      57.39   
66.57   16.64   2995.80 998.40  3443.40 3994.20 17.57   559.10  1477.80 439.30  
456.87  1917.10 1934.67 -3004.10        NULL
+36228  2451860 177263  11011037        1079649 2308    2682120 8857028 895855  
5556    2265368 2243    29      10      14      78      720421  96      27.95   
62.60   43.19   1863.36 4146.24 2683.20 6009.60 207.31  0.00    2763.84 4146.24 
4353.55 6910.08 7117.39 1463.04 NULL
+36228  2451838 12079   11011037        1079649 2308    2682120 8857028 895855  
5556    2265368 2155    23      15      7       652     720421  56      83.45   
248.68  121.85  7102.48 6823.60 4673.20 13926.08        545.88  0.00    5430.88 
6823.60 7369.48 12254.48        12800.36        2150.40 NULL
+36228  2451850 140281  11011037        1079649 2308    2682120 8857028 895855  
5556    2265368 1949    2       17      8       899     720421  31      22.65   
51.86   16.59   1093.37 514.29  702.15  1607.66 18.10   288.00  659.06  226.29  
244.39  885.35  903.45  -475.86 NULL
+36228  2451908 139331  11011037        1079649 2308    2682120 8857028 895855  
5556    2265368 199     20      10      5       1400    720421  38      87.89   
133.59  113.55  761.52  4314.90 3339.82 5076.42 388.34  0.00    2081.26 4314.90 
4703.24 6396.16 6784.50 975.08  NULL
+36228  2451861 107039  11011037        1079649 2308    2682120 8857028 895855  
5556    2265368 61      35      2       4       413     720421  54      4.00    
4.36    0.56    205.20  30.24   216.00  235.44  0.60    0.00    75.06   30.24   
30.84   105.30  105.90  -185.76 NULL
+36228  2451831 282515  11011037        1079649 2308    2682120 8857028 895855  
5556    2265368 2867    35      1       8       148     720421  14      89.16   
106.99  23.53   1168.44 329.42  1248.24 1497.86 28.16   16.47   464.24  312.95  
341.11  777.19  805.35  -935.29 NULL
+19198  2451855 69056   11282610        1143640 2270    3588547 9133579 1444027 
5684    1501914 823     26      15      13      118     720834  56      79.97   
221.51  53.16   9427.60 2976.96 4478.32 12404.56        267.92  0.00    5829.60 
2976.96 3244.88 8806.56 9074.48 -1501.36        NULL
+19198  2451826 135473  11282610        1143640 2270    3588547 9133579 1444027 
5684    1501914 535     53      20      16      1272    720834  100     98.41   
233.23  20.99   21224.00        2099.00 9841.00 23323.00        41.98   0.00    
466.00  2099.00 2140.98 2565.00 2606.98 -7742.00        NULL
+19198  2451874 30013   11282610        1143640 2270    3588547 9133579 1444027 
5684    1501914 1343    53      10      12      281     720834  67      54.78   
66.83   28.73   2552.70 1924.91 3670.26 4477.61 134.74  0.00    223.78  1924.91 
2059.65 2148.69 2283.43 -1745.35        NULL
+19198  2451938 184838  11282610        1143640 2270    3588547 9133579 1444027 
5684    1501914 2065    47      5       1       597     720834  3       83.67   
207.50  153.55  161.85  460.65  251.01  622.50  18.42   0.00    56.01   460.65  
479.07  516.66  535.08  209.64  NULL
+19198  2451844 120203  11282610        1143640 2270    3588547 9133579 1444027 
5684    1501914 1165    26      4       11      1398    720834  38      14.21   
29.69   24.64   191.90  936.32  539.98  1128.22 84.26   0.00    0.00    936.32  
1020.58 936.32  1020.58 396.34  NULL

Reply via email to