Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-server
Commits
37b18801
Commit
37b18801
authored
2 years ago
by
Daniel Hornung
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Always apply POV to ints and doubles alike.
parent
0c329e01
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!66
REL: prepare release 0.8.0
,
!62
Fix large integer queries
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/caosdb/server/query/POV.java
+15
-13
15 additions, 13 deletions
src/main/java/org/caosdb/server/query/POV.java
with
15 additions
and
13 deletions
src/main/java/org/caosdb/server/query/POV.java
+
15
−
13
View file @
37b18801
...
...
@@ -128,10 +128,8 @@ public class POV implements EntityFilterInterface {
this
.
vInt
=
null
;
}
// try and parse as double
if
(
this
.
vInt
!=
null
)
{
this
.
vDouble
=
(
double
)
this
.
vInt
;
}
else
{
// Try and parse as double, if integer parsing was unsuccessful.
if
(
this
.
vInt
==
null
)
{
try
{
// Doubles are allowed without dots, for example when the integer overflows.
final
Pattern
dp
=
Pattern
.
compile
(
"^(-?[0-9]+(?:\\.)?(?:[0-9]+))\\s*([^-]*)$"
);
...
...
@@ -217,6 +215,11 @@ public class POV implements EntityFilterInterface {
"Versioned queries are not supported for subqueries yet. Please file a feature request."
);
}
final
long
t1
=
System
.
currentTimeMillis
();
// Add type-converted substitutes for ints/doubles.
final
Integer
vIntSubst
=
(
this
.
vDouble
!=
null
&&
this
.
vDouble
%
1
==
0
)
?
(
int
)
Math
.
rint
(
this
.
vDouble
)
:
null
;
final
Double
vDoubleSubst
=
(
this
.
vInt
!=
null
)
?
(
double
)
this
.
vInt
:
null
;
try
{
this
.
connection
=
query
.
getConnection
();
this
.
targetSet
=
query
.
getTargetSet
();
...
...
@@ -270,15 +273,14 @@ public class POV implements EntityFilterInterface {
}
else
{
callPOV
.
setNull
(
6
,
VARCHAR
);
}
if
(
this
.
vInt
!=
null
)
{
// vInt
callPOV
.
setInt
(
7
,
this
.
vInt
);
}
else
{
callPOV
.
setNull
(
7
,
INTEGER
);
}
if
(
this
.
vDouble
!=
null
)
{
// vDouble
callPOV
.
setDouble
(
8
,
this
.
vDouble
);
}
else
{
callPOV
.
setNull
(
8
,
DOUBLE
);
if
(
this
.
vInt
!=
null
||
this
.
vDouble
!=
null
)
{
// Some numeric
if
(
this
.
vInt
!=
null
)
{
callPOV
.
setInt
(
7
,
this
.
vInt
);
callPOV
.
setDouble
(
8
,
vDoubleSubst
);
}
else
{
callPOV
.
setInt
(
7
,
vIntSubst
);
callPOV
.
setDouble
(
8
,
this
.
vDouble
);
}
}
if
(
this
.
unit
!=
null
)
{
final
long
unitSig
=
this
.
unit
.
getSignature
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment