Changeset: 45d2ebd6c2da for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=45d2ebd6c2da
Modified Files:
        monetdb5/modules/mal/remote.c
        monetdb5/optimizer/opt_centipede.mx
        monetdb5/optimizer/opt_joinpath.mx
Branch: default
Log Message:

Derive the type for joinpaths
The type resolved can not determine the final type of join paths.
This has to be added as a fixed user defined type when the optimizer
has created the joinpath instruction.


diffs (61 lines):

diff --git a/monetdb5/modules/mal/remote.c b/monetdb5/modules/mal/remote.c
--- a/monetdb5/modules/mal/remote.c
+++ b/monetdb5/modules/mal/remote.c
@@ -93,7 +93,7 @@
  * used to issue a safe, but blocking get/put/exec/register request.
  */
 
-/* #define _DEBUG_REMOTE*/
+#define _DEBUG_REMOTE
 
 #define RMTT_L_ENDIAN   0<<1
 #define RMTT_B_ENDIAN   1<<1
diff --git a/monetdb5/optimizer/opt_centipede.mx 
b/monetdb5/optimizer/opt_centipede.mx
--- a/monetdb5/optimizer/opt_centipede.mx
+++ b/monetdb5/optimizer/opt_centipede.mx
@@ -757,7 +757,7 @@ OPTplanFragment(Client cntxt, MalBlkPtr 
        if ( smb) 
                chkProgram(cntxt->nspace, smb);
 #ifdef _DEBUG_OPT_CENTIPEDE_
-       mnstr_printf(cntxt->fdout,"#remote plan errors %d %s 
\n",smb->errors,msg?msg:"");
+       mnstr_printf(cntxt->fdout,"#stub plan errors %d %s 
\n",smb->errors,msg?msg:"");
        printFunction(cntxt->fdout, smb, 0, LIST_MAL_STMT);
 #endif
 
@@ -782,7 +782,7 @@ OPTplanFragment(Client cntxt, MalBlkPtr 
        msg= optimizeMALBlock(cntxt, nmb);
        chkProgram(cntxt->nspace, nmb);
        mnstr_printf(cntxt->fdout,"#remote plan error %d %s\n", nmb->errors, 
msg?msg:"");
-       printFunction(cntxt->fdout, nmb, 0, LIST_MAL_STMT);
+       printFunction(cntxt->fdout, nmb, 0, LIST_MAL_ALL);
 #endif
        GDKfree(plan);
        GDKfree(vars);
diff --git a/monetdb5/optimizer/opt_joinpath.mx 
b/monetdb5/optimizer/opt_joinpath.mx
--- a/monetdb5/optimizer/opt_joinpath.mx
+++ b/monetdb5/optimizer/opt_joinpath.mx
@@ -352,7 +352,7 @@ OPTjoinPathImplementation(Client cntxt, 
                        }
                        /*
                         * @-
-                        * Final type check.
+                        * Final type check and hardwire the result type, 
because that  can not be inferred directly from the signature
                         */
                        for(j=1; j<q->argc-1; j++)
                                if( getTailType(getArgType(mb,q,j)) != 
getHeadType(getArgType(mb,q,j+1)) &&
@@ -365,11 +365,14 @@ OPTjoinPathImplementation(Client cntxt, 
                                        goto wrapup;
                                }
 
+                       /* fix the type */
+                       setVarUDFtype(mb, getArg(q,0));
+                       setVarType(mb, getArg(q,0), newBatType( 
getHeadType(getArgType(mb,q,q->retc)), 
getTailType(getArgType(mb,q,q->argc-1))));
                        if ( q->argc > 3  &&  getFunctionId(q) == joinRef)
                                setFunctionId(q,joinPathRef);
                        else if ( q->argc > 3  &&  getFunctionId(q) == 
leftjoinRef)
                                setFunctionId(q,leftjoinPathRef);
-                       else if ( q->argc > 2  &&  getFunctionId(q) == 
semijoinRef) 
+                       else if ( q->argc > 2  &&  getFunctionId(q) == 
semijoinRef)
                                setFunctionId(q,semijoinPathRef);
                        freeInstruction(p);
                        p= q;
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to