mirror of
https://github.com/apache/sqoop.git
synced 2025-05-02 17:40:39 +08:00
SQOOP-3428: Fix the CI
(Fokko Driesprong via Fero Szabo)
This commit is contained in:
parent
5ab5190304
commit
20fe120706
@ -15,5 +15,5 @@
|
||||
|
||||
ALTER SESSION SET "_ORACLE_SCRIPT"=true;
|
||||
CREATE USER SQOOPTEST2 identified by ABCDEF;
|
||||
GRANT CONNECT, RESOURCE to SQOOPTEST2;
|
||||
GRANT CONNECT, RESOURCE, DBA to SQOOPTEST2;
|
||||
ALTER USER SQOOPTEST2 quota unlimited on USERS;
|
||||
|
@ -94,10 +94,11 @@ services:
|
||||
timeout: 10s
|
||||
retries: 60
|
||||
oracle:
|
||||
image: sath89/oracle-xe-11g
|
||||
image: acktsw/oracle-xe-11g
|
||||
container_name: sqoop_oracle_container
|
||||
environment:
|
||||
COMPOSE_HTTP_TIMEOUT: 200
|
||||
DEFAULT_SYS_PASS: oracle
|
||||
ports:
|
||||
- 1521:1521
|
||||
volumes:
|
||||
|
@ -192,11 +192,11 @@ protected String getBlobInsertStr(String blobData) {
|
||||
}
|
||||
|
||||
protected String getBinaryFloatInsertStr(float f) {
|
||||
return "TO_BINARY_FLOAT('" + f + "')";
|
||||
return "TO_BINARY_FLOAT(" + f + "F)";
|
||||
}
|
||||
|
||||
protected String getBinaryDoubleInsertStr(double d) {
|
||||
return "TO_BINARY_DOUBLE('" + d + "')";
|
||||
return "TO_BINARY_DOUBLE(" + d + "D)";
|
||||
}
|
||||
|
||||
// Disable this test since Oracle isn't ANSI compliant.
|
||||
@ -249,24 +249,20 @@ public void testBinaryFloat() {
|
||||
verifyType("BINARY_FLOAT", getBinaryFloatInsertStr(+6.34f), "6.34");
|
||||
|
||||
// Max and min are from Oracle DB SQL reference for 10g release 2
|
||||
float max = 3.40282E+38F;
|
||||
verifyType("BINARY_FLOAT", getBinaryFloatInsertStr(max), "3.40282E38");
|
||||
float min = 1.17549E-38F;
|
||||
verifyType("BINARY_FLOAT", getBinaryFloatInsertStr(min), "1.17549E-38");
|
||||
// https://stackoverflow.com/questions/3884793/why-is-double-min-value-in-not-negative
|
||||
verifyType("BINARY_FLOAT", getBinaryFloatInsertStr(Float.MAX_VALUE), "3.4028235E38");
|
||||
verifyType("BINARY_FLOAT", getBinaryFloatInsertStr(-Float.MAX_VALUE), "-3.4028235E38");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBinaryDouble() {
|
||||
verifyType("BINARY_DOUBLE", getBinaryDoubleInsertStr(0.5d), "0.5");
|
||||
verifyType("BINARY_DOUBLE", getBinaryDoubleInsertStr(-1d), "-1.0");
|
||||
verifyType("BINARY_DOUBLE", getBinaryDoubleInsertStr(0.5), "0.5");
|
||||
verifyType("BINARY_DOUBLE", getBinaryDoubleInsertStr(-1), "-1.0");
|
||||
|
||||
// Max and min are from Oracle DB SQL reference for 10g release 2
|
||||
double max = 1.79769313486231E+308;
|
||||
verifyType("BINARY_DOUBLE", getBinaryDoubleInsertStr(max),
|
||||
"1.79769313486231E308");
|
||||
double min = 2.22507485850720E-308;
|
||||
verifyType("BINARY_DOUBLE", getBinaryDoubleInsertStr(min),
|
||||
"2.2250748585072E-308");
|
||||
// https://stackoverflow.com/questions/3884793/why-is-double-min-value-in-not-negative
|
||||
verifyType("BINARY_DOUBLE", getBinaryDoubleInsertStr(Double.MAX_VALUE), "1.7976931348623157E308");
|
||||
verifyType("BINARY_DOUBLE", getBinaryDoubleInsertStr(-Double.MAX_VALUE), "-1.7976931348623157E308");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -130,16 +130,16 @@ public class OracleManagerTest extends ImportJobTestCase {
|
||||
+ "PRIMARY KEY (id))",
|
||||
"INSERT INTO " + TABLE_NAME + " VALUES("
|
||||
+ "1,'Aaron',to_date('2009-05-14','yyyy-mm-dd'),"
|
||||
+ "1000000.00,'engineering','29-DEC-09 12.00.00.000000000 PM',"
|
||||
+ "'29-DEC-09 12.00.00.000000000 PM')",
|
||||
+ "1000000.00,'engineering',TO_TIMESTAMP('29-DEC-09 12.00.00.000000000 PM', 'DD-MON-RR HH12.MI.SS.FF PM'),"
|
||||
+ "TO_TIMESTAMP('29-DEC-09 12.00.00.000000000 PM', 'DD-MON-RR HH12.MI.SS.FF PM'))",
|
||||
"INSERT INTO " + TABLE_NAME + " VALUES("
|
||||
+ "2,'Bob',to_date('2009-04-20','yyyy-mm-dd'),"
|
||||
+ "400.00,'sales','30-DEC-09 12.00.00.000000000 PM',"
|
||||
+ "'30-DEC-09 12.00.00.000000000 PM')",
|
||||
+ "400.00,'sales',TO_TIMESTAMP('30-DEC-09 12.00.00.000000000 PM', 'DD-MON-RR HH12.MI.SS.FF PM'),"
|
||||
+ "TO_TIMESTAMP('30-DEC-09 12.00.00.000000000 PM', 'DD-MON-RR HH12.MI.SS.FF PM'))",
|
||||
"INSERT INTO " + TABLE_NAME + " VALUES("
|
||||
+ "3,'Fred',to_date('2009-01-23','yyyy-mm-dd'),15.00,"
|
||||
+ "'marketing','31-DEC-09 12.00.00.000000000 PM',"
|
||||
+ "'31-DEC-09 12.00.00.000000000 PM')",
|
||||
+ "'marketing', TO_TIMESTAMP('31-DEC-09 12.00.00.000000000 PM', 'DD-MON-RR HH12.MI.SS.FF PM'),"
|
||||
+ "TO_TIMESTAMP('31-DEC-09 12.00.00.000000000 PM', 'DD-MON-RR HH12.MI.SS.FF PM'))",
|
||||
};
|
||||
|
||||
/*
|
||||
@ -258,7 +258,9 @@ public void setUp() {
|
||||
public void tearDown() {
|
||||
super.tearDown();
|
||||
try {
|
||||
if(manager != null) {
|
||||
manager.close();
|
||||
}
|
||||
} catch (SQLException sqlE) {
|
||||
LOG.error("Got SQLException: " + sqlE.toString());
|
||||
fail("Got SQLException: " + sqlE.toString());
|
||||
|
@ -53,9 +53,6 @@ public final class OracleUtils {
|
||||
public static final int INTEGRATIONTEST_NUM_ROWS = 10000;
|
||||
// Number of mappers if wanting to override default setting
|
||||
public static final int NUM_MAPPERS = 0;
|
||||
// Oracle degree of parallelism to use when creating table.
|
||||
// If 0 we will calculate a recommended value
|
||||
public static final int ORACLE_PARALLEL_DEGREE = 0;
|
||||
|
||||
private OracleUtils() { }
|
||||
|
||||
|
@ -490,13 +490,11 @@ protected String toLowerHexString(String str) {
|
||||
* different than what ResultSet.getString() returns, which is used
|
||||
* by returnVal.
|
||||
*/
|
||||
protected void verifyType(String colType, String insertVal,
|
||||
String seqFileVal) {
|
||||
protected void verifyType(String colType, String insertVal, String seqFileVal) {
|
||||
verifyType(colType, insertVal, seqFileVal, false);
|
||||
}
|
||||
|
||||
protected void verifyType(String colType, String insertVal, String seqFileVal,
|
||||
boolean useIntPrimaryKey) {
|
||||
protected void verifyType(String colType, String insertVal, String seqFileVal, boolean useIntPrimaryKey) {
|
||||
|
||||
String readbackPrepend = "";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user