Changeset: 93de871fa57d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=93de871fa57d
Modified Files:
sql/backends/monet5/vaults/lidar/lidar.c
Branch: data-vaults
Log Message:
[LiDAR]: Add statistics about X column as an example
diffs (37 lines):
diff --git a/sql/backends/monet5/vaults/lidar/lidar.c
b/sql/backends/monet5/vaults/lidar/lidar.c
--- a/sql/backends/monet5/vaults/lidar/lidar.c
+++ b/sql/backends/monet5/vaults/lidar/lidar.c
@@ -740,7 +740,12 @@ str LIDARattach(Client cntxt, MalBlkPtr
struct stat buf;
int scaleX, scaleY, scaleZ;
int precisionX, precisionY, precisionZ;
- char *istmt=NULL;
+ char *istmt=NULL, *cstmt=NULL;
+ char maxval[BUFSIZ], minval[BUFSIZ];
+ lng nils = 0;
+ lng uniq = 0;
+ lng sz = 0;
+ int width = 4;
if (pci->argc == 3) {
tname = *getArgReference_str(stk, pci, 2);
@@ -988,6 +993,19 @@ str LIDARattach(Client cntxt, MalBlkPtr
return msg;
}
+ cstmt = GDKzalloc(8192);
+ col = mvc_bind_column(m, tbl, "x");
+ snprintf(minval, BUFSIZ, "%lf", header->hi->minX);
+ snprintf(maxval, BUFSIZ, "%lf", header->hi->maxX);
+ if (!col) {
+ GDKfree(cstmt);
+ return createException(SQL, "lidar.attach", "cannot bind column
x");
+ }
+ snprintf(cstmt, 8192, "insert into sys.statistics
values(%d,'%s',%d,now()," LLFMT "," LLFMT "," LLFMT "," LLFMT
",'%s','%s',%s);", col->base.id, col->type.type->sqlname, width, sz, sz, uniq,
nils, minval, maxval, (header->hi->minX == header->hi->maxX) ? "true" :
"false");
+ msg = SQLstatementIntern(cntxt, &cstmt, "LIDARattach", TRUE, FALSE,
NULL);
+
+ GDKfree(cstmt);
+
free(header->hi);
free(header);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list