You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by vi...@apache.org on 2019/01/16 20:28:07 UTC
hive git commit: Revert "HIVE-21077 : Database and Catalogs should
have creation time (Vihang Karajgaonkar reviewed by Karthik Manamcheri and
Bharath Krishna)"
Repository: hive
Updated Branches:
refs/heads/master 4d8320d46 -> 4d5d80609
Revert "HIVE-21077 : Database and Catalogs should have creation time (Vihang Karajgaonkar reviewed by Karthik Manamcheri and Bharath Krishna)"
This reverts commit 4d8320d467d30e4e125a3304407415885670f9c7.
Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/4d5d8060
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/4d5d8060
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/4d5d8060
Branch: refs/heads/master
Commit: 4d5d80609608521db3d12916f9900b88a94aff94
Parents: 4d8320d
Author: Vihang Karajgaonkar <vi...@apache.org>
Authored: Wed Jan 16 12:27:56 2019 -0800
Committer: Vihang Karajgaonkar <vi...@apache.org>
Committed: Wed Jan 16 12:27:56 2019 -0800
----------------------------------------------------------------------
.../hadoop/hive/metastore/api/Catalog.java | 111 +------------------
.../hadoop/hive/metastore/api/Database.java | 111 +------------------
.../src/gen/thrift/gen-php/metastore/Types.php | 46 --------
.../gen/thrift/gen-py/hive_metastore/ttypes.py | 30 +----
.../gen/thrift/gen-rb/hive_metastore_types.rb | 8 +-
.../src/main/thrift/hive_metastore.thrift | 10 +-
.../hadoop/hive/metastore/HiveMetaStore.java | 18 +--
.../hive/metastore/MetaStoreDirectSql.java | 3 +-
.../hadoop/hive/metastore/ObjectStore.java | 4 -
.../client/builder/DatabaseBuilder.java | 7 --
.../hadoop/hive/metastore/model/MCatalog.java | 9 --
.../hadoop/hive/metastore/model/MDatabase.java | 9 --
.../src/main/resources/package.jdo | 8 --
.../main/sql/derby/hive-schema-4.0.0.derby.sql | 6 +-
.../sql/derby/upgrade-3.2.0-to-4.0.0.derby.sql | 4 +-
.../main/sql/mssql/hive-schema-4.0.0.mssql.sql | 6 +-
.../sql/mssql/upgrade-3.2.0-to-4.0.0.mssql.sql | 3 -
.../main/sql/mysql/hive-schema-4.0.0.mysql.sql | 2 -
.../sql/mysql/upgrade-3.2.0-to-4.0.0.mysql.sql | 3 -
.../sql/oracle/hive-schema-4.0.0.oracle.sql | 4 +-
.../oracle/upgrade-3.2.0-to-4.0.0.oracle.sql | 3 -
.../sql/postgres/hive-schema-4.0.0.postgres.sql | 6 +-
.../upgrade-3.2.0-to-4.0.0.postgres.sql | 3 -
.../hive/metastore/cache/TestCachedStore.java | 1 -
.../hive/metastore/client/TestCatalogs.java | 2 -
.../hive/metastore/client/TestDatabases.java | 29 -----
.../tools/TestSchemaToolForMetastore.java | 27 ++---
27 files changed, 42 insertions(+), 431 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hive/blob/4d5d8060/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Catalog.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Catalog.java b/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Catalog.java
index 3e968dc..3eb4dbd 100644
--- a/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Catalog.java
+++ b/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Catalog.java
@@ -41,7 +41,6 @@ import org.slf4j.LoggerFactory;
private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("description", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.protocol.TField LOCATION_URI_FIELD_DESC = new org.apache.thrift.protocol.TField("locationUri", org.apache.thrift.protocol.TType.STRING, (short)3);
- private static final org.apache.thrift.protocol.TField CREATE_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("createTime", org.apache.thrift.protocol.TType.I32, (short)4);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
@@ -52,14 +51,12 @@ import org.slf4j.LoggerFactory;
private String name; // required
private String description; // optional
private String locationUri; // required
- private int createTime; // optional
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
NAME((short)1, "name"),
DESCRIPTION((short)2, "description"),
- LOCATION_URI((short)3, "locationUri"),
- CREATE_TIME((short)4, "createTime");
+ LOCATION_URI((short)3, "locationUri");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -80,8 +77,6 @@ import org.slf4j.LoggerFactory;
return DESCRIPTION;
case 3: // LOCATION_URI
return LOCATION_URI;
- case 4: // CREATE_TIME
- return CREATE_TIME;
default:
return null;
}
@@ -122,9 +117,7 @@ import org.slf4j.LoggerFactory;
}
// isset id assignments
- private static final int __CREATETIME_ISSET_ID = 0;
- private byte __isset_bitfield = 0;
- private static final _Fields optionals[] = {_Fields.DESCRIPTION,_Fields.CREATE_TIME};
+ private static final _Fields optionals[] = {_Fields.DESCRIPTION};
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
@@ -134,8 +127,6 @@ import org.slf4j.LoggerFactory;
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.LOCATION_URI, new org.apache.thrift.meta_data.FieldMetaData("locationUri", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.CREATE_TIME, new org.apache.thrift.meta_data.FieldMetaData("createTime", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Catalog.class, metaDataMap);
}
@@ -156,7 +147,6 @@ import org.slf4j.LoggerFactory;
* Performs a deep copy on <i>other</i>.
*/
public Catalog(Catalog other) {
- __isset_bitfield = other.__isset_bitfield;
if (other.isSetName()) {
this.name = other.name;
}
@@ -166,7 +156,6 @@ import org.slf4j.LoggerFactory;
if (other.isSetLocationUri()) {
this.locationUri = other.locationUri;
}
- this.createTime = other.createTime;
}
public Catalog deepCopy() {
@@ -178,8 +167,6 @@ import org.slf4j.LoggerFactory;
this.name = null;
this.description = null;
this.locationUri = null;
- setCreateTimeIsSet(false);
- this.createTime = 0;
}
public String getName() {
@@ -251,28 +238,6 @@ import org.slf4j.LoggerFactory;
}
}
- public int getCreateTime() {
- return this.createTime;
- }
-
- public void setCreateTime(int createTime) {
- this.createTime = createTime;
- setCreateTimeIsSet(true);
- }
-
- public void unsetCreateTime() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CREATETIME_ISSET_ID);
- }
-
- /** Returns true if field createTime is set (has been assigned a value) and false otherwise */
- public boolean isSetCreateTime() {
- return EncodingUtils.testBit(__isset_bitfield, __CREATETIME_ISSET_ID);
- }
-
- public void setCreateTimeIsSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CREATETIME_ISSET_ID, value);
- }
-
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case NAME:
@@ -299,14 +264,6 @@ import org.slf4j.LoggerFactory;
}
break;
- case CREATE_TIME:
- if (value == null) {
- unsetCreateTime();
- } else {
- setCreateTime((Integer)value);
- }
- break;
-
}
}
@@ -321,9 +278,6 @@ import org.slf4j.LoggerFactory;
case LOCATION_URI:
return getLocationUri();
- case CREATE_TIME:
- return getCreateTime();
-
}
throw new IllegalStateException();
}
@@ -341,8 +295,6 @@ import org.slf4j.LoggerFactory;
return isSetDescription();
case LOCATION_URI:
return isSetLocationUri();
- case CREATE_TIME:
- return isSetCreateTime();
}
throw new IllegalStateException();
}
@@ -387,15 +339,6 @@ import org.slf4j.LoggerFactory;
return false;
}
- boolean this_present_createTime = true && this.isSetCreateTime();
- boolean that_present_createTime = true && that.isSetCreateTime();
- if (this_present_createTime || that_present_createTime) {
- if (!(this_present_createTime && that_present_createTime))
- return false;
- if (this.createTime != that.createTime)
- return false;
- }
-
return true;
}
@@ -418,11 +361,6 @@ import org.slf4j.LoggerFactory;
if (present_locationUri)
list.add(locationUri);
- boolean present_createTime = true && (isSetCreateTime());
- list.add(present_createTime);
- if (present_createTime)
- list.add(createTime);
-
return list.hashCode();
}
@@ -464,16 +402,6 @@ import org.slf4j.LoggerFactory;
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetCreateTime()).compareTo(other.isSetCreateTime());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetCreateTime()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.createTime, other.createTime);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
return 0;
}
@@ -519,12 +447,6 @@ import org.slf4j.LoggerFactory;
sb.append(this.locationUri);
}
first = false;
- if (isSetCreateTime()) {
- if (!first) sb.append(", ");
- sb.append("createTime:");
- sb.append(this.createTime);
- first = false;
- }
sb.append(")");
return sb.toString();
}
@@ -544,8 +466,6 @@ import org.slf4j.LoggerFactory;
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
- // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
- __isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
@@ -594,14 +514,6 @@ import org.slf4j.LoggerFactory;
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case 4: // CREATE_TIME
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.createTime = iprot.readI32();
- struct.setCreateTimeIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
@@ -632,11 +544,6 @@ import org.slf4j.LoggerFactory;
oprot.writeString(struct.locationUri);
oprot.writeFieldEnd();
}
- if (struct.isSetCreateTime()) {
- oprot.writeFieldBegin(CREATE_TIME_FIELD_DESC);
- oprot.writeI32(struct.createTime);
- oprot.writeFieldEnd();
- }
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@@ -664,10 +571,7 @@ import org.slf4j.LoggerFactory;
if (struct.isSetLocationUri()) {
optionals.set(2);
}
- if (struct.isSetCreateTime()) {
- optionals.set(3);
- }
- oprot.writeBitSet(optionals, 4);
+ oprot.writeBitSet(optionals, 3);
if (struct.isSetName()) {
oprot.writeString(struct.name);
}
@@ -677,15 +581,12 @@ import org.slf4j.LoggerFactory;
if (struct.isSetLocationUri()) {
oprot.writeString(struct.locationUri);
}
- if (struct.isSetCreateTime()) {
- oprot.writeI32(struct.createTime);
- }
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, Catalog struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(4);
+ BitSet incoming = iprot.readBitSet(3);
if (incoming.get(0)) {
struct.name = iprot.readString();
struct.setNameIsSet(true);
@@ -698,10 +599,6 @@ import org.slf4j.LoggerFactory;
struct.locationUri = iprot.readString();
struct.setLocationUriIsSet(true);
}
- if (incoming.get(3)) {
- struct.createTime = iprot.readI32();
- struct.setCreateTimeIsSet(true);
- }
}
}
http://git-wip-us.apache.org/repos/asf/hive/blob/4d5d8060/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Database.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Database.java b/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Database.java
index f68fda9..9947976 100644
--- a/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Database.java
+++ b/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Database.java
@@ -46,7 +46,6 @@ import org.slf4j.LoggerFactory;
private static final org.apache.thrift.protocol.TField OWNER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("ownerName", org.apache.thrift.protocol.TType.STRING, (short)6);
private static final org.apache.thrift.protocol.TField OWNER_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("ownerType", org.apache.thrift.protocol.TType.I32, (short)7);
private static final org.apache.thrift.protocol.TField CATALOG_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("catalogName", org.apache.thrift.protocol.TType.STRING, (short)8);
- private static final org.apache.thrift.protocol.TField CREATE_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("createTime", org.apache.thrift.protocol.TType.I32, (short)9);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
@@ -62,7 +61,6 @@ import org.slf4j.LoggerFactory;
private String ownerName; // optional
private PrincipalType ownerType; // optional
private String catalogName; // optional
- private int createTime; // optional
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
@@ -77,8 +75,7 @@ import org.slf4j.LoggerFactory;
* @see PrincipalType
*/
OWNER_TYPE((short)7, "ownerType"),
- CATALOG_NAME((short)8, "catalogName"),
- CREATE_TIME((short)9, "createTime");
+ CATALOG_NAME((short)8, "catalogName");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -109,8 +106,6 @@ import org.slf4j.LoggerFactory;
return OWNER_TYPE;
case 8: // CATALOG_NAME
return CATALOG_NAME;
- case 9: // CREATE_TIME
- return CREATE_TIME;
default:
return null;
}
@@ -151,9 +146,7 @@ import org.slf4j.LoggerFactory;
}
// isset id assignments
- private static final int __CREATETIME_ISSET_ID = 0;
- private byte __isset_bitfield = 0;
- private static final _Fields optionals[] = {_Fields.PRIVILEGES,_Fields.OWNER_NAME,_Fields.OWNER_TYPE,_Fields.CATALOG_NAME,_Fields.CREATE_TIME};
+ private static final _Fields optionals[] = {_Fields.PRIVILEGES,_Fields.OWNER_NAME,_Fields.OWNER_TYPE,_Fields.CATALOG_NAME};
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
@@ -175,8 +168,6 @@ import org.slf4j.LoggerFactory;
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, PrincipalType.class)));
tmpMap.put(_Fields.CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("catalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.CREATE_TIME, new org.apache.thrift.meta_data.FieldMetaData("createTime", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Database.class, metaDataMap);
}
@@ -201,7 +192,6 @@ import org.slf4j.LoggerFactory;
* Performs a deep copy on <i>other</i>.
*/
public Database(Database other) {
- __isset_bitfield = other.__isset_bitfield;
if (other.isSetName()) {
this.name = other.name;
}
@@ -227,7 +217,6 @@ import org.slf4j.LoggerFactory;
if (other.isSetCatalogName()) {
this.catalogName = other.catalogName;
}
- this.createTime = other.createTime;
}
public Database deepCopy() {
@@ -244,8 +233,6 @@ import org.slf4j.LoggerFactory;
this.ownerName = null;
this.ownerType = null;
this.catalogName = null;
- setCreateTimeIsSet(false);
- this.createTime = 0;
}
public String getName() {
@@ -451,28 +438,6 @@ import org.slf4j.LoggerFactory;
}
}
- public int getCreateTime() {
- return this.createTime;
- }
-
- public void setCreateTime(int createTime) {
- this.createTime = createTime;
- setCreateTimeIsSet(true);
- }
-
- public void unsetCreateTime() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CREATETIME_ISSET_ID);
- }
-
- /** Returns true if field createTime is set (has been assigned a value) and false otherwise */
- public boolean isSetCreateTime() {
- return EncodingUtils.testBit(__isset_bitfield, __CREATETIME_ISSET_ID);
- }
-
- public void setCreateTimeIsSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CREATETIME_ISSET_ID, value);
- }
-
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case NAME:
@@ -539,14 +504,6 @@ import org.slf4j.LoggerFactory;
}
break;
- case CREATE_TIME:
- if (value == null) {
- unsetCreateTime();
- } else {
- setCreateTime((Integer)value);
- }
- break;
-
}
}
@@ -576,9 +533,6 @@ import org.slf4j.LoggerFactory;
case CATALOG_NAME:
return getCatalogName();
- case CREATE_TIME:
- return getCreateTime();
-
}
throw new IllegalStateException();
}
@@ -606,8 +560,6 @@ import org.slf4j.LoggerFactory;
return isSetOwnerType();
case CATALOG_NAME:
return isSetCatalogName();
- case CREATE_TIME:
- return isSetCreateTime();
}
throw new IllegalStateException();
}
@@ -697,15 +649,6 @@ import org.slf4j.LoggerFactory;
return false;
}
- boolean this_present_createTime = true && this.isSetCreateTime();
- boolean that_present_createTime = true && that.isSetCreateTime();
- if (this_present_createTime || that_present_createTime) {
- if (!(this_present_createTime && that_present_createTime))
- return false;
- if (this.createTime != that.createTime)
- return false;
- }
-
return true;
}
@@ -753,11 +696,6 @@ import org.slf4j.LoggerFactory;
if (present_catalogName)
list.add(catalogName);
- boolean present_createTime = true && (isSetCreateTime());
- list.add(present_createTime);
- if (present_createTime)
- list.add(createTime);
-
return list.hashCode();
}
@@ -849,16 +787,6 @@ import org.slf4j.LoggerFactory;
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetCreateTime()).compareTo(other.isSetCreateTime());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetCreateTime()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.createTime, other.createTime);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
return 0;
}
@@ -950,12 +878,6 @@ import org.slf4j.LoggerFactory;
}
first = false;
}
- if (isSetCreateTime()) {
- if (!first) sb.append(", ");
- sb.append("createTime:");
- sb.append(this.createTime);
- first = false;
- }
sb.append(")");
return sb.toString();
}
@@ -978,8 +900,6 @@ import org.slf4j.LoggerFactory;
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
- // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
- __isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
@@ -1081,14 +1001,6 @@ import org.slf4j.LoggerFactory;
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case 9: // CREATE_TIME
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.createTime = iprot.readI32();
- struct.setCreateTimeIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
@@ -1158,11 +1070,6 @@ import org.slf4j.LoggerFactory;
oprot.writeFieldEnd();
}
}
- if (struct.isSetCreateTime()) {
- oprot.writeFieldBegin(CREATE_TIME_FIELD_DESC);
- oprot.writeI32(struct.createTime);
- oprot.writeFieldEnd();
- }
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@@ -1205,10 +1112,7 @@ import org.slf4j.LoggerFactory;
if (struct.isSetCatalogName()) {
optionals.set(7);
}
- if (struct.isSetCreateTime()) {
- optionals.set(8);
- }
- oprot.writeBitSet(optionals, 9);
+ oprot.writeBitSet(optionals, 8);
if (struct.isSetName()) {
oprot.writeString(struct.name);
}
@@ -1240,15 +1144,12 @@ import org.slf4j.LoggerFactory;
if (struct.isSetCatalogName()) {
oprot.writeString(struct.catalogName);
}
- if (struct.isSetCreateTime()) {
- oprot.writeI32(struct.createTime);
- }
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, Database struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(9);
+ BitSet incoming = iprot.readBitSet(8);
if (incoming.get(0)) {
struct.name = iprot.readString();
struct.setNameIsSet(true);
@@ -1293,10 +1194,6 @@ import org.slf4j.LoggerFactory;
struct.catalogName = iprot.readString();
struct.setCatalogNameIsSet(true);
}
- if (incoming.get(8)) {
- struct.createTime = iprot.readI32();
- struct.setCreateTimeIsSet(true);
- }
}
}
http://git-wip-us.apache.org/repos/asf/hive/blob/4d5d8060/standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/Types.php
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/Types.php b/standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/Types.php
index 759081c..13e287e 100644
--- a/standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/Types.php
+++ b/standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/Types.php
@@ -4762,10 +4762,6 @@ class Catalog {
* @var string
*/
public $locationUri = null;
- /**
- * @var int
- */
- public $createTime = null;
public function __construct($vals=null) {
if (!isset(self::$_TSPEC)) {
@@ -4782,10 +4778,6 @@ class Catalog {
'var' => 'locationUri',
'type' => TType::STRING,
),
- 4 => array(
- 'var' => 'createTime',
- 'type' => TType::I32,
- ),
);
}
if (is_array($vals)) {
@@ -4798,9 +4790,6 @@ class Catalog {
if (isset($vals['locationUri'])) {
$this->locationUri = $vals['locationUri'];
}
- if (isset($vals['createTime'])) {
- $this->createTime = $vals['createTime'];
- }
}
}
@@ -4844,13 +4833,6 @@ class Catalog {
$xfer += $input->skip($ftype);
}
break;
- case 4:
- if ($ftype == TType::I32) {
- $xfer += $input->readI32($this->createTime);
- } else {
- $xfer += $input->skip($ftype);
- }
- break;
default:
$xfer += $input->skip($ftype);
break;
@@ -4879,11 +4861,6 @@ class Catalog {
$xfer += $output->writeString($this->locationUri);
$xfer += $output->writeFieldEnd();
}
- if ($this->createTime !== null) {
- $xfer += $output->writeFieldBegin('createTime', TType::I32, 4);
- $xfer += $output->writeI32($this->createTime);
- $xfer += $output->writeFieldEnd();
- }
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
@@ -5440,10 +5417,6 @@ class Database {
* @var string
*/
public $catalogName = null;
- /**
- * @var int
- */
- public $createTime = null;
public function __construct($vals=null) {
if (!isset(self::$_TSPEC)) {
@@ -5489,10 +5462,6 @@ class Database {
'var' => 'catalogName',
'type' => TType::STRING,
),
- 9 => array(
- 'var' => 'createTime',
- 'type' => TType::I32,
- ),
);
}
if (is_array($vals)) {
@@ -5520,9 +5489,6 @@ class Database {
if (isset($vals['catalogName'])) {
$this->catalogName = $vals['catalogName'];
}
- if (isset($vals['createTime'])) {
- $this->createTime = $vals['createTime'];
- }
}
}
@@ -5615,13 +5581,6 @@ class Database {
$xfer += $input->skip($ftype);
}
break;
- case 9:
- if ($ftype == TType::I32) {
- $xfer += $input->readI32($this->createTime);
- } else {
- $xfer += $input->skip($ftype);
- }
- break;
default:
$xfer += $input->skip($ftype);
break;
@@ -5691,11 +5650,6 @@ class Database {
$xfer += $output->writeString($this->catalogName);
$xfer += $output->writeFieldEnd();
}
- if ($this->createTime !== null) {
- $xfer += $output->writeFieldBegin('createTime', TType::I32, 9);
- $xfer += $output->writeI32($this->createTime);
- $xfer += $output->writeFieldEnd();
- }
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
http://git-wip-us.apache.org/repos/asf/hive/blob/4d5d8060/standalone-metastore/metastore-common/src/gen/thrift/gen-py/hive_metastore/ttypes.py
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/gen/thrift/gen-py/hive_metastore/ttypes.py b/standalone-metastore/metastore-common/src/gen/thrift/gen-py/hive_metastore/ttypes.py
index b237eca..8f149d1 100644
--- a/standalone-metastore/metastore-common/src/gen/thrift/gen-py/hive_metastore/ttypes.py
+++ b/standalone-metastore/metastore-common/src/gen/thrift/gen-py/hive_metastore/ttypes.py
@@ -3465,7 +3465,6 @@ class Catalog:
- name
- description
- locationUri
- - createTime
"""
thrift_spec = (
@@ -3473,14 +3472,12 @@ class Catalog:
(1, TType.STRING, 'name', None, None, ), # 1
(2, TType.STRING, 'description', None, None, ), # 2
(3, TType.STRING, 'locationUri', None, None, ), # 3
- (4, TType.I32, 'createTime', None, None, ), # 4
)
- def __init__(self, name=None, description=None, locationUri=None, createTime=None,):
+ def __init__(self, name=None, description=None, locationUri=None,):
self.name = name
self.description = description
self.locationUri = locationUri
- self.createTime = createTime
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
@@ -3506,11 +3503,6 @@ class Catalog:
self.locationUri = iprot.readString()
else:
iprot.skip(ftype)
- elif fid == 4:
- if ftype == TType.I32:
- self.createTime = iprot.readI32()
- else:
- iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
@@ -3533,10 +3525,6 @@ class Catalog:
oprot.writeFieldBegin('locationUri', TType.STRING, 3)
oprot.writeString(self.locationUri)
oprot.writeFieldEnd()
- if self.createTime is not None:
- oprot.writeFieldBegin('createTime', TType.I32, 4)
- oprot.writeI32(self.createTime)
- oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
@@ -3549,7 +3537,6 @@ class Catalog:
value = (value * 31) ^ hash(self.name)
value = (value * 31) ^ hash(self.description)
value = (value * 31) ^ hash(self.locationUri)
- value = (value * 31) ^ hash(self.createTime)
return value
def __repr__(self):
@@ -3988,7 +3975,6 @@ class Database:
- ownerName
- ownerType
- catalogName
- - createTime
"""
thrift_spec = (
@@ -4001,10 +3987,9 @@ class Database:
(6, TType.STRING, 'ownerName', None, None, ), # 6
(7, TType.I32, 'ownerType', None, None, ), # 7
(8, TType.STRING, 'catalogName', None, None, ), # 8
- (9, TType.I32, 'createTime', None, None, ), # 9
)
- def __init__(self, name=None, description=None, locationUri=None, parameters=None, privileges=None, ownerName=None, ownerType=None, catalogName=None, createTime=None,):
+ def __init__(self, name=None, description=None, locationUri=None, parameters=None, privileges=None, ownerName=None, ownerType=None, catalogName=None,):
self.name = name
self.description = description
self.locationUri = locationUri
@@ -4013,7 +3998,6 @@ class Database:
self.ownerName = ownerName
self.ownerType = ownerType
self.catalogName = catalogName
- self.createTime = createTime
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
@@ -4071,11 +4055,6 @@ class Database:
self.catalogName = iprot.readString()
else:
iprot.skip(ftype)
- elif fid == 9:
- if ftype == TType.I32:
- self.createTime = iprot.readI32()
- else:
- iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
@@ -4122,10 +4101,6 @@ class Database:
oprot.writeFieldBegin('catalogName', TType.STRING, 8)
oprot.writeString(self.catalogName)
oprot.writeFieldEnd()
- if self.createTime is not None:
- oprot.writeFieldBegin('createTime', TType.I32, 9)
- oprot.writeI32(self.createTime)
- oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
@@ -4143,7 +4118,6 @@ class Database:
value = (value * 31) ^ hash(self.ownerName)
value = (value * 31) ^ hash(self.ownerType)
value = (value * 31) ^ hash(self.catalogName)
- value = (value * 31) ^ hash(self.createTime)
return value
def __repr__(self):
http://git-wip-us.apache.org/repos/asf/hive/blob/4d5d8060/standalone-metastore/metastore-common/src/gen/thrift/gen-rb/hive_metastore_types.rb
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/gen/thrift/gen-rb/hive_metastore_types.rb b/standalone-metastore/metastore-common/src/gen/thrift/gen-rb/hive_metastore_types.rb
index 40ac5a5..9e5f086 100644
--- a/standalone-metastore/metastore-common/src/gen/thrift/gen-rb/hive_metastore_types.rb
+++ b/standalone-metastore/metastore-common/src/gen/thrift/gen-rb/hive_metastore_types.rb
@@ -847,13 +847,11 @@ class Catalog
NAME = 1
DESCRIPTION = 2
LOCATIONURI = 3
- CREATETIME = 4
FIELDS = {
NAME => {:type => ::Thrift::Types::STRING, :name => 'name'},
DESCRIPTION => {:type => ::Thrift::Types::STRING, :name => 'description', :optional => true},
- LOCATIONURI => {:type => ::Thrift::Types::STRING, :name => 'locationUri'},
- CREATETIME => {:type => ::Thrift::Types::I32, :name => 'createTime', :optional => true}
+ LOCATIONURI => {:type => ::Thrift::Types::STRING, :name => 'locationUri'}
}
def struct_fields; FIELDS; end
@@ -972,7 +970,6 @@ class Database
OWNERNAME = 6
OWNERTYPE = 7
CATALOGNAME = 8
- CREATETIME = 9
FIELDS = {
NAME => {:type => ::Thrift::Types::STRING, :name => 'name'},
@@ -982,8 +979,7 @@ class Database
PRIVILEGES => {:type => ::Thrift::Types::STRUCT, :name => 'privileges', :class => ::PrincipalPrivilegeSet, :optional => true},
OWNERNAME => {:type => ::Thrift::Types::STRING, :name => 'ownerName', :optional => true},
OWNERTYPE => {:type => ::Thrift::Types::I32, :name => 'ownerType', :optional => true, :enum_class => ::PrincipalType},
- CATALOGNAME => {:type => ::Thrift::Types::STRING, :name => 'catalogName', :optional => true},
- CREATETIME => {:type => ::Thrift::Types::I32, :name => 'createTime', :optional => true}
+ CATALOGNAME => {:type => ::Thrift::Types::STRING, :name => 'catalogName', :optional => true}
}
def struct_fields; FIELDS; end
http://git-wip-us.apache.org/repos/asf/hive/blob/4d5d8060/standalone-metastore/metastore-common/src/main/thrift/hive_metastore.thrift
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/main/thrift/hive_metastore.thrift b/standalone-metastore/metastore-common/src/main/thrift/hive_metastore.thrift
index 8bbb9dd..9576f87 100644
--- a/standalone-metastore/metastore-common/src/main/thrift/hive_metastore.thrift
+++ b/standalone-metastore/metastore-common/src/main/thrift/hive_metastore.thrift
@@ -340,10 +340,9 @@ struct GrantRevokeRoleResponse {
struct Catalog {
1: string name, // Name of the catalog
2: optional string description, // description of the catalog
- 3: string locationUri, // default storage location. When databases are created in
- // this catalog, if they do not specify a location, they will
- // be placed in this location.
- 4: optional i32 createTime // creation time of catalog in seconds since epoch
+ 3: string locationUri // default storage location. When databases are created in
+ // this catalog, if they do not specify a location, they will
+ // be placed in this location.
}
struct CreateCatalogRequest {
@@ -380,8 +379,7 @@ struct Database {
5: optional PrincipalPrivilegeSet privileges,
6: optional string ownerName,
7: optional PrincipalType ownerType,
- 8: optional string catalogName,
- 9: optional i32 createTime // creation time of database in seconds since epoch
+ 8: optional string catalogName
}
// This object holds the information needed by SerDes
http://git-wip-us.apache.org/repos/asf/hive/blob/4d5d8060/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
index a7b2061..a9398ae 100644
--- a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
+++ b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
@@ -768,8 +768,6 @@ public class HiveMetaStore extends ThriftHiveMetastore {
} catch (NoSuchObjectException e) {
Catalog cat = new Catalog(DEFAULT_CATALOG_NAME, wh.getWhRoot().toString());
- long time = System.currentTimeMillis() / 1000;
- cat.setCreateTime((int) time);
cat.setDescription(Warehouse.DEFAULT_CATALOG_COMMENT);
ms.createCatalog(cat);
}
@@ -780,12 +778,10 @@ public class HiveMetaStore extends ThriftHiveMetastore {
ms.getDatabase(DEFAULT_CATALOG_NAME, DEFAULT_DATABASE_NAME);
} catch (NoSuchObjectException e) {
Database db = new Database(DEFAULT_DATABASE_NAME, DEFAULT_DATABASE_COMMENT,
- wh.getDefaultDatabasePath(DEFAULT_DATABASE_NAME).toString(), null);
+ wh.getDefaultDatabasePath(DEFAULT_DATABASE_NAME).toString(), null);
db.setOwnerName(PUBLIC);
db.setOwnerType(PrincipalType.ROLE);
db.setCatalogName(DEFAULT_CATALOG_NAME);
- long time = System.currentTimeMillis() / 1000;
- db.setCreateTime((int) time);
ms.createDatabase(db);
}
}
@@ -1061,16 +1057,13 @@ public class HiveMetaStore extends ThriftHiveMetastore {
}
madeDir = true;
}
- // set the create time of catalog
- long time = System.currentTimeMillis() / 1000;
- catalog.setCreateTime((int) time);
+
ms.openTransaction();
ms.createCatalog(catalog);
// Create a default database inside the catalog
- Database db = new Database(DEFAULT_DATABASE_NAME,
- "Default database for catalog " + catalog.getName(), catalog.getLocationUri(),
- Collections.emptyMap());
+ Database db = new Database(DEFAULT_DATABASE_NAME, "Default database for catalog " +
+ catalog.getName(), catalog.getLocationUri(), Collections.emptyMap());
db.setCatalogName(catalog.getName());
create_database_core(ms, db);
@@ -1293,8 +1286,7 @@ public class HiveMetaStore extends ThriftHiveMetastore {
}
Path dbPath = wh.determineDatabasePath(cat, db);
db.setLocationUri(dbPath.toString());
- long time = System.currentTimeMillis()/1000;
- db.setCreateTime((int) time);
+
boolean success = false;
boolean madeDir = false;
Map<String, String> transactionalListenersResponses = Collections.emptyMap();
http://git-wip-us.apache.org/repos/asf/hive/blob/4d5d8060/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java
index b0cbe01..58dc6ee 100644
--- a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java
+++ b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java
@@ -371,7 +371,7 @@ class MetaStoreDirectSql {
String queryTextDbSelector= "select "
+ "\"DB_ID\", \"NAME\", \"DB_LOCATION_URI\", \"DESC\", "
- + "\"OWNER_NAME\", \"OWNER_TYPE\", \"CTLG_NAME\" , \"CREATE_TIME\""
+ + "\"OWNER_NAME\", \"OWNER_TYPE\", \"CTLG_NAME\" "
+ "FROM "+ DBS
+ " where \"NAME\" = ? and \"CTLG_NAME\" = ? ";
Object[] params = new Object[] { dbName, catName };
@@ -425,7 +425,6 @@ class MetaStoreDirectSql {
db.setOwnerType(
(null == type || type.trim().isEmpty()) ? null : PrincipalType.valueOf(type));
db.setCatalogName(MetastoreDirectSqlUtils.extractSqlString(dbline[6]));
- db.setCreateTime(MetastoreDirectSqlUtils.extractSqlInt(dbline[7]));
db.setParameters(MetaStoreServerUtils.trimMapNulls(dbParams,convertMapNullsToEmptyStrings));
if (LOG.isDebugEnabled()){
LOG.debug("getDatabase: directsql returning db " + db.getName()
http://git-wip-us.apache.org/repos/asf/hive/blob/4d5d8060/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java
index ad60af7..d43c0c1 100644
--- a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java
+++ b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java
@@ -649,7 +649,6 @@ public class ObjectStore implements RawStore, Configurable {
mCat.setDescription(cat.getDescription());
}
mCat.setLocationUri(cat.getLocationUri());
- mCat.setCreateTime(cat.getCreateTime());
return mCat;
}
@@ -658,7 +657,6 @@ public class ObjectStore implements RawStore, Configurable {
if (mCat.getDescription() != null) {
cat.setDescription(mCat.getDescription());
}
- cat.setCreateTime(mCat.getCreateTime());
return cat;
}
@@ -676,7 +674,6 @@ public class ObjectStore implements RawStore, Configurable {
mdb.setOwnerName(db.getOwnerName());
PrincipalType ownerType = db.getOwnerType();
mdb.setOwnerType((null == ownerType ? PrincipalType.USER.name() : ownerType.name()));
- mdb.setCreateTime(db.getCreateTime());
try {
openTransaction();
pm.makePersistent(mdb);
@@ -770,7 +767,6 @@ public class ObjectStore implements RawStore, Configurable {
PrincipalType principalType = (type == null) ? null : PrincipalType.valueOf(type);
db.setOwnerType(principalType);
db.setCatalogName(catName);
- db.setCreateTime(mdb.getCreateTime());
return db;
}
http://git-wip-us.apache.org/repos/asf/hive/blob/4d5d8060/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/client/builder/DatabaseBuilder.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/client/builder/DatabaseBuilder.java b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/client/builder/DatabaseBuilder.java
index dcd57c4..f3d2182 100644
--- a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/client/builder/DatabaseBuilder.java
+++ b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/client/builder/DatabaseBuilder.java
@@ -41,7 +41,6 @@ public class DatabaseBuilder {
private Map<String, String> params = new HashMap<>();
private String ownerName;
private PrincipalType ownerType;
- private int createTime;
public DatabaseBuilder() {
}
@@ -91,17 +90,11 @@ public class DatabaseBuilder {
return this;
}
- public DatabaseBuilder setCreateTime(int createTime) {
- this.createTime = createTime;
- return this;
- }
-
public Database build(Configuration conf) throws MetaException {
if (name == null) throw new MetaException("You must name the database");
if (catalogName == null) catalogName = MetaStoreUtils.getDefaultCatalog(conf);
Database db = new Database(name, description, location, params);
db.setCatalogName(catalogName);
- db.setCreateTime(createTime);
try {
if (ownerName == null) ownerName = SecurityUtils.getUser();
db.setOwnerName(ownerName);
http://git-wip-us.apache.org/repos/asf/hive/blob/4d5d8060/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MCatalog.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MCatalog.java b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MCatalog.java
index a3ed82f..e82cb43 100644
--- a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MCatalog.java
+++ b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MCatalog.java
@@ -21,7 +21,6 @@ public class MCatalog {
private String name;
private String description;
private String locationUri;
- private int createTime;
public MCatalog() {
@@ -56,12 +55,4 @@ public class MCatalog {
public void setLocationUri(String locationUri) {
this.locationUri = locationUri;
}
-
- public int getCreateTime() {
- return createTime;
- }
-
- public void setCreateTime(int createTime) {
- this.createTime = createTime;
- }
}
http://git-wip-us.apache.org/repos/asf/hive/blob/4d5d8060/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MDatabase.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MDatabase.java b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MDatabase.java
index 8901eed..815b39c 100644
--- a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MDatabase.java
+++ b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MDatabase.java
@@ -40,7 +40,6 @@ public class MDatabase {
private String ownerName;
private String ownerType;
private String catalogName;
- private int createTime;
/**
* Default construction to keep jpox/jdo happy
@@ -155,12 +154,4 @@ public class MDatabase {
public void setCatalogName(String catalogName) {
this.catalogName = catalogName;
}
-
- public int getCreateTime() {
- return createTime;
- }
-
- public void setCreateTime(int createTime) {
- this.createTime = createTime;
- }
}
http://git-wip-us.apache.org/repos/asf/hive/blob/4d5d8060/standalone-metastore/metastore-server/src/main/resources/package.jdo
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-server/src/main/resources/package.jdo b/standalone-metastore/metastore-server/src/main/resources/package.jdo
index 117a2f8..caaec45 100644
--- a/standalone-metastore/metastore-server/src/main/resources/package.jdo
+++ b/standalone-metastore/metastore-server/src/main/resources/package.jdo
@@ -65,10 +65,6 @@
<field name="ownerType">
<column name="OWNER_TYPE" length="10" jdbc-type="VARCHAR" allows-null="true"/>
</field>
- <field name="createTime">
- <!-- allows null is true to keep backwards compatibility with old releases -->
- <column name="CREATE_TIME" jdbc-type="integer" allows-null="true"/>
- </field>
</class>
<class name="MCatalog" identity-type="datastore" table="CTLGS" detachable="true">
@@ -85,10 +81,6 @@
<field name="locationUri">
<column name="LOCATION_URI" length="4000" jdbc-type="VARCHAR" allows-null="false"/>
</field>
- <field name="createTime">
- <!-- allows null is true to keep backwards compatibility with old releases -->
- <column name="CREATE_TIME" jdbc-type="integer" allows-null="true"/>
- </field>
</class>
<class name="MFieldSchema" embedded-only="true" table="TYPE_FIELDS" detachable="true">
http://git-wip-us.apache.org/repos/asf/hive/blob/4d5d8060/standalone-metastore/metastore-server/src/main/sql/derby/hive-schema-4.0.0.derby.sql
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-server/src/main/sql/derby/hive-schema-4.0.0.derby.sql b/standalone-metastore/metastore-server/src/main/sql/derby/hive-schema-4.0.0.derby.sql
index 2f102a2..a3c4196 100644
--- a/standalone-metastore/metastore-server/src/main/sql/derby/hive-schema-4.0.0.derby.sql
+++ b/standalone-metastore/metastore-server/src/main/sql/derby/hive-schema-4.0.0.derby.sql
@@ -22,8 +22,7 @@ CREATE TABLE "APP"."DBS" (
"NAME" VARCHAR(128),
"OWNER_NAME" VARCHAR(128),
"OWNER_TYPE" VARCHAR(10),
- "CTLG_NAME" VARCHAR(256) NOT NULL,
- "CREATE_TIME" INTEGER
+ "CTLG_NAME" VARCHAR(256) NOT NULL
);
CREATE TABLE "APP"."TBL_PRIVS" ("TBL_GRANT_ID" BIGINT NOT NULL, "CREATE_TIME" INTEGER NOT NULL, "GRANT_OPTION" SMALLINT NOT NULL, "GRANTOR" VARCHAR(128), "GRANTOR_TYPE" VARCHAR(128), "PRINCIPAL_NAME" VARCHAR(128), "PRINCIPAL_TYPE" VARCHAR(128), "TBL_PRIV" VARCHAR(128), "TBL_ID" BIGINT, "AUTHORIZER" VARCHAR(128));
@@ -211,8 +210,7 @@ CREATE TABLE "APP"."CTLGS" (
"CTLG_ID" BIGINT NOT NULL,
"NAME" VARCHAR(256) UNIQUE,
"DESC" VARCHAR(4000),
- "LOCATION_URI" VARCHAR(4000) NOT NULL,
- "CREATE_TIME" INTEGER);
+ "LOCATION_URI" VARCHAR(4000) NOT NULL);
-- ----------------------------------------------
-- DML Statements
http://git-wip-us.apache.org/repos/asf/hive/blob/4d5d8060/standalone-metastore/metastore-server/src/main/sql/derby/upgrade-3.2.0-to-4.0.0.derby.sql
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-server/src/main/sql/derby/upgrade-3.2.0-to-4.0.0.derby.sql b/standalone-metastore/metastore-server/src/main/sql/derby/upgrade-3.2.0-to-4.0.0.derby.sql
index 02b321d..bcaebd1 100644
--- a/standalone-metastore/metastore-server/src/main/sql/derby/upgrade-3.2.0-to-4.0.0.derby.sql
+++ b/standalone-metastore/metastore-server/src/main/sql/derby/upgrade-3.2.0-to-4.0.0.derby.sql
@@ -9,9 +9,7 @@ UPDATE "APP"."WM_RESOURCEPLAN" SET NS = 'default' WHERE NS IS NULL;
DROP INDEX "APP"."UNIQUE_WM_RESOURCEPLAN";
CREATE UNIQUE INDEX "APP"."UNIQUE_WM_RESOURCEPLAN" ON "APP"."WM_RESOURCEPLAN" ("NS", "NAME");
--- HIVE-21077
-ALTER TABLE "APP"."DBS" ADD COLUMN CREATE_TIME INTEGER;
-ALTER TABLE "APP"."CTLGS" ADD COLUMN CREATE_TIME INTEGER;
+
-- This needs to be the last thing done. Insert any changes above this line.
UPDATE "APP".VERSION SET SCHEMA_VERSION='4.0.0', VERSION_COMMENT='Hive release version 4.0.0' where VER_ID=1;
http://git-wip-us.apache.org/repos/asf/hive/blob/4d5d8060/standalone-metastore/metastore-server/src/main/sql/mssql/hive-schema-4.0.0.mssql.sql
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-server/src/main/sql/mssql/hive-schema-4.0.0.mssql.sql b/standalone-metastore/metastore-server/src/main/sql/mssql/hive-schema-4.0.0.mssql.sql
index 895bf01..5ea1b44 100644
--- a/standalone-metastore/metastore-server/src/main/sql/mssql/hive-schema-4.0.0.mssql.sql
+++ b/standalone-metastore/metastore-server/src/main/sql/mssql/hive-schema-4.0.0.mssql.sql
@@ -285,8 +285,7 @@ CREATE TABLE DBS
"NAME" nvarchar(128) NULL,
OWNER_NAME nvarchar(128) NULL,
OWNER_TYPE nvarchar(10) NULL,
- CTLG_NAME nvarchar(256),
- CREATE_TIME BIGINT
+ CTLG_NAME nvarchar(256)
);
ALTER TABLE DBS ADD CONSTRAINT DBS_PK PRIMARY KEY (DB_ID);
@@ -699,8 +698,7 @@ CREATE TABLE CTLGS (
CTLG_ID bigint primary key,
"NAME" nvarchar(256),
"DESC" nvarchar(4000),
- LOCATION_URI nvarchar(4000) not null,
- CREATE_TIME BIGINT
+ LOCATION_URI nvarchar(4000) not null
);
CREATE UNIQUE INDEX UNIQUE_CTLG ON CTLGS ("NAME");
http://git-wip-us.apache.org/repos/asf/hive/blob/4d5d8060/standalone-metastore/metastore-server/src/main/sql/mssql/upgrade-3.2.0-to-4.0.0.mssql.sql
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-server/src/main/sql/mssql/upgrade-3.2.0-to-4.0.0.mssql.sql b/standalone-metastore/metastore-server/src/main/sql/mssql/upgrade-3.2.0-to-4.0.0.mssql.sql
index ea580fe..edde08d 100644
--- a/standalone-metastore/metastore-server/src/main/sql/mssql/upgrade-3.2.0-to-4.0.0.mssql.sql
+++ b/standalone-metastore/metastore-server/src/main/sql/mssql/upgrade-3.2.0-to-4.0.0.mssql.sql
@@ -10,9 +10,6 @@ UPDATE WM_RESOURCEPLAN SET NS = 'default' WHERE NS IS NULL;
DROP INDEX UNIQUE_WM_RESOURCEPLAN ON WM_RESOURCEPLAN;
CREATE UNIQUE INDEX UNIQUE_WM_RESOURCEPLAN ON WM_RESOURCEPLAN ("NS", "NAME");
--- HIVE-21077
-ALTER TABLE DBS ADD CREATE_TIME BIGINT;
-ALTER TABLE CTLGS ADD CREATE_TIME BIGINT;
-- These lines need to be last. Insert any changes above.
UPDATE VERSION SET SCHEMA_VERSION='4.0.0', VERSION_COMMENT='Hive release version 4.0.0' where VER_ID=1;
SELECT 'Finished upgrading MetaStore schema from 3.2.0 to 4.0.0' AS MESSAGE;
http://git-wip-us.apache.org/repos/asf/hive/blob/4d5d8060/standalone-metastore/metastore-server/src/main/sql/mysql/hive-schema-4.0.0.mysql.sql
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-server/src/main/sql/mysql/hive-schema-4.0.0.mysql.sql b/standalone-metastore/metastore-server/src/main/sql/mysql/hive-schema-4.0.0.mysql.sql
index 5466537..5555a59 100644
--- a/standalone-metastore/metastore-server/src/main/sql/mysql/hive-schema-4.0.0.mysql.sql
+++ b/standalone-metastore/metastore-server/src/main/sql/mysql/hive-schema-4.0.0.mysql.sql
@@ -82,7 +82,6 @@ CREATE TABLE `CTLGS` (
`NAME` VARCHAR(256),
`DESC` VARCHAR(4000),
`LOCATION_URI` VARCHAR(4000) NOT NULL,
- `CREATE_TIME` INT(11),
UNIQUE KEY `UNIQUE_CATALOG` (`NAME`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
@@ -101,7 +100,6 @@ CREATE TABLE IF NOT EXISTS `DBS` (
`OWNER_NAME` varchar(128) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
`OWNER_TYPE` varchar(10) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
`CTLG_NAME` varchar(256) NOT NULL,
- `CREATE_TIME` INT(11),
PRIMARY KEY (`DB_ID`),
UNIQUE KEY `UNIQUE_DATABASE` (`NAME`, `CTLG_NAME`),
CONSTRAINT `CTLG_FK1` FOREIGN KEY (`CTLG_NAME`) REFERENCES `CTLGS` (`NAME`)
http://git-wip-us.apache.org/repos/asf/hive/blob/4d5d8060/standalone-metastore/metastore-server/src/main/sql/mysql/upgrade-3.2.0-to-4.0.0.mysql.sql
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-server/src/main/sql/mysql/upgrade-3.2.0-to-4.0.0.mysql.sql b/standalone-metastore/metastore-server/src/main/sql/mysql/upgrade-3.2.0-to-4.0.0.mysql.sql
index 17d31d0..701acb0 100644
--- a/standalone-metastore/metastore-server/src/main/sql/mysql/upgrade-3.2.0-to-4.0.0.mysql.sql
+++ b/standalone-metastore/metastore-server/src/main/sql/mysql/upgrade-3.2.0-to-4.0.0.mysql.sql
@@ -11,9 +11,6 @@ UPDATE `WM_RESOURCEPLAN` SET `NS` = 'default' WHERE `NS` IS NULL;
ALTER TABLE `WM_RESOURCEPLAN` DROP KEY `UNIQUE_WM_RESOURCEPLAN`;
ALTER TABLE `WM_RESOURCEPLAN` ADD UNIQUE KEY `UNIQUE_WM_RESOURCEPLAN` (`NAME`, `NS`);
--- HIVE-21077
-ALTER TABLE `DBS` ADD `CREATE_TIME` INT(11);
-ALTER TABLE `CTLGS` ADD `CREATE_TIME` INT(11);
-- These lines need to be last. Insert any changes above.
UPDATE VERSION SET SCHEMA_VERSION='4.0.0', VERSION_COMMENT='Hive release version 4.0.0' where VER_ID=1;
SELECT 'Finished upgrading MetaStore schema from 3.2.0 to 4.0.0' AS ' ';
http://git-wip-us.apache.org/repos/asf/hive/blob/4d5d8060/standalone-metastore/metastore-server/src/main/sql/oracle/hive-schema-4.0.0.oracle.sql
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-server/src/main/sql/oracle/hive-schema-4.0.0.oracle.sql b/standalone-metastore/metastore-server/src/main/sql/oracle/hive-schema-4.0.0.oracle.sql
index 2a9c38f..b1980c5 100644
--- a/standalone-metastore/metastore-server/src/main/sql/oracle/hive-schema-4.0.0.oracle.sql
+++ b/standalone-metastore/metastore-server/src/main/sql/oracle/hive-schema-4.0.0.oracle.sql
@@ -80,7 +80,6 @@ CREATE TABLE CTLGS (
"NAME" VARCHAR2(256),
"DESC" VARCHAR2(4000),
LOCATION_URI VARCHAR2(4000) NOT NULL,
- CREATE_TIME NUMBER (10),
UNIQUE ("NAME")
);
@@ -93,8 +92,7 @@ CREATE TABLE DBS
"NAME" VARCHAR2(128) NULL,
OWNER_NAME VARCHAR2(128) NULL,
OWNER_TYPE VARCHAR2(10) NULL,
- CTLG_NAME VARCHAR2(256),
- CREATE_TIME NUMBER (10)
+ CTLG_NAME VARCHAR2(256)
);
ALTER TABLE DBS ADD CONSTRAINT DBS_PK PRIMARY KEY (DB_ID);
http://git-wip-us.apache.org/repos/asf/hive/blob/4d5d8060/standalone-metastore/metastore-server/src/main/sql/oracle/upgrade-3.2.0-to-4.0.0.oracle.sql
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-server/src/main/sql/oracle/upgrade-3.2.0-to-4.0.0.oracle.sql b/standalone-metastore/metastore-server/src/main/sql/oracle/upgrade-3.2.0-to-4.0.0.oracle.sql
index 4602f75..b9f6331 100644
--- a/standalone-metastore/metastore-server/src/main/sql/oracle/upgrade-3.2.0-to-4.0.0.oracle.sql
+++ b/standalone-metastore/metastore-server/src/main/sql/oracle/upgrade-3.2.0-to-4.0.0.oracle.sql
@@ -9,9 +9,6 @@ UPDATE WM_RESOURCEPLAN SET NS = 'default' WHERE NS IS NULL;
DROP INDEX UNIQUE_WM_RESOURCEPLAN;
CREATE UNIQUE INDEX UNIQUE_WM_RESOURCEPLAN ON WM_RESOURCEPLAN (NS, "NAME");
--- HIVE-21077
-ALTER TABLE DBS add CREATE_TIME NUMBER(10);
-ALTER TABLE CTLGS add CREATE_TIME NUMBER(10);
-- These lines need to be last. Insert any changes above.
UPDATE VERSION SET SCHEMA_VERSION='4.0.0', VERSION_COMMENT='Hive release version 4.0.0' where VER_ID=1;
SELECT 'Finished upgrading MetaStore schema from 3.2.0 to 4.0.0' AS Status from dual;
http://git-wip-us.apache.org/repos/asf/hive/blob/4d5d8060/standalone-metastore/metastore-server/src/main/sql/postgres/hive-schema-4.0.0.postgres.sql
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-server/src/main/sql/postgres/hive-schema-4.0.0.postgres.sql b/standalone-metastore/metastore-server/src/main/sql/postgres/hive-schema-4.0.0.postgres.sql
index 0a359d9..9040005 100644
--- a/standalone-metastore/metastore-server/src/main/sql/postgres/hive-schema-4.0.0.postgres.sql
+++ b/standalone-metastore/metastore-server/src/main/sql/postgres/hive-schema-4.0.0.postgres.sql
@@ -63,8 +63,7 @@ CREATE TABLE "CTLGS" (
"CTLG_ID" BIGINT PRIMARY KEY,
"NAME" VARCHAR(256) UNIQUE,
"DESC" VARCHAR(4000),
- "LOCATION_URI" VARCHAR(4000) NOT NULL,
- "CREATE_TIME" bigint
+ "LOCATION_URI" VARCHAR(4000) NOT NULL
);
--
@@ -78,8 +77,7 @@ CREATE TABLE "DBS" (
"NAME" character varying(128) DEFAULT NULL::character varying,
"OWNER_NAME" character varying(128) DEFAULT NULL::character varying,
"OWNER_TYPE" character varying(10) DEFAULT NULL::character varying,
- "CTLG_NAME" varchar(256),
- "CREATE_TIME" bigint
+ "CTLG_NAME" varchar(256)
);
http://git-wip-us.apache.org/repos/asf/hive/blob/4d5d8060/standalone-metastore/metastore-server/src/main/sql/postgres/upgrade-3.2.0-to-4.0.0.postgres.sql
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-server/src/main/sql/postgres/upgrade-3.2.0-to-4.0.0.postgres.sql b/standalone-metastore/metastore-server/src/main/sql/postgres/upgrade-3.2.0-to-4.0.0.postgres.sql
index 0bb0c2e..0c36069 100644
--- a/standalone-metastore/metastore-server/src/main/sql/postgres/upgrade-3.2.0-to-4.0.0.postgres.sql
+++ b/standalone-metastore/metastore-server/src/main/sql/postgres/upgrade-3.2.0-to-4.0.0.postgres.sql
@@ -11,9 +11,6 @@ UPDATE "WM_RESOURCEPLAN" SET "NS" = 'default' WHERE "NS" IS NULL;
ALTER TABLE "WM_RESOURCEPLAN" DROP CONSTRAINT "UNIQUE_WM_RESOURCEPLAN";
ALTER TABLE ONLY "WM_RESOURCEPLAN" ADD CONSTRAINT "UNIQUE_WM_RESOURCEPLAN" UNIQUE ("NS", "NAME");
--- HIVE-21077
-ALTER TABLE "DBS" ADD "CREATE_TIME" BIGINT;
-ALTER TABLE "CTLGS" ADD "CREATE_TIME" BIGINT;
-- These lines need to be last. Insert any changes above.
UPDATE "VERSION" SET "SCHEMA_VERSION"='4.0.0', "VERSION_COMMENT"='Hive release version 4.0.0' where "VER_ID"=1;
SELECT 'Finished upgrading MetaStore schema from 3.2.0 to 4.0.0';
http://git-wip-us.apache.org/repos/asf/hive/blob/4d5d8060/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/cache/TestCachedStore.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/cache/TestCachedStore.java b/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/cache/TestCachedStore.java
index 8696c2f..bb20d9f 100644
--- a/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/cache/TestCachedStore.java
+++ b/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/cache/TestCachedStore.java
@@ -1043,7 +1043,6 @@ public class TestCachedStore {
db.setOwnerName(dbOwner);
db.setOwnerType(PrincipalType.USER);
db.setCatalogName(DEFAULT_CATALOG_NAME);
- db.setCreateTime((int) (System.currentTimeMillis() / 1000));
return db;
}
http://git-wip-us.apache.org/repos/asf/hive/blob/4d5d8060/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client/TestCatalogs.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client/TestCatalogs.java b/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client/TestCatalogs.java
index 1f8e46a..28eb1fa 100644
--- a/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client/TestCatalogs.java
+++ b/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client/TestCatalogs.java
@@ -127,8 +127,6 @@ public class TestCatalogs extends MetaStoreClientTest {
Assert.assertTrue(catNames[i].equalsIgnoreCase(cat.getName()));
Assert.assertEquals(description[i], cat.getDescription());
Assert.assertEquals(location[i], cat.getLocationUri());
- Assert.assertTrue("Create time of catalog should be set", cat.isSetCreateTime());
- Assert.assertTrue("Create time of catalog should be non-zero", cat.getCreateTime() > 0);
File dir = new File(cat.getLocationUri());
Assert.assertTrue(dir.exists() && dir.isDirectory());
http://git-wip-us.apache.org/repos/asf/hive/blob/4d5d8060/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client/TestDatabases.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client/TestDatabases.java b/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client/TestDatabases.java
index 86b69f0..d323ac6 100644
--- a/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client/TestDatabases.java
+++ b/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client/TestDatabases.java
@@ -126,7 +126,6 @@ public class TestDatabases extends MetaStoreClientTest {
Database createdDatabase = client.getDatabase(database.getName());
// The createTime will be set on the server side, so the comparison should skip it
- database.setCreateTime(createdDatabase.getCreateTime());
Assert.assertEquals("Comparing databases", database, createdDatabase);
Assert.assertTrue("The directory should be created", metaStore.isPathExists(
new Path(database.getLocationUri())));
@@ -211,33 +210,6 @@ public class TestDatabases extends MetaStoreClientTest {
Assert.assertEquals("Default database owner", "public", database.getOwnerName());
Assert.assertEquals("Default database owner type", PrincipalType.ROLE, database.getOwnerType());
Assert.assertNull("Default database privileges", database.getPrivileges());
- Assert.assertTrue("database create time should be set", database.isSetCreateTime());
- Assert.assertTrue("Database create time should be non-zero", database.getCreateTime() > 0);
- }
-
- @Test
- public void testDatabaseCreateTime() throws Exception {
- // create db without specifying createtime
- Database testDb =
- new DatabaseBuilder().setName("test_create_time").create(client, metaStore.getConf());
- Database database = client.getDatabase("test_create_time");
- Assert.assertTrue("Database create time should have been set",
- database.getCreateTime() > 0);
- }
-
- @Test
- public void testDbCreateTimeOverride() throws Exception {
- // create db by providing a create time. Should be overridden, create time should
- // always be set by metastore
- Database testDb =
- new DatabaseBuilder().setName("test_create_time")
- .setCreateTime(1)
- .create(client, metaStore.getConf());
- Database database = client.getDatabase("test_create_time");
- Assert.assertTrue("Database create time should have been set",
- database.getCreateTime() > 0);
- Assert.assertTrue("Database create time should have been reset by metastore",
- database.getCreateTime() != 1);
}
@Test
@@ -461,7 +433,6 @@ public class TestDatabases extends MetaStoreClientTest {
.setDescription("dummy description 2")
.addParam("param_key_1", "param_value_1_2")
.addParam("param_key_2_3", "param_value_2_3")
- .setCreateTime(originalDatabase.getCreateTime())
.build(metaStore.getConf());
client.alterDatabase(originalDatabase.getName(), newDatabase);
http://git-wip-us.apache.org/repos/asf/hive/blob/4d5d8060/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/tools/TestSchemaToolForMetastore.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/tools/TestSchemaToolForMetastore.java b/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/tools/TestSchemaToolForMetastore.java
index 878759d..c2eb6c9 100644
--- a/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/tools/TestSchemaToolForMetastore.java
+++ b/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/tools/TestSchemaToolForMetastore.java
@@ -110,12 +110,11 @@ public class TestSchemaToolForMetastore {
boolean isValid = validator.validateSequences(conn);
Assert.assertTrue(isValid);
- String time = String.valueOf(System.currentTimeMillis()/1000);
// Test valid case
String[] scripts = new String[] {
- "insert into CTLGS values(99, 'test_cat_1', 'description', 'hdfs://myhost.com:8020/user/hive/warehouse/mydb', " + time + ");",
+ "insert into CTLGS values(99, 'test_cat_1', 'description', 'hdfs://myhost.com:8020/user/hive/warehouse/mydb');",
"insert into SEQUENCE_TABLE values('org.apache.hadoop.hive.metastore.model.MDatabase', 100);",
- "insert into DBS values(99, 'test db1', 'hdfs:///tmp', 'db1', 'test', 'test', 'test_cat_1', " + time + ");"
+ "insert into DBS values(99, 'test db1', 'hdfs:///tmp', 'db1', 'test', 'test', 'test_cat_1');"
};
File scriptFile = generateTestScript(scripts);
schemaTool.execSql(scriptFile.getPath());
@@ -127,7 +126,7 @@ public class TestSchemaToolForMetastore {
"delete from SEQUENCE_TABLE;",
"delete from DBS;",
"insert into SEQUENCE_TABLE values('org.apache.hadoop.hive.metastore.model.MDatabase', 100);",
- "insert into DBS values(102, 'test db1', 'hdfs:///tmp', 'db1', 'test', 'test', 'test_cat_1', " + time + ");"
+ "insert into DBS values(102, 'test db1', 'hdfs:///tmp', 'db1', 'test', 'test', 'test_cat_1');"
};
scriptFile = generateTestScript(scripts);
schemaTool.execSql(scriptFile.getPath());
@@ -388,12 +387,11 @@ public class TestSchemaToolForMetastore {
isValid = validator.validateLocations(conn, new URI[] {defaultRoot, defaultRoot2});
Assert.assertTrue(isValid);
- String time = String.valueOf(System.currentTimeMillis()/1000);
// Test valid case
String[] scripts = new String[] {
- "insert into CTLGS values(3, 'test_cat_2', 'description', 'hdfs://myhost.com:8020/user/hive/warehouse/mydb', " + time + ");",
- "insert into DBS values(2, 'my db', 'hdfs://myhost.com:8020/user/hive/warehouse/mydb', 'mydb', 'public', 'role', 'test_cat_2', " + time + ");",
- "insert into DBS values(7, 'db with bad port', 'hdfs://myhost.com:8020/', 'haDB', 'public', 'role', 'test_cat_2', " + time + ");",
+ "insert into CTLGS values(3, 'test_cat_2', 'description', 'hdfs://myhost.com:8020/user/hive/warehouse/mydb');",
+ "insert into DBS values(2, 'my db', 'hdfs://myhost.com:8020/user/hive/warehouse/mydb', 'mydb', 'public', 'role', 'test_cat_2');",
+ "insert into DBS values(7, 'db with bad port', 'hdfs://myhost.com:8020/', 'haDB', 'public', 'role', 'test_cat_2');",
"insert into SDS(SD_ID,CD_ID,INPUT_FORMAT,IS_COMPRESSED,IS_STOREDASSUBDIRECTORIES,LOCATION,NUM_BUCKETS,OUTPUT_FORMAT,SERDE_ID) values (1,null,'org.apache.hadoop.mapred.TextInputFormat','N','N','hdfs://myhost.com:8020/user/hive/warehouse/mydb',-1,'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat',null);",
"insert into SDS(SD_ID,CD_ID,INPUT_FORMAT,IS_COMPRESSED,IS_STOREDASSUBDIRECTORIES,LOCATION,NUM_BUCKETS,OUTPUT_FORMAT,SERDE_ID) values (2,null,'org.apache.hadoop.mapred.TextInputFormat','N','N','hdfs://myhost.com:8020/user/admin/2015_11_18',-1,'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat',null);",
"insert into SDS(SD_ID,CD_ID,INPUT_FORMAT,IS_COMPRESSED,IS_STOREDASSUBDIRECTORIES,LOCATION,NUM_BUCKETS,OUTPUT_FORMAT,SERDE_ID) values (3,null,'org.apache.hadoop.mapred.TextInputFormat','N','N',null,-1,'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat',null);",
@@ -420,10 +418,10 @@ public class TestSchemaToolForMetastore {
"delete from TBLS;",
"delete from SDS;",
"delete from DBS;",
- "insert into DBS values(2, 'my db', '/user/hive/warehouse/mydb', 'mydb', 'public', 'role', 'test_cat_2', " + time + ");",
- "insert into DBS values(4, 'my db2', 'hdfs://myhost.com:8020', '', 'public', 'role', 'test_cat_2', " + time + ");",
- "insert into DBS values(6, 'db with bad port', 'hdfs://myhost.com:8020:', 'zDB', 'public', 'role', 'test_cat_2', " + time + ");",
- "insert into DBS values(7, 'db with bad port', 'hdfs://mynameservice.com/', 'haDB', 'public', 'role', 'test_cat_2', " + time + ");",
+ "insert into DBS values(2, 'my db', '/user/hive/warehouse/mydb', 'mydb', 'public', 'role', 'test_cat_2');",
+ "insert into DBS values(4, 'my db2', 'hdfs://myhost.com:8020', '', 'public', 'role', 'test_cat_2');",
+ "insert into DBS values(6, 'db with bad port', 'hdfs://myhost.com:8020:', 'zDB', 'public', 'role', 'test_cat_2');",
+ "insert into DBS values(7, 'db with bad port', 'hdfs://mynameservice.com/', 'haDB', 'public', 'role', 'test_cat_2');",
"insert into SDS(SD_ID,CD_ID,INPUT_FORMAT,IS_COMPRESSED,IS_STOREDASSUBDIRECTORIES,LOCATION,NUM_BUCKETS,OUTPUT_FORMAT,SERDE_ID) values (1,null,'org.apache.hadoop.mapred.TextInputFormat','N','N','hdfs://yourhost.com:8020/user/hive/warehouse/mydb',-1,'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat',null);",
"insert into SDS(SD_ID,CD_ID,INPUT_FORMAT,IS_COMPRESSED,IS_STOREDASSUBDIRECTORIES,LOCATION,NUM_BUCKETS,OUTPUT_FORMAT,SERDE_ID) values (2,null,'org.apache.hadoop.mapred.TextInputFormat','N','N','file:///user/admin/2015_11_18',-1,'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat',null);",
"insert into TBLS(TBL_ID,CREATE_TIME,DB_ID,LAST_ACCESS_TIME,OWNER,RETENTION,SD_ID,TBL_NAME,TBL_TYPE,VIEW_EXPANDED_TEXT,VIEW_ORIGINAL_TEXT,IS_REWRITE_ENABLED) values (2 ,1435255431,2,0 ,'hive',0,1,'mytal','MANAGED_TABLE',NULL,NULL,'n');",
@@ -520,10 +518,9 @@ public class TestSchemaToolForMetastore {
// Insert the records in DB to simulate a hive table
private void createTestHiveTableSchemas() throws IOException {
- String time = String.valueOf(System.currentTimeMillis()/1000);
String[] scripts = new String[] {
- "insert into CTLGS values (1, 'mycat', 'my description', 'hdfs://myhost.com:8020/user/hive/warehouse', " + time + ");",
- "insert into DBS values(2, 'my db', 'hdfs://myhost.com:8020/user/hive/warehouse/mydb', 'mydb', 'public', 'role', 'mycat', " + time + ");",
+ "insert into CTLGS values (1, 'mycat', 'my description', 'hdfs://myhost.com:8020/user/hive/warehouse');",
+ "insert into DBS values(2, 'my db', 'hdfs://myhost.com:8020/user/hive/warehouse/mydb', 'mydb', 'public', 'role', 'mycat');",
"insert into SDS(SD_ID,CD_ID,INPUT_FORMAT,IS_COMPRESSED,IS_STOREDASSUBDIRECTORIES,LOCATION,NUM_BUCKETS,OUTPUT_FORMAT,SERDE_ID) values (1,null,'org.apache.hadoop.mapred.TextInputFormat','N','N','hdfs://myhost.com:8020/user/hive/warehouse/mydb',-1,'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat',null);",
"insert into SDS(SD_ID,CD_ID,INPUT_FORMAT,IS_COMPRESSED,IS_STOREDASSUBDIRECTORIES,LOCATION,NUM_BUCKETS,OUTPUT_FORMAT,SERDE_ID) values (2,null,'org.apache.hadoop.mapred.TextInputFormat','N','N','hdfs://myhost.com:8020/user/admin/2015_11_18',-1,'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat',null);",
"insert into TBLS(TBL_ID,CREATE_TIME,DB_ID,LAST_ACCESS_TIME,OWNER,RETENTION,SD_ID,TBL_NAME,TBL_TYPE,VIEW_EXPANDED_TEXT,VIEW_ORIGINAL_TEXT,IS_REWRITE_ENABLED) values (2 ,1435255431,2,0 ,'hive',0,1,'mytal','MANAGED_TABLE',NULL,NULL,'n');",