Changeset: 7b47494d472a for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7b47494d472a
Modified Files:
monetdb5/extras/bwd/91_bwd.sql
monetdb5/extras/bwd/bwd.c
monetdb5/extras/bwd/operations.c
monetdb5/extras/bwd/opt_bwd.mal
monetdb5/extras/bwd/utilities.c
Branch: bwd
Log Message:
* mostly costmetic fixes and (fake-)dealing with string types
Unterschiede (123 Zeilen):
diff --git a/monetdb5/extras/bwd/91_bwd.sql b/monetdb5/extras/bwd/91_bwd.sql
--- a/monetdb5/extras/bwd/91_bwd.sql
+++ b/monetdb5/extras/bwd/91_bwd.sql
@@ -1,6 +1,9 @@
create function bwdecomposedec(col decimal(9,2), bits integer)
returns varchar(4096) external name bwd.decompose;
+create function bwdecomposevarchar(col varchar(1), bits integer)
+returns varchar(4096) external name bwd.decompose;
+
create function bwdecomposedec9_2(col decimal(9,2), bits integer)
returns varchar(4096) external name bwd.decompose;
diff --git a/monetdb5/extras/bwd/bwd.c b/monetdb5/extras/bwd/bwd.c
--- a/monetdb5/extras/bwd/bwd.c
+++ b/monetdb5/extras/bwd/bwd.c
@@ -109,7 +109,9 @@ str bwdecompose(bat * res, bat * subject
if (VIEWtparent(subject))
subject = BATdescriptor(abs(VIEWtparent(subject)));
result = BATnew(TYPE_void, TYPE_str, 0);
- if(! batTailIsDecomposed(subject)){
+ if(Tsize(subject) != 4){
+ snprintf(buffer, 4096, "bat %d cannot be decomposed because it
is not a 32-bit type", subject->batCacheid);
+ } else if(! batTailIsDecomposed(subject)){
printf ("decomposing %s into %d and %d bits\n",
resolveBatToAttribute(subject->batCacheid, cntxt), approximationBits[0],
Tsize(subject)*8-*approximationBits);
BATsetprop(subject, batRegistryIndex, TYPE_int,
(int[]){decomposeIntArray((int*)Tloc(subject, BUNfirst(subject)),
subject->batCount, *approximationBits)});
snprintf(buffer, 4096, "successfully decomposed bat %d",
subject->batCacheid);
diff --git a/monetdb5/extras/bwd/operations.c b/monetdb5/extras/bwd/operations.c
--- a/monetdb5/extras/bwd/operations.c
+++ b/monetdb5/extras/bwd/operations.c
@@ -634,7 +634,7 @@ str BWDtmark(int *res, int *bid, oid *ba
}
str BWDmirror(int *res, int *bid, oid *base){
- throw(MAL, "not implemented yet: %s", __func__);
+ throw(MAL, __func__, "not implemented yet: %s", __func__);
}
@@ -923,12 +923,12 @@ str BWDSelectNotNilRefine(int *result, i
str BWDGroupedSumApproximate(int *retid,int *bid, int *gid, int *eid){
- throw(MAL, "not implemented yet: %s", __func__);
+ throw(MAL, __func__, "not implemented yet: %s", __func__);
}
str BWDGroupedSumRefine(int *retid,int *bid, int *gid, int *eid, bat* approx){
- throw(MAL, "not implemented yet: %s", __func__);
+ throw(MAL, __func__, "not implemented yet: %s", __func__);
}
@@ -949,14 +949,14 @@ str bwd_export_value_wrap(Client cntxt,
/*///////////////////////////// Joins /////////////////////////////*/
str BWDjoinApproximate(int *ret, int *lid, int *rid ){
- throw(MAL, "not implemented yet: %s", __func__);
+ throw(MAL, __func__, "not implemented yet: %s", __func__);
}
str BWDjoinRefine(int *ret, int *lid, int *rid, bat* approx ){
- throw(MAL, "not implemented yet: %s", __func__);
+ throw(MAL, __func__, "not implemented yet: %s", __func__);
}
str BWDMulticolumnGroupApproximate(Client cntxt, MalBlkPtr mb, MalStkPtr stk,
InstrPtr pci){
- throw(MAL, "not implemented yet: %s", __func__);
+ throw(MAL, __func__, "not implemented yet: %s", __func__);
}
diff --git a/monetdb5/extras/bwd/opt_bwd.mal b/monetdb5/extras/bwd/opt_bwd.mal
--- a/monetdb5/extras/bwd/opt_bwd.mal
+++ b/monetdb5/extras/bwd/opt_bwd.mal
@@ -193,6 +193,9 @@ address bwdecomposeScalar;
command decompose(column:date, approximationBits: int):void
address bwdecomposeScalar;
+command decompose(column:str, approximationBits: int):void
+address bwdecomposeScalar;
+
command init():void
address bwdinit;
@@ -201,6 +204,9 @@ module batbwd;
command decompose(col:bat[:oid,:int],bits:int):bat[:oid,:str]
address bwdecompose;
+command decompose(col:bat[:oid,:str],bits:int):bat[:oid,:str]
+address bwdecompose;
+
command decompose(col:bat[:oid,:date],bits:int):bat[:oid,:str]
address bwdecompose;
diff --git a/monetdb5/extras/bwd/utilities.c b/monetdb5/extras/bwd/utilities.c
--- a/monetdb5/extras/bwd/utilities.c
+++ b/monetdb5/extras/bwd/utilities.c
@@ -21,8 +21,22 @@
#define die(msg, args...) throw (MAL, "bwd", msg, args);
-const char* typeNames[] = {[TYPE_int] = "int", [TYPE_void] = "void",
[TYPE_oid] = "oid"};
-
+const char* typeNames[] = {
+ [TYPE_void] = "void",
+ [TYPE_bit] = "bit",
+ [TYPE_bte] = "bte",
+ [TYPE_sht] = "sht",
+ [TYPE_bat] = "bat",
+ [TYPE_int] = "int",
+ [TYPE_oid] = "oid",
+ [TYPE_wrd] = "wrd",
+ [TYPE_ptr] = "ptr",
+ [TYPE_flt] = "flt",
+ [TYPE_dbl] = "dbl",
+ [TYPE_lng] = "lng",
+ [TYPE_str] = "str",
+ [TYPE_any] = "any"
+};
#pragma mark OpenCL Utitily Functions
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list