hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hashut...@apache.org
Subject svn commit: r1586345 - in /hive/trunk/metastore/scripts/upgrade: oracle/015-HIVE-5700.oracle.sql postgres/015-HIVE-5700.postgres.sql
Date Thu, 10 Apr 2014 15:53:35 GMT
Author: hashutosh
Date: Thu Apr 10 15:53:35 2014
New Revision: 1586345

URL: http://svn.apache.org/r1586345
Log:
HIVE-6882 : Make upgrade script schemaTool friendly (Ashutosh Chauhan via Harish Butani)

Modified:
    hive/trunk/metastore/scripts/upgrade/oracle/015-HIVE-5700.oracle.sql
    hive/trunk/metastore/scripts/upgrade/postgres/015-HIVE-5700.postgres.sql

Modified: hive/trunk/metastore/scripts/upgrade/oracle/015-HIVE-5700.oracle.sql
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/scripts/upgrade/oracle/015-HIVE-5700.oracle.sql?rev=1586345&r1=1586344&r2=1586345&view=diff
==============================================================================
--- hive/trunk/metastore/scripts/upgrade/oracle/015-HIVE-5700.oracle.sql (original)
+++ hive/trunk/metastore/scripts/upgrade/oracle/015-HIVE-5700.oracle.sql Thu Apr 10 15:53:35
2014
@@ -1,15 +1,6 @@
 -- Normalize the date partition column values as best we can. No schema changes.
 
-CREATE FUNCTION hive13_to_date(date_str IN VARCHAR2)
-RETURN DATE
-IS dt DATE;
-BEGIN
-  dt := TO_DATE(date_str, 'YYYY-MM-DD');
-  RETURN dt;
-EXCEPTION
-  WHEN others THEN RETURN null;
-END;
-/
+CREATE FUNCTION hive13_to_date(date_str IN VARCHAR2) RETURN DATE IS dt DATE; BEGIN dt :=
TO_DATE(date_str, 'YYYY-MM-DD'); RETURN dt; EXCEPTION WHEN others THEN RETURN null; END;/
 
 MERGE INTO PARTITION_KEY_VALS
 USING (

Modified: hive/trunk/metastore/scripts/upgrade/postgres/015-HIVE-5700.postgres.sql
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/scripts/upgrade/postgres/015-HIVE-5700.postgres.sql?rev=1586345&r1=1586344&r2=1586345&view=diff
==============================================================================
--- hive/trunk/metastore/scripts/upgrade/postgres/015-HIVE-5700.postgres.sql (original)
+++ hive/trunk/metastore/scripts/upgrade/postgres/015-HIVE-5700.postgres.sql Thu Apr 10 15:53:35
2014
@@ -1,16 +1,7 @@
 SELECT '< HIVE-5700 enforce single date format for partition column storage >';
 
 -- Normalize the date partition column values as best we can. No schema changes.
-
-CREATE FUNCTION hive13_to_date(date_str text) RETURNS DATE AS $$
-DECLARE dt DATE;
-BEGIN
-  dt := date_str::DATE;
-  RETURN dt;
-EXCEPTION
-  WHEN others THEN RETURN null;
-END;
-$$ LANGUAGE plpgsql;
+CREATE FUNCTION hive13_to_date(date_str text) RETURNS DATE AS $$ DECLARE dt DATE; BEGIN dt
:= date_str::DATE; RETURN dt; EXCEPTION WHEN others THEN RETURN null; END; $$ LANGUAGE plpgsql;
 
 UPDATE "PARTITION_KEY_VALS"
 SET "PART_KEY_VAL" = COALESCE(TO_CHAR(hive13_to_date(src."PART_KEY_VAL"),'YYYY-MM-DD'), src."PART_KEY_VAL")



Mime
View raw message