gora-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Enis Söztutar <enis....@gmail.com>
Subject Re: Semantics of deleteByQuery
Date Mon, 25 Oct 2010 00:27:10 GMT

Yeah, we definitely need to fix the semantics of the API before the first
so that the expected results from operations are clear. I think we can open
to track down these kind of things.

I think deleteByQuery() should have the semantics of HBaseStore's
that is if the query has fields set, then only those fields should be
deleted. A test in
DataStoreTestUtil also reflects that kind of operation. HBase and other
have a column oriented data modeling, so we should be able to utilize this
to the full extend.
However, deleting columns in some data stores does not make sense, as in the
case of
SQL and possibly Solr. So for these, we need to either disable deleteByQuery
for queries
with fields, ignore the operation or delete the whole row, or set deleted
columns to NULL. I think
throwing an exception in SQL and Solr stores when fields are set would be

In either case, I completely agree that the semantics should be reflected in
the javadoc.
Also, we may develop a MetaData object which we can use to query the
properties (such as isDeleteByQueryFieldsSetable() or such.)


On Sat, Oct 23, 2010 at 1:34 AM, Andrzej Bialecki <ab@getopt.org> wrote:

> Hi,
> I'm working on GORA-9, and I'm confused about the semantics of
> DataStore.deleteByQuery. My question is motivated by
> DataStoreTestUtil.testDeleteByQuery(), which is failing for me.
> So, that's what I could figure out about deleteByQuery so far:
> * In CassandraStore it's apparently not implemented. Bummer.
> * In SqlStore it seems to consider only the range (or a specific value)
> of primaryKey-s, regardless of fields that the query specifies. I.e. it
> deletes whole rows.
> * In HBaseStore it seems to consider both the primary key (value or
> range) AND the fields, and deletes only from columns that match
> specified fields, thus leaving partial rows. I understand that this is
> motivated by the need to set some Persistent properties to null. But
> isn't this in conflict with the semantics of SqlStore.deleteByQuery,
> when query contains not all fields?
> Additionally, delete* operations seem to imply a subsequent flush() to
> persist the changes, because subsequent execute() or get() is expected
> to yield no deleted rows.
> Anyway, we need more docs :) even a javadoc clarification of the above
> would help a lot.
> --
> Best regards,
> Andrzej Bialecki     <><
>  ___. ___ ___ ___ _ _   __________________________________
> [__ || __|__/|__||\/|  Information Retrieval, Semantic Web
> ___|||__||  \|  ||  |  Embedded Unix, System Integration
> http://www.sigram.com  Contact: info at sigram dot com

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message