mirror of
https://github.com/apache/sqoop.git
synced 2025-05-04 19:21:46 +08:00
SQOOP-2833: Sqoop2: Integration Tests: Allow setting which "time type" should be used based on the DatabaseProvider
(Abraham Fine via Jarek Jarcec Cecho)
This commit is contained in:
parent
e06190b2f8
commit
d6a24fc0b8
@ -513,4 +513,15 @@ public String getTableFragment(TableName tableName) {
|
||||
*/
|
||||
public void dropDatabase(String databaseName) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Different databases handle datetimes/timestamps in different ways.
|
||||
*
|
||||
* This is the type we should use when creating schemas.
|
||||
*
|
||||
* @return A string representing a SQL datatype
|
||||
*/
|
||||
public String getDateTimeType() {
|
||||
return "timestamp";
|
||||
}
|
||||
}
|
||||
|
@ -116,4 +116,9 @@ public String escapeName(String entity) {
|
||||
public String escapeValue(String entity) {
|
||||
return "\'" + entity + "\'";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDateTimeType() {
|
||||
return "datetime";
|
||||
}
|
||||
}
|
||||
|
@ -90,4 +90,9 @@ public String getJdbcDriver() {
|
||||
public String escape(String entity) {
|
||||
return "[" + entity + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDateTimeType() {
|
||||
return "datetime";
|
||||
}
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ public DataSet createTables() {
|
||||
"id",
|
||||
"id", "int",
|
||||
"country", "varchar(50)",
|
||||
"some_date", "timestamp",
|
||||
"some_date", provider.getDateTimeType(),
|
||||
"city", "varchar(50)"
|
||||
);
|
||||
|
||||
|
@ -41,7 +41,7 @@ public DataSet createTables() {
|
||||
"id", "int",
|
||||
"code_name", "varchar(64)",
|
||||
"version", "numeric(4,2)",
|
||||
"release_date", "timestamp"
|
||||
"release_date", provider.getDateTimeType()
|
||||
);
|
||||
|
||||
return this;
|
||||
|
Loading…
Reference in New Issue
Block a user