bug fixed in sampling operations and resolved truncating each table'a attribute to 255 characters
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-access/DatabasesResourcesManager@99348 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
6ce1e4d44b
commit
6942920792
|
@ -171,11 +171,13 @@ public class Sampler {
|
||||||
|
|
||||||
if (DBType.equals(POSTGRES)) {
|
if (DBType.equals(POSTGRES)) {
|
||||||
|
|
||||||
attribute = "CAST(" + listColumns.get(i) + " as text), ";
|
// attribute = "CAST(" + listColumns.get(i) + " as text), ";
|
||||||
|
attribute = "CAST(" + listColumns.get(i) + " as character varying(255)), ";
|
||||||
|
|
||||||
if (i == (listColumns.size() - 1)) {
|
if (i == (listColumns.size() - 1)) {
|
||||||
|
|
||||||
attribute = "CAST(" + listColumns.get(i) + " as text)";
|
// attribute = "CAST(" + listColumns.get(i) + " as text)";
|
||||||
|
attribute = "CAST(" + listColumns.get(i) + " as character varying(255))";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -196,7 +198,7 @@ public class Sampler {
|
||||||
// attribute = "CONVERT(" + listColumns.get(i) +
|
// attribute = "CONVERT(" + listColumns.get(i) +
|
||||||
// ", CHAR), ";
|
// ", CHAR), ";
|
||||||
attribute = "CAST(" + "`" +listColumns.get(i)+ "`"
|
attribute = "CAST(" + "`" +listColumns.get(i)+ "`"
|
||||||
+ " as CHAR CHARACTER SET utf8), ";
|
+ " as CHAR(255) CHARACTER SET utf8), ";
|
||||||
|
|
||||||
if (i == (listColumns.size() - 1)) {
|
if (i == (listColumns.size() - 1)) {
|
||||||
|
|
||||||
|
@ -207,14 +209,14 @@ public class Sampler {
|
||||||
// ", BINARY)";
|
// ", BINARY)";
|
||||||
|
|
||||||
attribute = "CAST(" + "`" +listColumns.get(i)+ "`"
|
attribute = "CAST(" + "`" +listColumns.get(i)+ "`"
|
||||||
+ " as CHAR CHARACTER SET utf8)";
|
+ " as CHAR(255) CHARACTER SET utf8)";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
attribute = "CAST(CAST(" + "`" +listColumns.get(i)+ "`"
|
attribute = "CAST(CAST(" + "`" +listColumns.get(i)+ "`"
|
||||||
+ " as BINARY) as CHAR CHARACTER SET utf8), ";
|
+ " as BINARY) as CHAR(255) CHARACTER SET utf8), ";
|
||||||
|
|
||||||
if (i == (listColumns.size() - 1)) {
|
if (i == (listColumns.size() - 1)) {
|
||||||
|
|
||||||
|
@ -225,7 +227,7 @@ public class Sampler {
|
||||||
// ", BINARY)";
|
// ", BINARY)";
|
||||||
|
|
||||||
attribute = "CAST(CAST(" + "`" +listColumns.get(i)+ "`"
|
attribute = "CAST(CAST(" + "`" +listColumns.get(i)+ "`"
|
||||||
+ " as BINARY) as CHAR CHARACTER SET utf8)";
|
+ " as BINARY) as CHAR(255) CHARACTER SET utf8)";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -704,12 +706,13 @@ public class Sampler {
|
||||||
|
|
||||||
if ((listRows.size() > 100) && (removal == false)) {
|
if ((listRows.size() > 100) && (removal == false)) {
|
||||||
|
|
||||||
for (int k = 0; k < listRows.size(); k++) {
|
//print check
|
||||||
|
// for (int k = 0; k < listRows.size(); k++) {
|
||||||
AnalysisLogger.getLogger().debug(
|
//
|
||||||
"Sampler->row with index: " + k + " score "
|
// AnalysisLogger.getLogger().debug(
|
||||||
+ listRows.get(k).getScore());
|
// "Sampler->row with index: " + k + " score "
|
||||||
}
|
// + listRows.get(k).getScore());
|
||||||
|
// }
|
||||||
|
|
||||||
AnalysisLogger.getLogger().debug(
|
AnalysisLogger.getLogger().debug(
|
||||||
"Sampler->starting the removal operation");
|
"Sampler->starting the removal operation");
|
||||||
|
|
Loading…
Reference in New Issue