eql-methods: Test if two objects point to the same table

Description Usage Arguments Details Value Author(s) See Also Examples

Description

This function checks if two db.obj objects are the equivalent. For objects of class db.data.frame, they need to have the same associated table. For objects of other types, they need to have identical expressions and the same associated table.

Usage

1
2
## S4 method for signature 'db.obj,db.obj'
eql(e1,e2)

Arguments

e1, e2

The signature of the method. Both arguments are db.obj objects to be checked for equality.

Details

Objects of type db.data.frame are considered equal if they have the same content representation, and their associated tables have the same name, connected datbase, and type. Objects of other types derived from db.obj are considered equal if they have the same values for content representation, @.source, @.parent, @.expression, @.where, @.conn.id, @.col.data_type, @.is.factor and @.col.name. Two objects of different types are always considered not equal.

Value

A logical. Returns TRUE is the objects are equal.

Author(s)

Author: Predictive Analytics Team at Pivotal Inc.

Maintainer: Frank McQuillan, Pivotal Inc. fmcquillan@pivotal.io

See Also

lk or lookat Displays the actual data in a db.obj object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
## Not run: 


## set up the database connection
## Assume that .port is port number and .dbname is the database name
cid <- db.connect(port = .port, dbname = .dbname, verbose = FALSE)

delete("abalone", conn.id = cid)
as.db.data.frame(abalone, "abalone", conn.id = cid, verbose = FALSE)

x <- db.data.frame('abalone', conn.id = cid, key = 'id') # use default connection 1

y <- db.data.frame('abalone', conn.id = cid)

## Check for equality
eql(x,y) # This returns true

## create a db.Rquery object
z <- x[,] # x is a db.data.frame object, but z is not

eql(x,z) # This returns false

db.disconnect(cid, verbose = FALSE)

## End(Not run)


Search within the PivotalR package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.