Java Code Examples for org.apache.pig.impl.logicalLayer.schema.Schema#equals()

The following examples show how to use org.apache.pig.impl.logicalLayer.schema.Schema#equals() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FuncSpec.java    From spork with Apache License 2.0 6 votes vote down vote up
@Override
public boolean equals(Object other) {
    if (other != null && other instanceof FuncSpec) {
        FuncSpec ofs = (FuncSpec)other;
        if (!className.equals(ofs.className)) return false;
        if (ctorArgs == null && ofs.ctorArgs != null ||
                ctorArgs != null && ofs.ctorArgs == null) {
            return false;
        }
       
        if (ctorArgs != null && ofs.ctorArgs != null) {
            if (ctorArgs.length != ofs.ctorArgs.length) return false;
            for (int i = 0; i < ctorArgs.length; i++) {
                if (!ctorArgs[i].equals(ofs.ctorArgs[i])) return false;
            }
        }
        return Schema.equals(inputArgsSchema, ofs.inputArgsSchema, false, true);
    } else {
        return false;
    }
}
 
Example 2
Source File: StructuresHelper.java    From spork with Apache License 2.0 5 votes vote down vote up
@Override
public boolean equals(Object o) {
    if (!(o instanceof SchemaKey)) {
        return false;
    }
    Schema other = ((SchemaKey)o).get();
    return (s == null && other == null) || Schema.equals(s, other, false, true);
}
 
Example 3
Source File: TOBAG.java    From spork with Apache License 2.0 5 votes vote down vote up
private boolean nullEquals(Schema currentSchema, Schema newSchema) {
    if(currentSchema == null){
        if(newSchema != null){
            return false;
        }
        return true;
    }
    return Schema.equals(currentSchema, newSchema, false, true);
}
 
Example 4
Source File: TOBAG2.java    From spork with Apache License 2.0 5 votes vote down vote up
private boolean nullEquals(Schema currentSchema, Schema newSchema) {
    if(currentSchema == null){
        if(newSchema != null){
            return false;
        }
        return true;
    }
    return currentSchema.equals(newSchema);
}
 
Example 5
Source File: TestSchemaTuple.java    From spork with Apache License 2.0 3 votes vote down vote up
private void testNotAppendable(SchemaTupleFactory tf, Schema udfSchema) throws Exception {
    SchemaTuple<?> st = tf.newTuple();
    Schema.equals(udfSchema, st.getSchema(), false, true);

    assertEquals(udfSchema.size(), st.size());

    testHashCodeEqualAsNormalTuple(tf);

    shouldAllBeNull(tf);

    copyThenCompare(tf);

    testSerDe(tf);
    testInterStorageSerDe(tf);
}