dwhjames / fakesdb Goto Github PK
View Code? Open in Web Editor NEWThis project forked from stephenh/fakesdb
a fake version of Amazon's SimpleDB for local/integration testing
This project forked from stephenh/fakesdb
a fake version of Amazon's SimpleDB for local/integration testing
Consider the following query:
select * from mydomain where Rating like '****%'
To turn the comparison string '****%'
into a regular expression, we must use the Scala string """\*\*\*.*"""
. We must also allow for escaping of %
, so the comparison string '%3\%'
should become """.*3%"""
.
The and
operator, for composing predicates, has the same implementation of intersection
. Consider the following query:
select * from mydomain where Keyword = 'Book' and Keyword = 'Hardcover'
This can’t return anything other than the empty set, as a Keyword
attribute can’t be both 'Book'
and 'Hardcover'
.
There are several important things to understand about predicate execution against attributes with multiple values:
- Each attribute value is considered individually against the comparison conditions defined in the predicate.
- Item names will be selected if ANY of the values match the predicate condition
Instead, the intersection
operator will intersect the sets that satisfy each predicate independently. The following query can be successful.
select * from mydomain where Keyword = 'Book' intersection Keyword = 'Hardcover'
The and
operator is incorrectly implemented as the intersection
operator. Furthermore, the or
operator is implemented as a union operation, which, while it still it gives the correct result, is more costly than necessary, just as with intersection.
Consider the following query:
select itemName() from mydomain where itemName() like 'B000%' order by itemName()
The identifier itemName()
is not recognized and given special treatment in where clause predicates.
From the Amazon SimpleDB documentation on Sorting
All sort operations are performed in lexicographical order.
The sort attribute must be present in at least one of the predicates of the expression.
Because returned results must contain the attribute on which you are sorting, do not use is null on the sort attribute. For example, select * from mydomain where author is null and title is not null order by title will succeed. However, select * from mydomain where author is null order by title will fail because title is not constrained by the not null predicate.
The following query should throw an InvalidSortExpression
exception:
select * from mydomain order by Year asc
with the error message
The sort attribute must be present in at least one of the predicates, and the predicate cannot contain the is null operator.
The following query is unsupported by the query parser:
select * from mydomain where every(keyword) in ('Book', 'Paperback')
(Taken from the SimpleDB Documentation for Queries on Attributes with Multiple Values)
Each attribute is considered individually against the comparison conditions defined in the predicate. Item names are selected if any of the values match the predicate condition. To change this behavior, use the every() operator to return results where every attribute matches the query expression.
Currently, only the binary operators are supported: =, !=, >, <, >=, <=, like, not like.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.