t3rmin4t0r commented on a change in pull request #611: HIVE-21656: Vectorized Mask UDF URL: https://github.com/apache/hive/pull/611#discussion_r279579554
########## File path: ql/src/test/queries/clientpositive/udf_mask_vectorized.q ########## @@ -0,0 +1,38 @@ +set hive.mapred.mode=nonstrict; +set hive.explain.user=false; +SET hive.vectorized.execution.enabled=true; +set hive.fetch.task.conversion=minimal; + +create table tmask(t tinyint, s smallint, i int, bg bigint, f float, db double, dc decimal (10,3), n numeric, + d date, ts timestamp, + str string, vr varchar(10), ch char(4), + b boolean, bin binary); + +insert into tmask values(1,2,345,4455433,5.6,5644.455,10.20, 579.00, '2019-09-09', current_timestamp(), 'string1', 'varchar1', 'ch1', true, 'bin'), + (NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), + (9,7,3450,7455433,5.08,5944.455,10.20, 579.00, '1019-09-09', current_timestamp(), 'string2', 'varchar2', 'ch2', false, 'bin2'), + (NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); + +-- MASK UDF with single argument +-- date types (timestamp is not supported for masking) +set hive.vectorized.execution.enabled=true; +explain VECTORIZATION DETAIL select mask(d), mask(ts) from tmask where s > 0 and i < 10000000; +select mask(d), mask(ts) from tmask where s > 0 and i < 10000000; +set hive.vectorized.execution.enabled=false; +select mask(d), mask(ts) from tmask where s > 0 and i < 10000000; + +-- numeric types, double, float, demical and numeric are not supported for masking +set hive.vectorized.execution.enabled=true; +explain VECTORIZATION DETAIL select mask(t), mask(s), mask(i), mask(bg), mask(f), mask(db), mask(dc), mask(n) from tmask; +select mask(t), mask(s), mask(i), mask(bg), mask(f), mask(db), mask(dc), mask(n) from tmask; +set hive.vectorized.execution.enabled=false; +select mask(t), mask(s), mask(i), mask(bg), mask(f), mask(db), mask(dc), mask(n) from tmask; + +-- string + misc types +set hive.vectorized.execution.enabled=true; +explain VECTORIZATION DETAIL select mask(str), mask(vr), mask(ch), mask(b), mask(bin) from tmask ; +select mask(str), mask(vr), mask(ch), mask(b), mask(bin) from tmask ; +set hive.vectorized.execution.enabled=false; +select mask(str), mask(vr), mask(ch), mask(b), mask(bin) from tmask ; Review comment: Add test to compare the two results - instead of golden files ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
