@Test (expectedExceptions = SqoopException.class) public void testConvertWhenToSchemaIsLongerThanFromSchemaFail() { Schema from = SchemaFixture.createSchema("from", 2); Schema to = SchemaFixture.createSchema("to", 4); to.getColumnsList().get(2).setNullable(true); to.getColumnsList().get(3).setNullable(false); matcher = new LocationMatcher(from, to); Object[] fields = new Object[] {"t1", "t2"}; matcher.getMatchingData(fields); }
@Override public Object[] getMatchingData(Object[] fields) { if (getToSchema().isEmpty()) { return fields; } Object[] out = new Object[getToSchema().getColumnsCount()]; int i = 0; for (Column col : getToSchema().getColumnsList()) { if (i < fields.length) { out[i] = fields[i]; } else { tryFillNullInArrayForUnexpectedColumn(col, out, i); } i++; } return out; }
LocationMatcher extends Matcher { @Override public Object[] getMatchingData(Object[] fields) { if (getToSchema().isEmpty()) { return fields; } Object[] out = new Object[getToSchema().getColumnsCount()]; int i = 0; for (Column col : getToSchema().getColumnsList()) { if (i < fields.length) { out[i] = fields[i]; } else { tryFillNullInArrayForUnexpectedColumn(col, out, i); } i++; } return out; } }
LocationMatcher extends Matcher { @Override public Object[] getMatchingData(Object[] fields) { if (getToSchema().isEmpty()) { return fields; } Object[] out = new Object[getToSchema().getColumnsCount()]; int i = 0; for (Column col : getToSchema().getColumnsList()) { if (i < fields.length) { out[i] = fields[i]; } else { tryFillNullInArrayForUnexpectedColumn(col, out, i); } i++; } return out; } LocationMatcher(Schema from, Schema to); }
LocationMatcher extends Matcher { @Override public Object[] getMatchingData(Object[] fields) { if (getToSchema().isEmpty()) { return fields; } Object[] out = new Object[getToSchema().getColumnsCount()]; int i = 0; for (Column col : getToSchema().getColumnsList()) { if (i < fields.length) { out[i] = fields[i]; } else { tryFillNullInArrayForUnexpectedColumn(col, out, i); } i++; } return out; } LocationMatcher(Schema from, Schema to); @Override Object[] getMatchingData(Object[] fields); }
LocationMatcher extends Matcher { @Override public Object[] getMatchingData(Object[] fields) { if (getToSchema().isEmpty()) { return fields; } Object[] out = new Object[getToSchema().getColumnsCount()]; int i = 0; for (Column col : getToSchema().getColumnsList()) { if (i < fields.length) { out[i] = fields[i]; } else { tryFillNullInArrayForUnexpectedColumn(col, out, i); } i++; } return out; } LocationMatcher(Schema from, Schema to); @Override Object[] getMatchingData(Object[] fields);  }