Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
portal-backend
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
HBP Medical Informatics Platform
portal-backend
Commits
5b2012eb
Commit
5b2012eb
authored
7 years ago
by
Mirco Nasuti
Browse files
Options
Downloads
Patches
Plain Diff
bugfix
parent
9139d122
No related branches found
Branches containing commit
Tags
2.3.2
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/eu/hbp/mip/utils/DataUtil.java
+6
-6
6 additions, 6 deletions
src/main/java/eu/hbp/mip/utils/DataUtil.java
with
6 additions
and
6 deletions
src/main/java/eu/hbp/mip/utils/DataUtil.java
+
6
−
6
View file @
5b2012eb
...
...
@@ -13,7 +13,7 @@ import java.util.List;
public
class
DataUtil
{
private
static
final
int
NB_ROWS
_SAMPL
ING
=
200
;
private
static
final
int
MAX_NB
_SAMPL
ES
=
200
;
private
static
final
int
TABLESAMPLE_SEED
=
42
;
private
JdbcTemplate
jdbcTemplate
;
...
...
@@ -32,12 +32,12 @@ public class DataUtil {
for
(
String
var
:
vars
)
{
JsonArray
currentVarData
=
new
JsonArray
();
int
nbRows
=
(
int
)
countDatasetRows
();
if
(
nbRows
<
1
)
{
return
data
;
}
int
samplingPercentage
=
100
*
NB_ROWS_SAMPLING
/
nbRows
;
if
(
nbRows
<
1
)
{
return
data
;
}
int
nb_samples
=
Math
.
min
(
nbRows
,
MAX_NB_SAMPLES
);
int
samplingPercentage
=
100
*
nb_samples
/
nbRows
;
List
<
Object
>
queryResult
=
jdbcTemplate
.
queryForList
(
"SELECT "
+
var
+
" FROM "
+
scienceMainTable
+
" "
+
"TABLESAMPLE SYSTEM ("
+
samplingPercentage
+
") REPEATABLE ( "
+
TABLESAMPLE_SEED
+
" )"
,
Object
.
class
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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