Comments (3)
Thanks for taking time to report the potential issue. However this is intentional: Attributes are multi-valued by default. SimpleAttribute restricts it to return a single value for each object. And in an index a primary key must have be a single value which identifies an object. If you have any questions you can use the forum!
from cqengine.
Thank you for your response. But then, I think there is no reason for the SimpleAttribute to be part of the Attribute hierarchy. Moreover I can override the getValues method from the SimpleAttribute abstract object and most likely cause a disaster as the getValue method relies on the fact that the getValues returns a singletonList. And you can get rid off this a bit cumbersome code (SimpleQuery):
if (attribute instanceof SimpleAttribute) {
this.attributeIsSimple = true;
this.simpleAttribute = (SimpleAttribute<O, A>) attribute;
}
else {
this.attributeIsSimple = false;
this.simpleAttribute = null;
}
But anyway thank you. This library is great.
from cqengine.
Thanks yshadow. That code looks cumbersome but it is intentional though.
When CQEngine is evaluating queries and an index is not available on an attribute mentioned in the query, it will scan the collection and ask the attribute to provide values belonging to the (potentially many) objects in turn. This code exists to reduce the amount of garbage objects created during that scan. When it is dealing with a SimpleAttribute, the engine will call getValue() instead of getValues() which avoids allocating a List for each object.
from cqengine.
Related Issues (20)
- FilteringIterator returns hasNext as true after the collection is consumed HOT 1
- Update data automatically HOT 1
- Pagination Over data HOT 4
- Perfomance index HOT 3
- Consider exposing utility static method taking collections
- Reenable cached hashCode
- Support for java.util.Optional
- [Question] How does CQEngine pick the appropriate index to query?
- most longest prefix value exist in the column value but it doesn't intersect with other columns values in the query that we need part of query retrieval HOT 7
- Support STRICT_REPLACEMENT in ObjectLockingIndexedCollection/ConcurrentIndexedCollection
- TransactionalIndexedCollection support for UniqueIndex is broken
- Support for attribute accessors for Java record type HOT 1
- Kryo generates InaccessibleObjectException - Make Dependencies "Java 17 compatible"
- Bug in AttributeOrdersComparator HOT 5
- Offheap cache visibility HOT 1
- Support for ANTLR 4.10.1 HOT 12
- Does it support SQL statistics queries HOT 3
- Thread blocked when using Materialized View Sort For the Longest Prefix for CSV that contain more than 11 K rows HOT 3
- Error while parsing SQL NOT LIKE query HOT 1
- Error while parsing SQL LIKE '%%%' query
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cqengine.