hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hashut...@apache.org
Subject svn commit: r1507713 [3/6] - in /hive/trunk: data/files/ jdbc/src/java/org/apache/hadoop/hive/jdbc/ jdbc/src/java/org/apache/hive/jdbc/ jdbc/src/test/org/apache/hadoop/hive/jdbc/ jdbc/src/test/org/apache/hive/jdbc/ ql/src/gen/protobuf/gen-java/org/apac...
Date Sat, 27 Jul 2013 21:20:06 GMT
Added: hive/trunk/ql/src/test/queries/clientpositive/date_1.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientpositive/date_1.q?rev=1507713&view=auto
==============================================================================
--- hive/trunk/ql/src/test/queries/clientpositive/date_1.q (added)
+++ hive/trunk/ql/src/test/queries/clientpositive/date_1.q Sat Jul 27 21:20:03 2013
@@ -0,0 +1,87 @@
+drop table date_1;
+
+create table date_1 (d date);
+
+insert overwrite table date_1 
+  select cast('2011-01-01' as date) from src limit 1;
+
+select * from date_1 limit 1;
+select d, count(d) from date_1 group by d;
+
+insert overwrite table date_1 
+  select date '2011-01-01' from src limit 1;
+
+select * from date_1 limit 1;
+select d, count(d) from date_1 group by d;
+
+insert overwrite table date_1 
+  select cast(cast('2011-01-01 00:00:00' as timestamp) as date) from src limit 1;
+
+select * from date_1 limit 1;
+select d, count(d) from date_1 group by d;
+
+-- Valid casts
+select 
+  cast('2012-01-01' as string), 
+  cast(d as string), 
+  cast(d as timestamp), 
+  cast(cast(d as timestamp) as date), 
+  cast(d as date)
+from date_1 limit 1;
+
+-- Invalid casts. 
+select 
+  cast(d as boolean), 
+  cast(d as tinyint),
+  cast(d as smallint),
+  cast(d as int),
+  cast(d as bigint),
+  cast(d as float),
+  cast(d as double)
+from date_1 limit 1;
+
+-- These comparisons should all be true
+select 
+  date '2011-01-01' = date '2011-01-01',
+  unix_timestamp(date '2011-01-01') = unix_timestamp(date '2011-01-01'),
+  unix_timestamp(date '2011-01-01') = unix_timestamp(cast(date '2011-01-01' as timestamp)),
+  unix_timestamp(date '2011-01-01') = unix_timestamp(cast(cast('2011-01-01 12:13:14' as timestamp) as date)),
+  unix_timestamp(date '2011-01-01') < unix_timestamp(cast('2011-01-01 00:00:01' as timestamp)),
+  unix_timestamp(date '2011-01-01') = unix_timestamp(cast('2011-01-01 00:00:00' as timestamp)),
+  unix_timestamp(date '2011-01-01') > unix_timestamp(cast('2010-12-31 23:59:59' as timestamp)),
+  date '2011-01-01' = cast(timestamp('2011-01-01 23:24:25') as date),
+  '2011-01-01' = cast(d as string),
+  '2011-01-01' = cast(date '2011-01-01' as string)
+from date_1 limit 1;
+
+select 
+  date('2001-01-28'),
+  date('2001-02-28'),
+  date('2001-03-28'),
+  date('2001-04-28'),
+  date('2001-05-28'),
+  date('2001-06-28'),
+  date('2001-07-28'),
+  date('2001-08-28'),
+  date('2001-09-28'),
+  date('2001-10-28'),
+  date('2001-11-28'),
+  date('2001-12-28')
+from date_1 limit 1;
+
+select 
+  unix_timestamp(date('2001-01-28')) = unix_timestamp(cast('2001-01-28 0:0:0' as timestamp)),
+  unix_timestamp(date('2001-02-28')) = unix_timestamp(cast('2001-02-28 0:0:0' as timestamp)),
+  unix_timestamp(date('2001-03-28')) = unix_timestamp(cast('2001-03-28 0:0:0' as timestamp)),
+  unix_timestamp(date('2001-04-28')) = unix_timestamp(cast('2001-04-28 0:0:0' as timestamp)),
+  unix_timestamp(date('2001-05-28')) = unix_timestamp(cast('2001-05-28 0:0:0' as timestamp)),
+  unix_timestamp(date('2001-06-28')) = unix_timestamp(cast('2001-06-28 0:0:0' as timestamp)),
+  unix_timestamp(date('2001-07-28')) = unix_timestamp(cast('2001-07-28 0:0:0' as timestamp)),
+  unix_timestamp(date('2001-08-28')) = unix_timestamp(cast('2001-08-28 0:0:0' as timestamp)),
+  unix_timestamp(date('2001-09-28')) = unix_timestamp(cast('2001-09-28 0:0:0' as timestamp)),
+  unix_timestamp(date('2001-10-28')) = unix_timestamp(cast('2001-10-28 0:0:0' as timestamp)),
+  unix_timestamp(date('2001-11-28')) = unix_timestamp(cast('2001-11-28 0:0:0' as timestamp)),
+  unix_timestamp(date('2001-12-28')) = unix_timestamp(cast('2001-12-28 0:0:0' as timestamp))
+from date_1 limit 1;
+
+drop table date_1;

Added: hive/trunk/ql/src/test/queries/clientpositive/date_2.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientpositive/date_2.q?rev=1507713&view=auto
==============================================================================
--- hive/trunk/ql/src/test/queries/clientpositive/date_2.q (added)
+++ hive/trunk/ql/src/test/queries/clientpositive/date_2.q Sat Jul 27 21:20:03 2013
@@ -0,0 +1,18 @@
+drop table if exists date_2;
+
+create table date_2 (
+  ORIGIN_CITY_NAME string,
+  DEST_CITY_NAME string,
+  FL_DATE date,
+  ARR_DELAY float,
+  FL_NUM int
+);
+
+LOAD DATA LOCAL INPATH '../data/files/flights_tiny.txt.1' OVERWRITE INTO TABLE date_2;
+
+select fl_date, fl_num from date_2 order by fl_date asc, fl_num desc;
+select fl_date, fl_num from date_2 order by fl_date desc, fl_num asc;
+
+select fl_date, count(*) from date_2 group by fl_date;
+
+drop table date_2;

Added: hive/trunk/ql/src/test/queries/clientpositive/date_3.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientpositive/date_3.q?rev=1507713&view=auto
==============================================================================
--- hive/trunk/ql/src/test/queries/clientpositive/date_3.q (added)
+++ hive/trunk/ql/src/test/queries/clientpositive/date_3.q Sat Jul 27 21:20:03 2013
@@ -0,0 +1,14 @@
+drop table date_3;
+
+create table date_3 (
+  c1 int
+);
+
+alter table date_3 add columns (c2 date);
+
+insert overwrite table date_3
+  select 1, cast(cast('2011-01-01 00:00:00' as timestamp) as date) from src limit 1;
+
+select * from date_3;
+
+drop table date_3;

Added: hive/trunk/ql/src/test/queries/clientpositive/date_4.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientpositive/date_4.q?rev=1507713&view=auto
==============================================================================
--- hive/trunk/ql/src/test/queries/clientpositive/date_4.q (added)
+++ hive/trunk/ql/src/test/queries/clientpositive/date_4.q Sat Jul 27 21:20:03 2013
@@ -0,0 +1,11 @@
+drop table date_4;
+
+create table date_4 (d date);
+alter table date_4 set serde 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe';
+
+-- Test date literal syntax
+insert overwrite table date_4 
+  select date '2011-01-01' from src limit 1;
+select d, date '2011-01-01' from date_4 limit 1;
+
+drop table date_4;

Added: hive/trunk/ql/src/test/queries/clientpositive/date_comparison.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientpositive/date_comparison.q?rev=1507713&view=auto
==============================================================================
--- hive/trunk/ql/src/test/queries/clientpositive/date_comparison.q (added)
+++ hive/trunk/ql/src/test/queries/clientpositive/date_comparison.q Sat Jul 27 21:20:03 2013
@@ -0,0 +1,38 @@
+-- Comparisons against same value
+select cast('2011-05-06' as date) > 
+  cast('2011-05-06' as date) from src limit 1;
+
+select cast('2011-05-06' as date) <
+  cast('2011-05-06' as date) from src limit 1;
+
+select cast('2011-05-06' as date) = 
+  cast('2011-05-06' as date) from src limit 1;
+
+select cast('2011-05-06' as date) <>
+  cast('2011-05-06' as date) from src limit 1;
+
+select cast('2011-05-06' as date) >=
+  cast('2011-05-06' as date) from src limit 1;
+
+select cast('2011-05-06' as date) <=
+  cast('2011-05-06' as date) from src limit 1;
+
+-- Now try with differing values
+select cast('2011-05-05' as date) > 
+  cast('2011-05-06' as date) from src limit 1;
+
+select cast('2011-05-05' as date) <
+  cast('2011-05-06' as date) from src limit 1;
+
+select cast('2011-05-05' as date) = 
+  cast('2011-05-06' as date) from src limit 1;
+
+select cast('2011-05-05' as date) <>
+  cast('2011-05-06' as date) from src limit 1;
+
+select cast('2011-05-05' as date) >=
+  cast('2011-05-06' as date) from src limit 1;
+
+select cast('2011-05-05' as date) <=
+  cast('2011-05-06' as date) from src limit 1;
+

Added: hive/trunk/ql/src/test/queries/clientpositive/date_join1.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientpositive/date_join1.q?rev=1507713&view=auto
==============================================================================
--- hive/trunk/ql/src/test/queries/clientpositive/date_join1.q (added)
+++ hive/trunk/ql/src/test/queries/clientpositive/date_join1.q Sat Jul 27 21:20:03 2013
@@ -0,0 +1,19 @@
+drop table date_join1;
+
+create table date_join1 (
+  ORIGIN_CITY_NAME string,
+  DEST_CITY_NAME string,
+  FL_DATE date,
+  ARR_DELAY float,
+  FL_NUM int
+);
+
+LOAD DATA LOCAL INPATH '../data/files/flights_join.txt' OVERWRITE INTO TABLE date_join1;
+
+-- Note that there are 2 rows with date 2000-11-28, so we should expect 4 rows with that date in the join results
+select t1.fl_num, t1.fl_date, t2.fl_num, t2.fl_date
+  from date_join1 t1 
+  join date_join1 t2 
+  on (t1.fl_date = t2.fl_date);
+
+drop table date_join1;

Added: hive/trunk/ql/src/test/queries/clientpositive/date_serde.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientpositive/date_serde.q?rev=1507713&view=auto
==============================================================================
--- hive/trunk/ql/src/test/queries/clientpositive/date_serde.q (added)
+++ hive/trunk/ql/src/test/queries/clientpositive/date_serde.q Sat Jul 27 21:20:03 2013
@@ -0,0 +1,112 @@
+drop table if exists date_serde_regex;
+drop table date_serde_lb;
+drop table date_serde_ls;
+drop table date_serde_c;
+drop table date_serde_lbc;
+drop table date_serde_orc;
+
+
+--
+-- RegexSerDe
+--
+create table date_serde_regex (
+  ORIGIN_CITY_NAME string,
+  DEST_CITY_NAME string,
+  FL_DATE date,
+  ARR_DELAY float,
+  FL_NUM int
+)
+row format serde 'org.apache.hadoop.hive.serde2.RegexSerDe'
+with serdeproperties (
+  "input.regex" = "([^]*)([^]*)([^]*)([^]*)([0-9]*)"
+)
+stored as textfile;
+
+load data local inpath '../data/files/flights_tiny.txt.1' overwrite into table date_serde_regex;
+
+select * from date_serde_regex;
+select fl_date, count(*) from date_serde_regex group by fl_date;
+
+--
+-- LazyBinary
+--
+create table date_serde_lb (
+  c1 date,
+  c2 int
+);
+alter table date_serde_lb set serde 'org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe';
+
+insert overwrite table date_serde_lb 
+  select fl_date, fl_num from date_serde_regex limit 1;
+
+select * from date_serde_lb;
+select c1, sum(c2) from date_serde_lb group by c1;
+
+--
+-- LazySimple
+--
+create table date_serde_ls (
+  c1 date,
+  c2 int
+);
+alter table date_serde_ls set serde 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe';
+
+insert overwrite table date_serde_ls 
+  select c1, c2 from date_serde_lb limit 1;
+
+select * from date_serde_ls;
+select c1, sum(c2) from date_serde_ls group by c1;
+
+--
+-- Columnar
+--
+create table date_serde_c (
+  c1 date,
+  c2 int
+) stored as rcfile;
+alter table date_serde_c set serde 'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe';
+
+insert overwrite table date_serde_c 
+  select c1, c2 from date_serde_ls limit 1;
+
+select * from date_serde_c;
+select c1, sum(c2) from date_serde_c group by c1;
+
+--
+-- LazyBinaryColumnar
+--
+create table date_serde_lbc (
+  c1 date,
+  c2 int
+) stored as rcfile;
+alter table date_serde_lbc set serde 'org.apache.hadoop.hive.serde2.columnar.LazyBinaryColumnarSerDe';
+
+insert overwrite table date_serde_lbc 
+  select c1, c2 from date_serde_c limit 1;
+
+select * from date_serde_lbc;
+select c1, sum(c2) from date_serde_lbc group by c1;
+
+--
+-- ORC
+--
+create table date_serde_orc (
+  c1 date,
+  c2 int
+) stored as orc;
+alter table date_serde_orc set serde 'org.apache.hadoop.hive.ql.io.orc.OrcSerde';
+
+insert overwrite table date_serde_orc 
+  select c1, c2 from date_serde_lbc limit 1;
+
+select * from date_serde_orc;
+select c1, sum(c2) from date_serde_orc group by c1;
+
+
+
+drop table date_serde_regex;
+drop table date_serde_lb;
+drop table date_serde_ls;
+drop table date_serde_c;
+drop table date_serde_lbc;
+drop table date_serde_orc;

Added: hive/trunk/ql/src/test/queries/clientpositive/date_udf.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientpositive/date_udf.q?rev=1507713&view=auto
==============================================================================
--- hive/trunk/ql/src/test/queries/clientpositive/date_udf.q (added)
+++ hive/trunk/ql/src/test/queries/clientpositive/date_udf.q Sat Jul 27 21:20:03 2013
@@ -0,0 +1,69 @@
+drop table date_udf;
+drop table date_udf_string;
+drop table date_udf_flight;
+
+create table date_udf (d date);
+create table date_udf_string (d string);
+from src
+  insert overwrite table date_udf 
+    select '2011-05-06' limit 1
+  insert overwrite table date_udf_string
+    select '2011-05-06' limit 1;
+
+create table date_udf_flight (
+  ORIGIN_CITY_NAME string,
+  DEST_CITY_NAME string,
+  FL_DATE date,
+  ARR_DELAY float,
+  FL_NUM int
+);
+LOAD DATA LOCAL INPATH '../data/files/flights_tiny.txt.1' OVERWRITE INTO TABLE date_udf_flight;
+
+-- Test UDFs with date input
+select unix_timestamp(d), year(d), month(d), day(d), dayofmonth(d),
+    weekofyear(d), to_date(d)
+  from date_udf;
+
+select date_add(d, 5), date_sub(d, 10)
+  from date_udf;
+
+select datediff(d, d), datediff(d, '2002-03-21'), datediff('2002-03-21', d),
+    datediff(cast ('2002-03-21 00:00:00' as timestamp), d),
+    datediff(d, cast ('2002-03-21 00:00:00' as timestamp))
+  from date_udf;
+
+-- Test UDFs with string input
+select unix_timestamp(d), year(d), month(d), day(d), dayofmonth(d), 
+    weekofyear(d), to_date(d)
+  from date_udf_string;
+
+select date_add(d, 5), date_sub(d, 10)  from date_udf_string;
+
+select datediff(d, d), datediff(d, '2002-03-21'), datediff('2002-03-21', d),
+    datediff('2002-03-21 00:00:00', d),
+    datediff(d, '2002-03-21 00:00:00')
+  from date_udf_string;
+
+select 
+    to_utc_timestamp(date '1970-01-01', 'America/Los_Angeles'),
+    from_utc_timestamp(date '1970-01-01', 'America/Los_Angeles'),
+    to_utc_timestamp(date '2013-06-19', 'America/Los_Angeles'),
+    from_utc_timestamp(date '2013-06-19', 'America/Los_Angeles')
+  from date_udf;
+
+-- should all be true
+select 
+    to_utc_timestamp(date '1970-01-01', 'America/Los_Angeles') = to_utc_timestamp(timestamp('1970-01-01 00:00:00'), 'America/Los_Angeles'),
+    from_utc_timestamp(date '1970-01-01', 'America/Los_Angeles') = from_utc_timestamp(timestamp('1970-01-01 00:00:00'), 'America/Los_Angeles'),
+    to_utc_timestamp(date '2013-06-19', 'America/Los_Angeles') = to_utc_timestamp(timestamp('2013-06-19 00:00:00'), 'America/Los_Angeles'),
+    from_utc_timestamp(date '2013-06-19', 'America/Los_Angeles') = from_utc_timestamp(timestamp('2013-06-19 00:00:00'), 'America/Los_Angeles')
+  from date_udf;
+
+-- Aggregation functions (min/max)
+select min(fl_date) from date_udf_flight;
+select max(fl_date) from date_udf_flight;
+
+
+drop table date_udf;
+drop table date_udf_string;
+drop table date_udf_flight;

Added: hive/trunk/ql/src/test/queries/clientpositive/partition_date.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientpositive/partition_date.q?rev=1507713&view=auto
==============================================================================
--- hive/trunk/ql/src/test/queries/clientpositive/partition_date.q (added)
+++ hive/trunk/ql/src/test/queries/clientpositive/partition_date.q Sat Jul 27 21:20:03 2013
@@ -0,0 +1,45 @@
+drop table partition_date_1;
+
+create table partition_date_1 (key string, value string) partitioned by (dt date, region int);
+
+insert overwrite table partition_date_1 partition(dt='2000-01-01', region=1) 
+  select * from src limit 10;
+insert overwrite table partition_date_1 partition(dt='2000-01-01', region=2) 
+  select * from src limit 5;
+insert overwrite table partition_date_1 partition(dt='2013-08-08', region=1) 
+  select * from src limit 20;
+insert overwrite table partition_date_1 partition(dt='2013-08-08', region=10) 
+  select * from src limit 11;
+
+select distinct dt from partition_date_1;
+select *, cast(dt as timestamp) from partition_date_1 where dt = '2000-01-01' and region = 2;
+
+-- 15
+select count(*) from partition_date_1 where dt = date '2000-01-01';
+-- 15.  Also try with string value in predicate
+select count(*) from partition_date_1 where dt = '2000-01-01';
+-- 5
+select count(*) from partition_date_1 where dt = date '2000-01-01' and region = 2;
+-- 11
+select count(*) from partition_date_1 where dt = date '2013-08-08' and region = 10;
+-- 30
+select count(*) from partition_date_1 where region = 1;
+-- 0
+select count(*) from partition_date_1 where dt = date '2000-01-01' and region = 3;
+-- 0
+select count(*) from partition_date_1 where dt = date '1999-01-01';
+
+-- Try other comparison operations
+
+-- 20
+select count(*) from partition_date_1 where dt > date '2000-01-01' and region = 1;
+-- 10
+select count(*) from partition_date_1 where dt < date '2000-01-02' and region = 1;
+-- 20
+select count(*) from partition_date_1 where dt >= date '2000-01-02' and region = 1;
+-- 10
+select count(*) from partition_date_1 where dt <= date '2000-01-01' and region = 1;
+-- 20
+select count(*) from partition_date_1 where dt <> date '2000-01-01' and region = 1;
+
+drop table partition_date_1;

Added: hive/trunk/ql/src/test/queries/clientpositive/union_date.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientpositive/union_date.q?rev=1507713&view=auto
==============================================================================
--- hive/trunk/ql/src/test/queries/clientpositive/union_date.q (added)
+++ hive/trunk/ql/src/test/queries/clientpositive/union_date.q Sat Jul 27 21:20:03 2013
@@ -0,0 +1,32 @@
+drop table union_date_1;
+drop table union_date_2;
+
+create table union_date_1 (
+  ORIGIN_CITY_NAME string,
+  DEST_CITY_NAME string,
+  FL_DATE date,
+  ARR_DELAY float,
+  FL_NUM int
+);
+
+create table union_date_2 (
+  ORIGIN_CITY_NAME string,
+  DEST_CITY_NAME string,
+  FL_DATE date,
+  ARR_DELAY float,
+  FL_NUM int
+);
+
+LOAD DATA LOCAL INPATH '../data/files/flights_join.txt' OVERWRITE INTO TABLE union_date_1;
+LOAD DATA LOCAL INPATH '../data/files/flights_join.txt' OVERWRITE INTO TABLE union_date_2;
+
+select * from (
+  select fl_num, fl_date from union_date_1
+  union all
+  select fl_num, fl_date from union_date_2
+) union_result order by fl_date, fl_num;
+
+drop table union_date_1;
+drop table union_date_2;
+
+

Added: hive/trunk/ql/src/test/results/clientnegative/date_literal1.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientnegative/date_literal1.q.out?rev=1507713&view=auto
==============================================================================
--- hive/trunk/ql/src/test/results/clientnegative/date_literal1.q.out (added)
+++ hive/trunk/ql/src/test/results/clientnegative/date_literal1.q.out Sat Jul 27 21:20:03 2013
@@ -0,0 +1 @@
+FAILED: SemanticException Unable to convert date literal string to date value.

Added: hive/trunk/ql/src/test/results/clientnegative/date_literal2.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientnegative/date_literal2.q.out?rev=1507713&view=auto
==============================================================================
--- hive/trunk/ql/src/test/results/clientnegative/date_literal2.q.out (added)
+++ hive/trunk/ql/src/test/results/clientnegative/date_literal2.q.out Sat Jul 27 21:20:03 2013
@@ -0,0 +1 @@
+FAILED: SemanticException Unable to convert date literal string to date value.

Added: hive/trunk/ql/src/test/results/clientnegative/date_literal3.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientnegative/date_literal3.q.out?rev=1507713&view=auto
==============================================================================
--- hive/trunk/ql/src/test/results/clientnegative/date_literal3.q.out (added)
+++ hive/trunk/ql/src/test/results/clientnegative/date_literal3.q.out Sat Jul 27 21:20:03 2013
@@ -0,0 +1 @@
+FAILED: SemanticException Unable to convert date literal string to date value.

Modified: hive/trunk/ql/src/test/results/clientnegative/invalid_create_tbl1.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientnegative/invalid_create_tbl1.q.out?rev=1507713&r1=1507712&r2=1507713&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientnegative/invalid_create_tbl1.q.out (original)
+++ hive/trunk/ql/src/test/results/clientnegative/invalid_create_tbl1.q.out Sat Jul 27 21:20:03 2013
@@ -1 +1 @@
-FAILED: SemanticException [Error 10099]: DATE and DATETIME types aren't supported yet. Please use TIMESTAMP instead
+FAILED: SemanticException [Error 10099]: DATETIME type isn't supported yet. Please use DATE or TIMESTAMP instead

Modified: hive/trunk/ql/src/test/results/clientnegative/invalid_t_alter1.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientnegative/invalid_t_alter1.q.out?rev=1507713&r1=1507712&r2=1507713&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientnegative/invalid_t_alter1.q.out (original)
+++ hive/trunk/ql/src/test/results/clientnegative/invalid_t_alter1.q.out Sat Jul 27 21:20:03 2013
@@ -3,4 +3,4 @@ PREHOOK: type: CREATETABLE
 POSTHOOK: query: CREATE TABLE alter_test (d STRING)
 POSTHOOK: type: CREATETABLE
 POSTHOOK: Output: default@alter_test
-FAILED: SemanticException [Error 10099]: DATE and DATETIME types aren't supported yet. Please use TIMESTAMP instead
+FAILED: SemanticException [Error 10099]: DATETIME type isn't supported yet. Please use DATE or TIMESTAMP instead

Modified: hive/trunk/ql/src/test/results/clientnegative/invalid_t_alter2.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientnegative/invalid_t_alter2.q.out?rev=1507713&r1=1507712&r2=1507713&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientnegative/invalid_t_alter2.q.out (original)
+++ hive/trunk/ql/src/test/results/clientnegative/invalid_t_alter2.q.out Sat Jul 27 21:20:03 2013
@@ -3,4 +3,4 @@ PREHOOK: type: CREATETABLE
 POSTHOOK: query: CREATE TABLE alter_test (d STRING)
 POSTHOOK: type: CREATETABLE
 POSTHOOK: Output: default@alter_test
-FAILED: SemanticException [Error 10099]: DATE and DATETIME types aren't supported yet. Please use TIMESTAMP instead
+FAILED: SemanticException [Error 10099]: DATETIME type isn't supported yet. Please use DATE or TIMESTAMP instead

Modified: hive/trunk/ql/src/test/results/clientnegative/invalid_t_create2.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientnegative/invalid_t_create2.q.out?rev=1507713&r1=1507712&r2=1507713&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientnegative/invalid_t_create2.q.out (original)
+++ hive/trunk/ql/src/test/results/clientnegative/invalid_t_create2.q.out Sat Jul 27 21:20:03 2013
@@ -1 +1 @@
-FAILED: SemanticException [Error 10099]: DATE and DATETIME types aren't supported yet. Please use TIMESTAMP instead
+FAILED: SemanticException [Error 10099]: DATETIME type isn't supported yet. Please use DATE or TIMESTAMP instead

Modified: hive/trunk/ql/src/test/results/clientnegative/invalid_t_transform.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientnegative/invalid_t_transform.q.out?rev=1507713&r1=1507712&r2=1507713&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientnegative/invalid_t_transform.q.out (original)
+++ hive/trunk/ql/src/test/results/clientnegative/invalid_t_transform.q.out Sat Jul 27 21:20:03 2013
@@ -1 +1 @@
-FAILED: SemanticException [Error 10099]: DATE and DATETIME types aren't supported yet. Please use TIMESTAMP instead
+FAILED: SemanticException [Error 10099]: DATETIME type isn't supported yet. Please use DATE or TIMESTAMP instead

Modified: hive/trunk/ql/src/test/results/clientnegative/serde_regex.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientnegative/serde_regex.q.out?rev=1507713&r1=1507712&r2=1507713&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientnegative/serde_regex.q.out (original)
+++ hive/trunk/ql/src/test/results/clientnegative/serde_regex.q.out Sat Jul 27 21:20:03 2013
@@ -2,7 +2,7 @@ PREHOOK: query: USE default
 PREHOOK: type: SWITCHDATABASE
 POSTHOOK: query: USE default
 POSTHOOK: type: SWITCHDATABASE
-PREHOOK: query: --  This should fail because Regex SerDe doesn't support TIMESTAMP, STRUCT
+PREHOOK: query: --  This should fail because Regex SerDe doesn't support STRUCT
 CREATE TABLE serde_regex(
   host STRING,
   identity STRING,
@@ -19,4 +19,4 @@ WITH SERDEPROPERTIES (
   "input.regex" = "([^ ]*) ([^ ]*) ([^ ]*) (-|\\[[^\\]]*\\]) ([^ \"]*|\"[^\"]*\") (-|[0-9]*) (-|[0-9]*)(?: ([^ \"]*|\"[^\"]*\") ([^ \"]*|\"[^\"]*\"))?")
 STORED AS TEXTFILE
 PREHOOK: type: CREATETABLE
-FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. java.lang.RuntimeException: MetaException(message:org.apache.hadoop.hive.serde2.SerDeException org.apache.hadoop.hive.serde2.RegexSerDe doesn't allow column [3] named time with type timestamp)
+FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. java.lang.RuntimeException: MetaException(message:org.apache.hadoop.hive.serde2.SerDeException org.apache.hadoop.hive.serde2.RegexSerDe doesn't allow column [9] named strct with type struct<a:int,b:string>)

Added: hive/trunk/ql/src/test/results/clientpositive/ctas_date.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/ctas_date.q.out?rev=1507713&view=auto
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/ctas_date.q.out (added)
+++ hive/trunk/ql/src/test/results/clientpositive/ctas_date.q.out Sat Jul 27 21:20:03 2013
@@ -0,0 +1,172 @@
+PREHOOK: query: drop table ctas_date_1
+PREHOOK: type: DROPTABLE
+POSTHOOK: query: drop table ctas_date_1
+POSTHOOK: type: DROPTABLE
+PREHOOK: query: drop table ctas_date_2
+PREHOOK: type: DROPTABLE
+POSTHOOK: query: drop table ctas_date_2
+POSTHOOK: type: DROPTABLE
+PREHOOK: query: drop view ctas_date_3
+PREHOOK: type: DROPVIEW
+POSTHOOK: query: drop view ctas_date_3
+POSTHOOK: type: DROPVIEW
+PREHOOK: query: drop view ctas_date_4
+PREHOOK: type: DROPVIEW
+POSTHOOK: query: drop view ctas_date_4
+POSTHOOK: type: DROPVIEW
+PREHOOK: query: create table ctas_date_1 (key int, value string, dd date)
+PREHOOK: type: CREATETABLE
+POSTHOOK: query: create table ctas_date_1 (key int, value string, dd date)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: default@ctas_date_1
+PREHOOK: query: insert overwrite table ctas_date_1 
+  select key, value, date '2012-01-01' from src sort by key, value limit 5
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+PREHOOK: Output: default@ctas_date_1
+POSTHOOK: query: insert overwrite table ctas_date_1 
+  select key, value, date '2012-01-01' from src sort by key, value limit 5
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+POSTHOOK: Output: default@ctas_date_1
+POSTHOOK: Lineage: ctas_date_1.dd SIMPLE []
+POSTHOOK: Lineage: ctas_date_1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ]
+POSTHOOK: Lineage: ctas_date_1.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ]
+PREHOOK: query: -- create table as with date column
+create table ctas_date_2 as select key, value, dd, date '1980-12-12' from ctas_date_1
+PREHOOK: type: CREATETABLE_AS_SELECT
+PREHOOK: Input: default@ctas_date_1
+POSTHOOK: query: -- create table as with date column
+create table ctas_date_2 as select key, value, dd, date '1980-12-12' from ctas_date_1
+POSTHOOK: type: CREATETABLE_AS_SELECT
+POSTHOOK: Input: default@ctas_date_1
+POSTHOOK: Output: default@ctas_date_2
+POSTHOOK: Lineage: ctas_date_1.dd SIMPLE []
+POSTHOOK: Lineage: ctas_date_1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ]
+POSTHOOK: Lineage: ctas_date_1.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ]
+PREHOOK: query: -- view with date column
+create view ctas_date_3 as select * from ctas_date_2 where dd > date '2000-01-01'
+PREHOOK: type: CREATEVIEW
+POSTHOOK: query: -- view with date column
+create view ctas_date_3 as select * from ctas_date_2 where dd > date '2000-01-01'
+POSTHOOK: type: CREATEVIEW
+POSTHOOK: Output: default@ctas_date_3
+POSTHOOK: Lineage: ctas_date_1.dd SIMPLE []
+POSTHOOK: Lineage: ctas_date_1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ]
+POSTHOOK: Lineage: ctas_date_1.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ]
+PREHOOK: query: create view ctas_date_4 as select * from ctas_date_2 where dd < date '2000-01-01'
+PREHOOK: type: CREATEVIEW
+POSTHOOK: query: create view ctas_date_4 as select * from ctas_date_2 where dd < date '2000-01-01'
+POSTHOOK: type: CREATEVIEW
+POSTHOOK: Output: default@ctas_date_4
+POSTHOOK: Lineage: ctas_date_1.dd SIMPLE []
+POSTHOOK: Lineage: ctas_date_1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ]
+POSTHOOK: Lineage: ctas_date_1.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ]
+PREHOOK: query: select key, value, dd, date '1980-12-12' from ctas_date_1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@ctas_date_1
+#### A masked pattern was here ####
+POSTHOOK: query: select key, value, dd, date '1980-12-12' from ctas_date_1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@ctas_date_1
+#### A masked pattern was here ####
+POSTHOOK: Lineage: ctas_date_1.dd SIMPLE []
+POSTHOOK: Lineage: ctas_date_1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ]
+POSTHOOK: Lineage: ctas_date_1.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ]
+0	val_0	2012-01-01	1980-12-12
+0	val_0	2012-01-01	1980-12-12
+0	val_0	2012-01-01	1980-12-12
+10	val_10	2012-01-01	1980-12-12
+100	val_100	2012-01-01	1980-12-12
+PREHOOK: query: select * from ctas_date_2
+PREHOOK: type: QUERY
+PREHOOK: Input: default@ctas_date_2
+#### A masked pattern was here ####
+POSTHOOK: query: select * from ctas_date_2
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@ctas_date_2
+#### A masked pattern was here ####
+POSTHOOK: Lineage: ctas_date_1.dd SIMPLE []
+POSTHOOK: Lineage: ctas_date_1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ]
+POSTHOOK: Lineage: ctas_date_1.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ]
+0	val_0	2012-01-01	1980-12-12
+0	val_0	2012-01-01	1980-12-12
+0	val_0	2012-01-01	1980-12-12
+10	val_10	2012-01-01	1980-12-12
+100	val_100	2012-01-01	1980-12-12
+PREHOOK: query: select * from ctas_date_3
+PREHOOK: type: QUERY
+PREHOOK: Input: default@ctas_date_2
+PREHOOK: Input: default@ctas_date_3
+#### A masked pattern was here ####
+POSTHOOK: query: select * from ctas_date_3
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@ctas_date_2
+POSTHOOK: Input: default@ctas_date_3
+#### A masked pattern was here ####
+POSTHOOK: Lineage: ctas_date_1.dd SIMPLE []
+POSTHOOK: Lineage: ctas_date_1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ]
+POSTHOOK: Lineage: ctas_date_1.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ]
+0	val_0	2012-01-01	1980-12-12
+0	val_0	2012-01-01	1980-12-12
+0	val_0	2012-01-01	1980-12-12
+10	val_10	2012-01-01	1980-12-12
+100	val_100	2012-01-01	1980-12-12
+PREHOOK: query: select count(*) from ctas_date_4
+PREHOOK: type: QUERY
+PREHOOK: Input: default@ctas_date_2
+PREHOOK: Input: default@ctas_date_4
+#### A masked pattern was here ####
+POSTHOOK: query: select count(*) from ctas_date_4
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@ctas_date_2
+POSTHOOK: Input: default@ctas_date_4
+#### A masked pattern was here ####
+POSTHOOK: Lineage: ctas_date_1.dd SIMPLE []
+POSTHOOK: Lineage: ctas_date_1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ]
+POSTHOOK: Lineage: ctas_date_1.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ]
+0
+PREHOOK: query: drop table ctas_date_1
+PREHOOK: type: DROPTABLE
+PREHOOK: Input: default@ctas_date_1
+PREHOOK: Output: default@ctas_date_1
+POSTHOOK: query: drop table ctas_date_1
+POSTHOOK: type: DROPTABLE
+POSTHOOK: Input: default@ctas_date_1
+POSTHOOK: Output: default@ctas_date_1
+POSTHOOK: Lineage: ctas_date_1.dd SIMPLE []
+POSTHOOK: Lineage: ctas_date_1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ]
+POSTHOOK: Lineage: ctas_date_1.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ]
+PREHOOK: query: drop table ctas_date_2
+PREHOOK: type: DROPTABLE
+PREHOOK: Input: default@ctas_date_2
+PREHOOK: Output: default@ctas_date_2
+POSTHOOK: query: drop table ctas_date_2
+POSTHOOK: type: DROPTABLE
+POSTHOOK: Input: default@ctas_date_2
+POSTHOOK: Output: default@ctas_date_2
+POSTHOOK: Lineage: ctas_date_1.dd SIMPLE []
+POSTHOOK: Lineage: ctas_date_1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ]
+POSTHOOK: Lineage: ctas_date_1.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ]
+PREHOOK: query: drop view ctas_date_3
+PREHOOK: type: DROPVIEW
+PREHOOK: Input: default@ctas_date_3
+PREHOOK: Output: default@ctas_date_3
+POSTHOOK: query: drop view ctas_date_3
+POSTHOOK: type: DROPVIEW
+POSTHOOK: Input: default@ctas_date_3
+POSTHOOK: Output: default@ctas_date_3
+POSTHOOK: Lineage: ctas_date_1.dd SIMPLE []
+POSTHOOK: Lineage: ctas_date_1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ]
+POSTHOOK: Lineage: ctas_date_1.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ]
+PREHOOK: query: drop view ctas_date_4
+PREHOOK: type: DROPVIEW
+PREHOOK: Input: default@ctas_date_4
+PREHOOK: Output: default@ctas_date_4
+POSTHOOK: query: drop view ctas_date_4
+POSTHOOK: type: DROPVIEW
+POSTHOOK: Input: default@ctas_date_4
+POSTHOOK: Output: default@ctas_date_4
+POSTHOOK: Lineage: ctas_date_1.dd SIMPLE []
+POSTHOOK: Lineage: ctas_date_1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ]
+POSTHOOK: Lineage: ctas_date_1.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ]

Added: hive/trunk/ql/src/test/results/clientpositive/date_1.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/date_1.q.out?rev=1507713&view=auto
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/date_1.q.out (added)
+++ hive/trunk/ql/src/test/results/clientpositive/date_1.q.out Sat Jul 27 21:20:03 2013
@@ -0,0 +1,290 @@
+PREHOOK: query: drop table date_1
+PREHOOK: type: DROPTABLE
+POSTHOOK: query: drop table date_1
+POSTHOOK: type: DROPTABLE
+PREHOOK: query: create table date_1 (d date)
+PREHOOK: type: CREATETABLE
+POSTHOOK: query: create table date_1 (d date)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: default@date_1
+PREHOOK: query: insert overwrite table date_1 
+  select cast('2011-01-01' as date) from src limit 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+PREHOOK: Output: default@date_1
+POSTHOOK: query: insert overwrite table date_1 
+  select cast('2011-01-01' as date) from src limit 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+POSTHOOK: Output: default@date_1
+POSTHOOK: Lineage: date_1.d EXPRESSION []
+PREHOOK: query: select * from date_1 limit 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@date_1
+#### A masked pattern was here ####
+POSTHOOK: query: select * from date_1 limit 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@date_1
+#### A masked pattern was here ####
+POSTHOOK: Lineage: date_1.d EXPRESSION []
+2011-01-01
+PREHOOK: query: select d, count(d) from date_1 group by d
+PREHOOK: type: QUERY
+PREHOOK: Input: default@date_1
+#### A masked pattern was here ####
+POSTHOOK: query: select d, count(d) from date_1 group by d
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@date_1
+#### A masked pattern was here ####
+POSTHOOK: Lineage: date_1.d EXPRESSION []
+2011-01-01	1
+PREHOOK: query: insert overwrite table date_1 
+  select date '2011-01-01' from src limit 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+PREHOOK: Output: default@date_1
+POSTHOOK: query: insert overwrite table date_1 
+  select date '2011-01-01' from src limit 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+POSTHOOK: Output: default@date_1
+POSTHOOK: Lineage: date_1.d EXPRESSION []
+POSTHOOK: Lineage: date_1.d SIMPLE []
+PREHOOK: query: select * from date_1 limit 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@date_1
+#### A masked pattern was here ####
+POSTHOOK: query: select * from date_1 limit 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@date_1
+#### A masked pattern was here ####
+POSTHOOK: Lineage: date_1.d EXPRESSION []
+POSTHOOK: Lineage: date_1.d SIMPLE []
+2011-01-01
+PREHOOK: query: select d, count(d) from date_1 group by d
+PREHOOK: type: QUERY
+PREHOOK: Input: default@date_1
+#### A masked pattern was here ####
+POSTHOOK: query: select d, count(d) from date_1 group by d
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@date_1
+#### A masked pattern was here ####
+POSTHOOK: Lineage: date_1.d EXPRESSION []
+POSTHOOK: Lineage: date_1.d SIMPLE []
+2011-01-01	1
+PREHOOK: query: insert overwrite table date_1 
+  select cast(cast('2011-01-01 00:00:00' as timestamp) as date) from src limit 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+PREHOOK: Output: default@date_1
+POSTHOOK: query: insert overwrite table date_1 
+  select cast(cast('2011-01-01 00:00:00' as timestamp) as date) from src limit 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+POSTHOOK: Output: default@date_1
+POSTHOOK: Lineage: date_1.d EXPRESSION []
+POSTHOOK: Lineage: date_1.d SIMPLE []
+POSTHOOK: Lineage: date_1.d EXPRESSION []
+PREHOOK: query: select * from date_1 limit 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@date_1
+#### A masked pattern was here ####
+POSTHOOK: query: select * from date_1 limit 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@date_1
+#### A masked pattern was here ####
+POSTHOOK: Lineage: date_1.d EXPRESSION []
+POSTHOOK: Lineage: date_1.d SIMPLE []
+POSTHOOK: Lineage: date_1.d EXPRESSION []
+2011-01-01
+PREHOOK: query: select d, count(d) from date_1 group by d
+PREHOOK: type: QUERY
+PREHOOK: Input: default@date_1
+#### A masked pattern was here ####
+POSTHOOK: query: select d, count(d) from date_1 group by d
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@date_1
+#### A masked pattern was here ####
+POSTHOOK: Lineage: date_1.d EXPRESSION []
+POSTHOOK: Lineage: date_1.d SIMPLE []
+POSTHOOK: Lineage: date_1.d EXPRESSION []
+2011-01-01	1
+PREHOOK: query: -- Valid casts
+select 
+  cast('2012-01-01' as string), 
+  cast(d as string), 
+  cast(d as timestamp), 
+  cast(cast(d as timestamp) as date), 
+  cast(d as date)
+from date_1 limit 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@date_1
+#### A masked pattern was here ####
+POSTHOOK: query: -- Valid casts
+select 
+  cast('2012-01-01' as string), 
+  cast(d as string), 
+  cast(d as timestamp), 
+  cast(cast(d as timestamp) as date), 
+  cast(d as date)
+from date_1 limit 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@date_1
+#### A masked pattern was here ####
+POSTHOOK: Lineage: date_1.d EXPRESSION []
+POSTHOOK: Lineage: date_1.d SIMPLE []
+POSTHOOK: Lineage: date_1.d EXPRESSION []
+2012-01-01	2011-01-01	2011-01-01 00:00:00	2011-01-01	2011-01-01
+PREHOOK: query: -- Invalid casts. 
+select 
+  cast(d as boolean), 
+  cast(d as tinyint),
+  cast(d as smallint),
+  cast(d as int),
+  cast(d as bigint),
+  cast(d as float),
+  cast(d as double)
+from date_1 limit 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@date_1
+#### A masked pattern was here ####
+POSTHOOK: query: -- Invalid casts. 
+select 
+  cast(d as boolean), 
+  cast(d as tinyint),
+  cast(d as smallint),
+  cast(d as int),
+  cast(d as bigint),
+  cast(d as float),
+  cast(d as double)
+from date_1 limit 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@date_1
+#### A masked pattern was here ####
+POSTHOOK: Lineage: date_1.d EXPRESSION []
+POSTHOOK: Lineage: date_1.d SIMPLE []
+POSTHOOK: Lineage: date_1.d EXPRESSION []
+NULL	NULL	NULL	NULL	NULL	NULL	NULL
+PREHOOK: query: -- These comparisons should all be true
+select 
+  date '2011-01-01' = date '2011-01-01',
+  unix_timestamp(date '2011-01-01') = unix_timestamp(date '2011-01-01'),
+  unix_timestamp(date '2011-01-01') = unix_timestamp(cast(date '2011-01-01' as timestamp)),
+  unix_timestamp(date '2011-01-01') = unix_timestamp(cast(cast('2011-01-01 12:13:14' as timestamp) as date)),
+  unix_timestamp(date '2011-01-01') < unix_timestamp(cast('2011-01-01 00:00:01' as timestamp)),
+  unix_timestamp(date '2011-01-01') = unix_timestamp(cast('2011-01-01 00:00:00' as timestamp)),
+  unix_timestamp(date '2011-01-01') > unix_timestamp(cast('2010-12-31 23:59:59' as timestamp)),
+  date '2011-01-01' = cast(timestamp('2011-01-01 23:24:25') as date),
+  '2011-01-01' = cast(d as string),
+  '2011-01-01' = cast(date '2011-01-01' as string)
+from date_1 limit 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@date_1
+#### A masked pattern was here ####
+POSTHOOK: query: -- These comparisons should all be true
+select 
+  date '2011-01-01' = date '2011-01-01',
+  unix_timestamp(date '2011-01-01') = unix_timestamp(date '2011-01-01'),
+  unix_timestamp(date '2011-01-01') = unix_timestamp(cast(date '2011-01-01' as timestamp)),
+  unix_timestamp(date '2011-01-01') = unix_timestamp(cast(cast('2011-01-01 12:13:14' as timestamp) as date)),
+  unix_timestamp(date '2011-01-01') < unix_timestamp(cast('2011-01-01 00:00:01' as timestamp)),
+  unix_timestamp(date '2011-01-01') = unix_timestamp(cast('2011-01-01 00:00:00' as timestamp)),
+  unix_timestamp(date '2011-01-01') > unix_timestamp(cast('2010-12-31 23:59:59' as timestamp)),
+  date '2011-01-01' = cast(timestamp('2011-01-01 23:24:25') as date),
+  '2011-01-01' = cast(d as string),
+  '2011-01-01' = cast(date '2011-01-01' as string)
+from date_1 limit 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@date_1
+#### A masked pattern was here ####
+POSTHOOK: Lineage: date_1.d EXPRESSION []
+POSTHOOK: Lineage: date_1.d SIMPLE []
+POSTHOOK: Lineage: date_1.d EXPRESSION []
+true	true	true	true	true	true	true	true	true	true
+PREHOOK: query: select 
+  date('2001-01-28'),
+  date('2001-02-28'),
+  date('2001-03-28'),
+  date('2001-04-28'),
+  date('2001-05-28'),
+  date('2001-06-28'),
+  date('2001-07-28'),
+  date('2001-08-28'),
+  date('2001-09-28'),
+  date('2001-10-28'),
+  date('2001-11-28'),
+  date('2001-12-28')
+from date_1 limit 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@date_1
+#### A masked pattern was here ####
+POSTHOOK: query: select 
+  date('2001-01-28'),
+  date('2001-02-28'),
+  date('2001-03-28'),
+  date('2001-04-28'),
+  date('2001-05-28'),
+  date('2001-06-28'),
+  date('2001-07-28'),
+  date('2001-08-28'),
+  date('2001-09-28'),
+  date('2001-10-28'),
+  date('2001-11-28'),
+  date('2001-12-28')
+from date_1 limit 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@date_1
+#### A masked pattern was here ####
+POSTHOOK: Lineage: date_1.d EXPRESSION []
+POSTHOOK: Lineage: date_1.d SIMPLE []
+POSTHOOK: Lineage: date_1.d EXPRESSION []
+2001-01-28	2001-02-28	2001-03-28	2001-04-28	2001-05-28	2001-06-28	2001-07-28	2001-08-28	2001-09-28	2001-10-28	2001-11-28	2001-12-28
+PREHOOK: query: select 
+  unix_timestamp(date('2001-01-28')) = unix_timestamp(cast('2001-01-28 0:0:0' as timestamp)),
+  unix_timestamp(date('2001-02-28')) = unix_timestamp(cast('2001-02-28 0:0:0' as timestamp)),
+  unix_timestamp(date('2001-03-28')) = unix_timestamp(cast('2001-03-28 0:0:0' as timestamp)),
+  unix_timestamp(date('2001-04-28')) = unix_timestamp(cast('2001-04-28 0:0:0' as timestamp)),
+  unix_timestamp(date('2001-05-28')) = unix_timestamp(cast('2001-05-28 0:0:0' as timestamp)),
+  unix_timestamp(date('2001-06-28')) = unix_timestamp(cast('2001-06-28 0:0:0' as timestamp)),
+  unix_timestamp(date('2001-07-28')) = unix_timestamp(cast('2001-07-28 0:0:0' as timestamp)),
+  unix_timestamp(date('2001-08-28')) = unix_timestamp(cast('2001-08-28 0:0:0' as timestamp)),
+  unix_timestamp(date('2001-09-28')) = unix_timestamp(cast('2001-09-28 0:0:0' as timestamp)),
+  unix_timestamp(date('2001-10-28')) = unix_timestamp(cast('2001-10-28 0:0:0' as timestamp)),
+  unix_timestamp(date('2001-11-28')) = unix_timestamp(cast('2001-11-28 0:0:0' as timestamp)),
+  unix_timestamp(date('2001-12-28')) = unix_timestamp(cast('2001-12-28 0:0:0' as timestamp))
+from date_1 limit 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@date_1
+#### A masked pattern was here ####
+POSTHOOK: query: select 
+  unix_timestamp(date('2001-01-28')) = unix_timestamp(cast('2001-01-28 0:0:0' as timestamp)),
+  unix_timestamp(date('2001-02-28')) = unix_timestamp(cast('2001-02-28 0:0:0' as timestamp)),
+  unix_timestamp(date('2001-03-28')) = unix_timestamp(cast('2001-03-28 0:0:0' as timestamp)),
+  unix_timestamp(date('2001-04-28')) = unix_timestamp(cast('2001-04-28 0:0:0' as timestamp)),
+  unix_timestamp(date('2001-05-28')) = unix_timestamp(cast('2001-05-28 0:0:0' as timestamp)),
+  unix_timestamp(date('2001-06-28')) = unix_timestamp(cast('2001-06-28 0:0:0' as timestamp)),
+  unix_timestamp(date('2001-07-28')) = unix_timestamp(cast('2001-07-28 0:0:0' as timestamp)),
+  unix_timestamp(date('2001-08-28')) = unix_timestamp(cast('2001-08-28 0:0:0' as timestamp)),
+  unix_timestamp(date('2001-09-28')) = unix_timestamp(cast('2001-09-28 0:0:0' as timestamp)),
+  unix_timestamp(date('2001-10-28')) = unix_timestamp(cast('2001-10-28 0:0:0' as timestamp)),
+  unix_timestamp(date('2001-11-28')) = unix_timestamp(cast('2001-11-28 0:0:0' as timestamp)),
+  unix_timestamp(date('2001-12-28')) = unix_timestamp(cast('2001-12-28 0:0:0' as timestamp))
+from date_1 limit 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@date_1
+#### A masked pattern was here ####
+POSTHOOK: Lineage: date_1.d EXPRESSION []
+POSTHOOK: Lineage: date_1.d SIMPLE []
+POSTHOOK: Lineage: date_1.d EXPRESSION []
+true	true	true	true	true	true	true	true	true	true	true	true
+PREHOOK: query: drop table date_1
+PREHOOK: type: DROPTABLE
+PREHOOK: Input: default@date_1
+PREHOOK: Output: default@date_1
+POSTHOOK: query: drop table date_1
+POSTHOOK: type: DROPTABLE
+POSTHOOK: Input: default@date_1
+POSTHOOK: Output: default@date_1
+POSTHOOK: Lineage: date_1.d EXPRESSION []
+POSTHOOK: Lineage: date_1.d SIMPLE []
+POSTHOOK: Lineage: date_1.d EXPRESSION []

Added: hive/trunk/ql/src/test/results/clientpositive/date_2.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/date_2.q.out?rev=1507713&view=auto
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/date_2.q.out (added)
+++ hive/trunk/ql/src/test/results/clientpositive/date_2.q.out Sat Jul 27 21:20:03 2013
@@ -0,0 +1,345 @@
+PREHOOK: query: drop table if exists date_2
+PREHOOK: type: DROPTABLE
+POSTHOOK: query: drop table if exists date_2
+POSTHOOK: type: DROPTABLE
+PREHOOK: query: create table date_2 (
+  ORIGIN_CITY_NAME string,
+  DEST_CITY_NAME string,
+  FL_DATE date,
+  ARR_DELAY float,
+  FL_NUM int
+)
+PREHOOK: type: CREATETABLE
+POSTHOOK: query: create table date_2 (
+  ORIGIN_CITY_NAME string,
+  DEST_CITY_NAME string,
+  FL_DATE date,
+  ARR_DELAY float,
+  FL_NUM int
+)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: default@date_2
+PREHOOK: query: LOAD DATA LOCAL INPATH '../data/files/flights_tiny.txt.1' OVERWRITE INTO TABLE date_2
+PREHOOK: type: LOAD
+PREHOOK: Output: default@date_2
+POSTHOOK: query: LOAD DATA LOCAL INPATH '../data/files/flights_tiny.txt.1' OVERWRITE INTO TABLE date_2
+POSTHOOK: type: LOAD
+POSTHOOK: Output: default@date_2
+PREHOOK: query: select fl_date, fl_num from date_2 order by fl_date asc, fl_num desc
+PREHOOK: type: QUERY
+PREHOOK: Input: default@date_2
+#### A masked pattern was here ####
+POSTHOOK: query: select fl_date, fl_num from date_2 order by fl_date asc, fl_num desc
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@date_2
+#### A masked pattern was here ####
+2010-10-20	7291
+2010-10-20	3198
+2010-10-20	3014
+2010-10-20	2630
+2010-10-20	1610
+2010-10-20	1599
+2010-10-20	1531
+2010-10-20	1142
+2010-10-20	1064
+2010-10-20	897
+2010-10-20	361
+2010-10-21	7291
+2010-10-21	3198
+2010-10-21	3014
+2010-10-21	2646
+2010-10-21	2630
+2010-10-21	1610
+2010-10-21	1599
+2010-10-21	1531
+2010-10-21	1142
+2010-10-21	1064
+2010-10-21	897
+2010-10-21	361
+2010-10-22	3198
+2010-10-22	3014
+2010-10-22	2646
+2010-10-22	2630
+2010-10-22	1610
+2010-10-22	1599
+2010-10-22	1531
+2010-10-22	1142
+2010-10-22	1064
+2010-10-22	897
+2010-10-22	361
+2010-10-23	7274
+2010-10-23	5917
+2010-10-23	5904
+2010-10-23	5832
+2010-10-23	3171
+2010-10-23	3085
+2010-10-23	2932
+2010-10-23	1805
+2010-10-23	650
+2010-10-23	426
+2010-10-23	384
+2010-10-23	272
+2010-10-24	7282
+2010-10-24	3198
+2010-10-24	3014
+2010-10-24	2646
+2010-10-24	2630
+2010-10-24	2571
+2010-10-24	2254
+2010-10-24	1610
+2010-10-24	1599
+2010-10-24	1531
+2010-10-24	897
+2010-10-24	361
+2010-10-25	7291
+2010-10-25	3198
+2010-10-25	3014
+2010-10-25	2646
+2010-10-25	2630
+2010-10-25	1610
+2010-10-25	1599
+2010-10-25	1531
+2010-10-25	1142
+2010-10-25	1064
+2010-10-25	897
+2010-10-25	361
+2010-10-26	7291
+2010-10-26	3198
+2010-10-26	3014
+2010-10-26	2662
+2010-10-26	2646
+2010-10-26	2630
+2010-10-26	1610
+2010-10-26	1599
+2010-10-26	1531
+2010-10-26	1142
+2010-10-26	1064
+2010-10-26	897
+2010-10-26	361
+2010-10-27	7291
+2010-10-27	3198
+2010-10-27	3014
+2010-10-27	2630
+2010-10-27	1610
+2010-10-27	1599
+2010-10-27	1531
+2010-10-27	1142
+2010-10-27	1064
+2010-10-27	897
+2010-10-27	361
+2010-10-28	7291
+2010-10-28	3198
+2010-10-28	3014
+2010-10-28	2646
+2010-10-28	2630
+2010-10-28	1610
+2010-10-28	1599
+2010-10-28	1531
+2010-10-28	1142
+2010-10-28	1064
+2010-10-28	897
+2010-10-28	361
+2010-10-29	7291
+2010-10-29	3198
+2010-10-29	3014
+2010-10-29	2646
+2010-10-29	2630
+2010-10-29	1610
+2010-10-29	1599
+2010-10-29	1531
+2010-10-29	1142
+2010-10-29	1064
+2010-10-29	897
+2010-10-29	361
+2010-10-30	5917
+2010-10-30	5904
+2010-10-30	3171
+2010-10-30	3085
+2010-10-30	2932
+2010-10-30	2018
+2010-10-30	1805
+2010-10-30	650
+2010-10-30	426
+2010-10-30	384
+2010-10-30	272
+2010-10-31	7282
+2010-10-31	3198
+2010-10-31	2571
+2010-10-31	1610
+2010-10-31	1599
+2010-10-31	1531
+2010-10-31	897
+2010-10-31	361
+PREHOOK: query: select fl_date, fl_num from date_2 order by fl_date desc, fl_num asc
+PREHOOK: type: QUERY
+PREHOOK: Input: default@date_2
+#### A masked pattern was here ####
+POSTHOOK: query: select fl_date, fl_num from date_2 order by fl_date desc, fl_num asc
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@date_2
+#### A masked pattern was here ####
+2010-10-31	361
+2010-10-31	897
+2010-10-31	1531
+2010-10-31	1599
+2010-10-31	1610
+2010-10-31	2571
+2010-10-31	3198
+2010-10-31	7282
+2010-10-30	272
+2010-10-30	384
+2010-10-30	426
+2010-10-30	650
+2010-10-30	1805
+2010-10-30	2018
+2010-10-30	2932
+2010-10-30	3085
+2010-10-30	3171
+2010-10-30	5904
+2010-10-30	5917
+2010-10-29	361
+2010-10-29	897
+2010-10-29	1064
+2010-10-29	1142
+2010-10-29	1531
+2010-10-29	1599
+2010-10-29	1610
+2010-10-29	2630
+2010-10-29	2646
+2010-10-29	3014
+2010-10-29	3198
+2010-10-29	7291
+2010-10-28	361
+2010-10-28	897
+2010-10-28	1064
+2010-10-28	1142
+2010-10-28	1531
+2010-10-28	1599
+2010-10-28	1610
+2010-10-28	2630
+2010-10-28	2646
+2010-10-28	3014
+2010-10-28	3198
+2010-10-28	7291
+2010-10-27	361
+2010-10-27	897
+2010-10-27	1064
+2010-10-27	1142
+2010-10-27	1531
+2010-10-27	1599
+2010-10-27	1610
+2010-10-27	2630
+2010-10-27	3014
+2010-10-27	3198
+2010-10-27	7291
+2010-10-26	361
+2010-10-26	897
+2010-10-26	1064
+2010-10-26	1142
+2010-10-26	1531
+2010-10-26	1599
+2010-10-26	1610
+2010-10-26	2630
+2010-10-26	2646
+2010-10-26	2662
+2010-10-26	3014
+2010-10-26	3198
+2010-10-26	7291
+2010-10-25	361
+2010-10-25	897
+2010-10-25	1064
+2010-10-25	1142
+2010-10-25	1531
+2010-10-25	1599
+2010-10-25	1610
+2010-10-25	2630
+2010-10-25	2646
+2010-10-25	3014
+2010-10-25	3198
+2010-10-25	7291
+2010-10-24	361
+2010-10-24	897
+2010-10-24	1531
+2010-10-24	1599
+2010-10-24	1610
+2010-10-24	2254
+2010-10-24	2571
+2010-10-24	2630
+2010-10-24	2646
+2010-10-24	3014
+2010-10-24	3198
+2010-10-24	7282
+2010-10-23	272
+2010-10-23	384
+2010-10-23	426
+2010-10-23	650
+2010-10-23	1805
+2010-10-23	2932
+2010-10-23	3085
+2010-10-23	3171
+2010-10-23	5832
+2010-10-23	5904
+2010-10-23	5917
+2010-10-23	7274
+2010-10-22	361
+2010-10-22	897
+2010-10-22	1064
+2010-10-22	1142
+2010-10-22	1531
+2010-10-22	1599
+2010-10-22	1610
+2010-10-22	2630
+2010-10-22	2646
+2010-10-22	3014
+2010-10-22	3198
+2010-10-21	361
+2010-10-21	897
+2010-10-21	1064
+2010-10-21	1142
+2010-10-21	1531
+2010-10-21	1599
+2010-10-21	1610
+2010-10-21	2630
+2010-10-21	2646
+2010-10-21	3014
+2010-10-21	3198
+2010-10-21	7291
+2010-10-20	361
+2010-10-20	897
+2010-10-20	1064
+2010-10-20	1142
+2010-10-20	1531
+2010-10-20	1599
+2010-10-20	1610
+2010-10-20	2630
+2010-10-20	3014
+2010-10-20	3198
+2010-10-20	7291
+PREHOOK: query: select fl_date, count(*) from date_2 group by fl_date
+PREHOOK: type: QUERY
+PREHOOK: Input: default@date_2
+#### A masked pattern was here ####
+POSTHOOK: query: select fl_date, count(*) from date_2 group by fl_date
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@date_2
+#### A masked pattern was here ####
+2010-10-20	11
+2010-10-21	12
+2010-10-22	11
+2010-10-23	12
+2010-10-24	12
+2010-10-25	12
+2010-10-26	13
+2010-10-27	11
+2010-10-28	12
+2010-10-29	12
+2010-10-30	11
+2010-10-31	8
+PREHOOK: query: drop table date_2
+PREHOOK: type: DROPTABLE
+PREHOOK: Input: default@date_2
+PREHOOK: Output: default@date_2
+POSTHOOK: query: drop table date_2
+POSTHOOK: type: DROPTABLE
+POSTHOOK: Input: default@date_2
+POSTHOOK: Output: default@date_2

Added: hive/trunk/ql/src/test/results/clientpositive/date_3.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/date_3.q.out?rev=1507713&view=auto
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/date_3.q.out (added)
+++ hive/trunk/ql/src/test/results/clientpositive/date_3.q.out Sat Jul 27 21:20:03 2013
@@ -0,0 +1,54 @@
+PREHOOK: query: drop table date_3
+PREHOOK: type: DROPTABLE
+POSTHOOK: query: drop table date_3
+POSTHOOK: type: DROPTABLE
+PREHOOK: query: create table date_3 (
+  c1 int
+)
+PREHOOK: type: CREATETABLE
+POSTHOOK: query: create table date_3 (
+  c1 int
+)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: default@date_3
+PREHOOK: query: alter table date_3 add columns (c2 date)
+PREHOOK: type: ALTERTABLE_ADDCOLS
+PREHOOK: Input: default@date_3
+PREHOOK: Output: default@date_3
+POSTHOOK: query: alter table date_3 add columns (c2 date)
+POSTHOOK: type: ALTERTABLE_ADDCOLS
+POSTHOOK: Input: default@date_3
+POSTHOOK: Output: default@date_3
+PREHOOK: query: insert overwrite table date_3
+  select 1, cast(cast('2011-01-01 00:00:00' as timestamp) as date) from src limit 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+PREHOOK: Output: default@date_3
+POSTHOOK: query: insert overwrite table date_3
+  select 1, cast(cast('2011-01-01 00:00:00' as timestamp) as date) from src limit 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+POSTHOOK: Output: default@date_3
+POSTHOOK: Lineage: date_3.c1 SIMPLE []
+POSTHOOK: Lineage: date_3.c2 EXPRESSION []
+PREHOOK: query: select * from date_3
+PREHOOK: type: QUERY
+PREHOOK: Input: default@date_3
+#### A masked pattern was here ####
+POSTHOOK: query: select * from date_3
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@date_3
+#### A masked pattern was here ####
+POSTHOOK: Lineage: date_3.c1 SIMPLE []
+POSTHOOK: Lineage: date_3.c2 EXPRESSION []
+1	2011-01-01
+PREHOOK: query: drop table date_3
+PREHOOK: type: DROPTABLE
+PREHOOK: Input: default@date_3
+PREHOOK: Output: default@date_3
+POSTHOOK: query: drop table date_3
+POSTHOOK: type: DROPTABLE
+POSTHOOK: Input: default@date_3
+POSTHOOK: Output: default@date_3
+POSTHOOK: Lineage: date_3.c1 SIMPLE []
+POSTHOOK: Lineage: date_3.c2 EXPRESSION []

Added: hive/trunk/ql/src/test/results/clientpositive/date_4.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/date_4.q.out?rev=1507713&view=auto
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/date_4.q.out (added)
+++ hive/trunk/ql/src/test/results/clientpositive/date_4.q.out Sat Jul 27 21:20:03 2013
@@ -0,0 +1,49 @@
+PREHOOK: query: drop table date_4
+PREHOOK: type: DROPTABLE
+POSTHOOK: query: drop table date_4
+POSTHOOK: type: DROPTABLE
+PREHOOK: query: create table date_4 (d date)
+PREHOOK: type: CREATETABLE
+POSTHOOK: query: create table date_4 (d date)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: default@date_4
+PREHOOK: query: alter table date_4 set serde 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe'
+PREHOOK: type: ALTERTABLE_SERIALIZER
+PREHOOK: Input: default@date_4
+PREHOOK: Output: default@date_4
+POSTHOOK: query: alter table date_4 set serde 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe'
+POSTHOOK: type: ALTERTABLE_SERIALIZER
+POSTHOOK: Input: default@date_4
+POSTHOOK: Output: default@date_4
+PREHOOK: query: -- Test date literal syntax
+insert overwrite table date_4 
+  select date '2011-01-01' from src limit 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+PREHOOK: Output: default@date_4
+POSTHOOK: query: -- Test date literal syntax
+insert overwrite table date_4 
+  select date '2011-01-01' from src limit 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+POSTHOOK: Output: default@date_4
+POSTHOOK: Lineage: date_4.d SIMPLE []
+PREHOOK: query: select d, date '2011-01-01' from date_4 limit 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@date_4
+#### A masked pattern was here ####
+POSTHOOK: query: select d, date '2011-01-01' from date_4 limit 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@date_4
+#### A masked pattern was here ####
+POSTHOOK: Lineage: date_4.d SIMPLE []
+2011-01-01	2011-01-01
+PREHOOK: query: drop table date_4
+PREHOOK: type: DROPTABLE
+PREHOOK: Input: default@date_4
+PREHOOK: Output: default@date_4
+POSTHOOK: query: drop table date_4
+POSTHOOK: type: DROPTABLE
+POSTHOOK: Input: default@date_4
+POSTHOOK: Output: default@date_4
+POSTHOOK: Lineage: date_4.d SIMPLE []

Added: hive/trunk/ql/src/test/results/clientpositive/date_comparison.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/date_comparison.q.out?rev=1507713&view=auto
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/date_comparison.q.out (added)
+++ hive/trunk/ql/src/test/results/clientpositive/date_comparison.q.out Sat Jul 27 21:20:03 2013
@@ -0,0 +1,136 @@
+PREHOOK: query: -- Comparisons against same value
+select cast('2011-05-06' as date) > 
+  cast('2011-05-06' as date) from src limit 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: -- Comparisons against same value
+select cast('2011-05-06' as date) > 
+  cast('2011-05-06' as date) from src limit 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+false
+PREHOOK: query: select cast('2011-05-06' as date) <
+  cast('2011-05-06' as date) from src limit 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: select cast('2011-05-06' as date) <
+  cast('2011-05-06' as date) from src limit 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+false
+PREHOOK: query: select cast('2011-05-06' as date) = 
+  cast('2011-05-06' as date) from src limit 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: select cast('2011-05-06' as date) = 
+  cast('2011-05-06' as date) from src limit 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+true
+PREHOOK: query: select cast('2011-05-06' as date) <>
+  cast('2011-05-06' as date) from src limit 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: select cast('2011-05-06' as date) <>
+  cast('2011-05-06' as date) from src limit 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+false
+PREHOOK: query: select cast('2011-05-06' as date) >=
+  cast('2011-05-06' as date) from src limit 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: select cast('2011-05-06' as date) >=
+  cast('2011-05-06' as date) from src limit 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+true
+PREHOOK: query: select cast('2011-05-06' as date) <=
+  cast('2011-05-06' as date) from src limit 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: select cast('2011-05-06' as date) <=
+  cast('2011-05-06' as date) from src limit 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+true
+PREHOOK: query: -- Now try with differing values
+select cast('2011-05-05' as date) > 
+  cast('2011-05-06' as date) from src limit 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: -- Now try with differing values
+select cast('2011-05-05' as date) > 
+  cast('2011-05-06' as date) from src limit 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+false
+PREHOOK: query: select cast('2011-05-05' as date) <
+  cast('2011-05-06' as date) from src limit 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: select cast('2011-05-05' as date) <
+  cast('2011-05-06' as date) from src limit 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+true
+PREHOOK: query: select cast('2011-05-05' as date) = 
+  cast('2011-05-06' as date) from src limit 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: select cast('2011-05-05' as date) = 
+  cast('2011-05-06' as date) from src limit 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+false
+PREHOOK: query: select cast('2011-05-05' as date) <>
+  cast('2011-05-06' as date) from src limit 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: select cast('2011-05-05' as date) <>
+  cast('2011-05-06' as date) from src limit 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+true
+PREHOOK: query: select cast('2011-05-05' as date) >=
+  cast('2011-05-06' as date) from src limit 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: select cast('2011-05-05' as date) >=
+  cast('2011-05-06' as date) from src limit 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+false
+PREHOOK: query: select cast('2011-05-05' as date) <=
+  cast('2011-05-06' as date) from src limit 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: select cast('2011-05-05' as date) <=
+  cast('2011-05-06' as date) from src limit 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+true

Added: hive/trunk/ql/src/test/results/clientpositive/date_join1.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/date_join1.q.out?rev=1507713&view=auto
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/date_join1.q.out (added)
+++ hive/trunk/ql/src/test/results/clientpositive/date_join1.q.out Sat Jul 27 21:20:03 2013
@@ -0,0 +1,73 @@
+PREHOOK: query: drop table date_join1
+PREHOOK: type: DROPTABLE
+POSTHOOK: query: drop table date_join1
+POSTHOOK: type: DROPTABLE
+PREHOOK: query: create table date_join1 (
+  ORIGIN_CITY_NAME string,
+  DEST_CITY_NAME string,
+  FL_DATE date,
+  ARR_DELAY float,
+  FL_NUM int
+)
+PREHOOK: type: CREATETABLE
+POSTHOOK: query: create table date_join1 (
+  ORIGIN_CITY_NAME string,
+  DEST_CITY_NAME string,
+  FL_DATE date,
+  ARR_DELAY float,
+  FL_NUM int
+)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: default@date_join1
+PREHOOK: query: LOAD DATA LOCAL INPATH '../data/files/flights_join.txt' OVERWRITE INTO TABLE date_join1
+PREHOOK: type: LOAD
+PREHOOK: Output: default@date_join1
+POSTHOOK: query: LOAD DATA LOCAL INPATH '../data/files/flights_join.txt' OVERWRITE INTO TABLE date_join1
+POSTHOOK: type: LOAD
+POSTHOOK: Output: default@date_join1
+PREHOOK: query: -- Note that there are 2 rows with date 2000-11-28, so we should expect 4 rows with that date in the join results
+select t1.fl_num, t1.fl_date, t2.fl_num, t2.fl_date
+  from date_join1 t1 
+  join date_join1 t2 
+  on (t1.fl_date = t2.fl_date)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@date_join1
+#### A masked pattern was here ####
+POSTHOOK: query: -- Note that there are 2 rows with date 2000-11-28, so we should expect 4 rows with that date in the join results
+select t1.fl_num, t1.fl_date, t2.fl_num, t2.fl_date
+  from date_join1 t1 
+  join date_join1 t2 
+  on (t1.fl_date = t2.fl_date)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@date_join1
+#### A masked pattern was here ####
+1064	2000-11-20	1064	2000-11-20
+1142	2000-11-21	1142	2000-11-21
+1599	2000-11-22	1599	2000-11-22
+361	2000-11-23	361	2000-11-23
+897	2000-11-24	897	2000-11-24
+1531	2000-11-25	1531	2000-11-25
+1610	2000-11-26	1610	2000-11-26
+3198	2000-11-27	3198	2000-11-27
+1142	2000-11-28	1064	2000-11-28
+1142	2000-11-28	1142	2000-11-28
+1064	2000-11-28	1064	2000-11-28
+1064	2000-11-28	1142	2000-11-28
+1064	2010-10-20	1064	2010-10-20
+1142	2010-10-21	1142	2010-10-21
+1599	2010-10-22	1599	2010-10-22
+361	2010-10-23	361	2010-10-23
+897	2010-10-24	897	2010-10-24
+1531	2010-10-25	1531	2010-10-25
+1610	2010-10-26	1610	2010-10-26
+3198	2010-10-27	3198	2010-10-27
+1064	2010-10-28	1064	2010-10-28
+1142	2010-10-29	1142	2010-10-29
+PREHOOK: query: drop table date_join1
+PREHOOK: type: DROPTABLE
+PREHOOK: Input: default@date_join1
+PREHOOK: Output: default@date_join1
+POSTHOOK: query: drop table date_join1
+POSTHOOK: type: DROPTABLE
+POSTHOOK: Input: default@date_join1
+POSTHOOK: Output: default@date_join1



Mime
View raw message