|
I verified the problem with PostGIS - the effect is identical.
I looked into the code and decided to hack the basic implementation "SQLEncoder" : public void visit(LiteralExpression expression) throws RuntimeException { LOGGER.finer("exporting LiteralExpression"); try { Object literal = expression.getLiteral(); short type = expression.getType(); switch (type) { case Expression.LITERAL_DOUBLE: case Expression.LITERAL_INTEGER: // JL@BGS 12-10-2005: // temporary hack - should be fixed by someone who has far more understanding ... // out.write(literal.toString()); // // break; // case Expression.LITERAL_STRING: out.write("'" + literal + "'"); break; case Expression.LITERAL_GEOMETRY: visitLiteralGeometry(expression); break; default: throw new RuntimeException("type: " + type + "not supported"); } } catch (java.io.IOException ioe) { throw new RuntimeException("IO problems writing literal", ioe); } } I can't believe we are the only ones to run into this problem. For Tables with more than approx. 500000 entries this bug leads to extremely long response times. As this bug is no longer tied to Oracle, I reassigned it to module "main". Hope, that's ok for everybody. Thanks for putting this into jira.
We need to confirm that this problem is still applicable for 2.4.0 - it may already be fixed by the move to a different SQLEncoder / Splitter - and the change to a more capable Filter API (that can smoothly morph from String to Int to match the table column type.
Should have been fixed indeed, but I have no time to check... anyways, assigned to Oracle module as well (if any sponsoring comes up to fix Oracle ds a bit more I'll try to check this one too)
Relaxing the issue criticality... it's probably fixed, and an issue for an unmaintained module should not pose any concern to the release process anyways
|
||||||||||||||||||||||||||||||||||||||||
needs to be much more aware of the schema its interacting with.
The original implementors looked at <Literal> elements and said "if this
looks like a number, then treat it like a number". Unfortunately, this
is a problem if your string looks like a number. Expression should
probably re-work itself based on the schema (FeatureType) its actually
querying against.
Re-working Expression and Filter is probably too much work for right
now, but you can probably easily change the JDBC Datastore so if you do
a query like yours correctly.
Ie. <DB VARCHAR col> = <Number> gets converted to <DB VARCHAR col> =
<Number converted to a String>. This will not work 100% of the time,
but it should work most of the time.
dave
ps. here's an example where it will not work:
..
<Literal>
0.5678567567567856785678456789456789456789456789567894567895678
</Literal>
When this is converted to a Double, you cannot re-convert it to the
original string (it will be slightly different).