Changeset: 068adbc02cf1 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/068adbc02cf1
Modified Files:
        monetdb5/modules/mal/tablet.c
        sql/backends/monet5/sql_result.c
Branch: directappend
Log Message:

When appending directly, do not also create and fill temp bats


diffs (58 lines):

diff --git a/monetdb5/modules/mal/tablet.c b/monetdb5/modules/mal/tablet.c
--- a/monetdb5/modules/mal/tablet.c
+++ b/monetdb5/modules/mal/tablet.c
@@ -895,14 +895,11 @@ SQLinsert_val(READERtask *task, int col,
        }
        if (task->loadops) {
                str msg = task->loadops->append_one(task->loadops->state, idx, 
adt, fmt->appendcol);
-               if (msg != MAL_SUCCEED)
-                       goto failure;
-       }
-
-       if (bunfastapp(fmt->c, adt) == GDK_SUCCEED)
+               if (msg == MAL_SUCCEED)
+                       return ret;
+       } else if (bunfastapp(fmt->c, adt) == GDK_SUCCEED)
                return ret;
 
-failure:
        /* failure */
        if (task->rowerror) {
                lng row = BATcount(fmt->c);
@@ -929,9 +926,17 @@ SQLworker_column(READERtask *task, int c
        int i;
        Column *fmt = task->as->format;
 
-       if (fmt[col].c == NULL)
+       if (fmt[col].skip)
                return 0;
 
+       if (task->loadops) {
+               for (i = 0; i < task->top[task->cur]; i++) {
+                       if (SQLinsert_val(task, col, i) < 0)
+                               return -1;
+               }
+               return 0;
+       }
+
        /* watch out for concurrent threads */
        MT_lock_set(&mal_copyLock);
        if (!fmt[col].skip && BATcapacity(fmt[col].c) < BATcount(fmt[col].c) + 
task->next) {
diff --git a/sql/backends/monet5/sql_result.c b/sql/backends/monet5/sql_result.c
--- a/sql/backends/monet5/sql_result.c
+++ b/sql/backends/monet5/sql_result.c
@@ -1013,9 +1013,11 @@ mvc_import_table(Client cntxt, BAT ***ba
 
                // do .. while (false) allows us to use 'break' to drop out at 
any point
                do {
-                       msg = TABLETcreate_bats(&as, (BUN) (sz < 0 ? 1000 : 
sz));
-                       if (msg != MAL_SUCCEED)
-                               break;
+                       if (!loadops) {
+                               msg = TABLETcreate_bats(&as, (BUN) (sz < 0 ? 
1000 : sz));
+                               if (msg != MAL_SUCCEED)
+                                       break;
+                       }
 
                        if (sz != 0) {
                                BUN count = SQLload_file(cntxt, &as, bs, out, 
sep, rsep, ssep ? ssep[0] : 0, offset, sz, best, from_stdin, t->base.name, 
escape, loadops);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to