Reputation: 103
i am going to store nginx logs in either simpledb or in bigtable.
i want to know if simpledb or bigtable support regular expressions query (like in mongodb)
Upvotes: 0
Views: 282
Reputation: 4054
Regarding Bigtable, it does support regex. I believe that @timmers correctly assumed that the poster was referring to AppEngine storage since Cloud Bigtable wasn't available in 2011, but now that Cloud Bigtable is publicly available, I want to make sure that people that search for this know that it is supported: https://googleapis.dev/java/google-cloud-clients/latest/com/google/cloud/bigtable/data/v2/models/Filters.ValueFilter.html#regex-java.lang.String-
Upvotes: 3
Reputation: 65
Simple answer here is no for either AppEngine or SimpleDB.
Appengine's queries are relatively restricted AppEngine java query documentation and can only filter on queries with the following operators :-
Query.FilterOperator.LESS_THAN
Query.FilterOperator.LESS_THAN_OR_EQUAL
Query.FilterOperator.EQUAL
Query.FilterOperator.GREATER_THAN
Query.FilterOperator.GREATER_THAN_OR_EQUAL
Query.FilterOperator.NOT_EQUAL
Query.FilterOperator.IN (equal to any of the values in the provided list)
SimpleDB is slightly more sophisticated in its queries, but only stretches as far as old-style SQL like Amaozn SimpleDB Query Documentation, which can take a '%' before/after some text to allow startswith or endswith type operation.
With either product the intended usage pattern if needing to perform queries which were not anticipated ahead of time is more to perform a map-reduce type operation on the data and have the regexp filter be applied over the resulting dataset at application level rather than attempt to provide it inside the DB.
Alternatively if you know your regexps up-front, you could pre-apply your regexps these and store the results in whichever datastore.
Upvotes: 1