Changeset: 72ec68af9ed1 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/72ec68af9ed1
Modified Files:
        gdk/gdk_string.c
        monetdb5/mal/mal_pipelines.c
        monetdb5/modules/mal/heapn.c
        monetdb5/modules/mal/pp_hash.c
        monetdb5/modules/mal/pp_hash.h
        monetdb5/modules/mal/pp_mat.c
        monetdb5/modules/mal/pp_sort.c
        monetdb5/optimizer/opt_remap.c
        sql/backends/monet5/bin_partition_by_value.c
        sql/backends/monet5/copy_convert.c
        sql/backends/monet5/rel_copy.c
        sql/backends/monet5/rel_physical.c
        sql/backends/monet5/rel_pphash.c
        sql/backends/monet5/sql.c
        sql/backends/monet5/sql_pp_statement.c
        sql/backends/monet5/vaults/parquet/offset_string_read_chunk.h
        sql/backends/monet5/vaults/parquet/parquet.c
        sql/backends/monet5/vaults/parquet/pqc_filemetadata.c
        sql/backends/monet5/vaults/parquet/pqc_filemetadata.h
        sql/backends/monet5/vaults/parquet/pqc_thrift.c
        sql/server/rel_dump.c
        sql/server/rel_exp.c
        sql/server/rel_optimize_sel.c
        sql/server/rel_optimizer.c
Branch: default
Log Message:

Use tabs to indent C files.


diffs (truncated from 1176 to 300 lines):

diff --git a/gdk/gdk_string.c b/gdk/gdk_string.c
--- a/gdk/gdk_string.c
+++ b/gdk/gdk_string.c
@@ -228,11 +228,11 @@ ustrPut(BAT *b, var_t *dst, const char *
                        if (strcmp(v,
                                   ui.vh->base + ((var_t *) ui.base)[p]) == 0)
                                break;
-       } else if (GDKupgradevarheap(ustrbat, (var_t) 1 << (4 * SIZEOF_VAR_T + 
1),
+       } else if (GDKupgradevarheap(ustrbat, (var_t) 1 << (4 * SIZEOF_VAR_T + 
1),
                                    ustrbat->batCapacity, 0) != GDK_SUCCEED) {
-               MT_lock_unset(&ustrbat->theaplock);
-               MT_rwlock_wrunlock(&ustrbat->thashlock);
-               return (var_t) -1;
+               MT_lock_unset(&ustrbat->theaplock);
+               MT_rwlock_wrunlock(&ustrbat->thashlock);
+               return (var_t) -1;
        } else {
                if (h->size < GDK_STRHASHSIZE + BATTINY * GDK_VARALIGN) {
                        if (HEAPgrow(&b->tvheap, GDK_STRHASHSIZE + BATTINY * 
GDK_VARALIGN, true) != GDK_SUCCEED) {
diff --git a/monetdb5/mal/mal_pipelines.c b/monetdb5/mal/mal_pipelines.c
--- a/monetdb5/mal/mal_pipelines.c
+++ b/monetdb5/mal/mal_pipelines.c
@@ -151,10 +151,10 @@ stack_copy(allocator *ma, MalStkPtr stk,
                                if(VALcopy(ma, lhs, rhs) == NULL)
                                        break;
                        } else if (rhs->bat) {
-                lhs->bat = rhs->bat;
-                lhs->vtype = rhs->vtype;
-                lhs->len = 0;
-                lhs->val.bval = bat_nil;
+                               lhs->bat = rhs->bat;
+                               lhs->vtype = rhs->vtype;
+                               lhs->len = 0;
+                               lhs->val.bval = bat_nil;
                        } else {
                                VALinit(ma, lhs, rhs->vtype, 
ATOMnilptr(rhs->vtype));
                        }
@@ -169,12 +169,12 @@ stack_copy(allocator *ma, MalStkPtr stk,
 static void
 thread_runoncpu(int cpu)
 {
-        cpu_set_t cpuset;
+       cpu_set_t cpuset;
 
 //printf("run on %d\n", cpu);
-        CPU_ZERO(&cpuset);
-        CPU_SET(cpu , &cpuset);
-        sched_setaffinity(0, sizeof(cpuset), &cpuset);
+       CPU_ZERO(&cpuset);
+       CPU_SET(cpu , &cpuset);
+       sched_setaffinity(0, sizeof(cpuset), &cpuset);
 }
 #endif
 
diff --git a/monetdb5/modules/mal/heapn.c b/monetdb5/modules/mal/heapn.c
--- a/monetdb5/modules/mal/heapn.c
+++ b/monetdb5/modules/mal/heapn.c
@@ -1309,7 +1309,7 @@ HEAPproject(Client ctx, bat *rid, bat *p
        Pipeline *p = pipeline_get_thread_private_pipeline(); /* last arg 
should move to first argument .. */
        BAT *r = NULL, *P = BATdescriptor(*pos), *S = BATdescriptor(*sel), *b = 
BATdescriptor(*in);
        int err = 0;
-    char *errmsg = NULL;
+       char *errmsg = NULL;
 
        if (!P || !S || !b) {
                if (P)
@@ -1390,10 +1390,10 @@ HEAPproject(Client ctx, bat *rid, bat *p
        }
        if (BATcapacity(r) < size) {
                if (BATextend(r, size) != GDK_SUCCEED) {
-            errmsg = createException(MAL, "heapn.project", MAL_MALLOC_FAIL);
+                       errmsg = createException(MAL, "heapn.project", 
MAL_MALLOC_FAIL);
                        err = 1;
-            goto error;
-        }
+                       goto error;
+               }
        }
 
        if (size && !err) {
@@ -1983,13 +1983,13 @@ HEAPgroups(Client ctx, bat *rid, bat *pi
 
 #include "mel.h"
 static mel_func heapn_init_funcs[] = {
-    pattern("heapn", "new", HEAPnew, false, "return new heap sink, simple topn 
no order by cols", args(1,3,
+       pattern("heapn", "new", HEAPnew, false, "return new heap sink, simple 
topn no order by cols", args(1,3,
                                batarg("sink",oid),
                                arg("n",lng),
                                arg("grouped",bit)
                                )
                   ),
-    pattern("heapn", "new", HEAPnew, false, "return new heap sink", args(1,4,
+       pattern("heapn", "new", HEAPnew, false, "return new heap sink", 
args(1,4,
                                batarg("sink",oid),
                                arg("n",lng),
                                arg("grouped",bit),
diff --git a/monetdb5/modules/mal/pp_hash.c b/monetdb5/modules/mal/pp_hash.c
--- a/monetdb5/modules/mal/pp_hash.c
+++ b/monetdb5/modules/mal/pp_hash.c
@@ -564,7 +564,7 @@ OAHASHhashmark_init(Client ctx, bat *res
                }
        }
 
-    hash_table *h = (hash_table*)ht->pl_io;
+       hash_table *h = (hash_table*)ht->pl_io;
        if (hp)
                h = (hash_table*)hp->pl_io;
        /* assert(h && h->pl_io.type == PIPELINE_IO_HASH_TABLE); */
@@ -2710,7 +2710,7 @@ OAHASHomprobe_cmbd(Client ctx, bat *PRB_
        lng *freq = NULL;
        str err = NULL;
 
-    assert(((*single) && frequency) || !(*single));
+       assert(((*single) && frequency) || !(*single));
 
        k = BATdescriptor(*PRB_key);
        s = BATdescriptor(*PRB_selected);
diff --git a/monetdb5/modules/mal/pp_hash.h b/monetdb5/modules/mal/pp_hash.h
--- a/monetdb5/modules/mal/pp_hash.h
+++ b/monetdb5/modules/mal/pp_hash.h
@@ -122,14 +122,14 @@ typedef struct hash_table {
 static inline lng
 str_hsh( str v )
 {
-    // Source: https://github.com/aappleby/smhasher/blob/master/src/Hashes.cpp
-    ulng h = 2166136261UL;
-    const uint8_t* data = (const uint8_t*)v;
-    for (int i = 0; data[i]; i++) {
-        h ^= data[i];
-        h *= 16777619;
-    }
-    return (lng)h;
+       // Source: 
https://github.com/aappleby/smhasher/blob/master/src/Hashes.cpp
+       ulng h = 2166136261UL;
+       const uint8_t* data = (const uint8_t*)v;
+       for (int i = 0; data[i]; i++) {
+               h ^= data[i];
+               h *= 16777619;
+       }
+       return (lng)h;
 }
 
 extern hash_table *ht_create(int type, size_t size, hash_table *p, int vkey);
diff --git a/monetdb5/modules/mal/pp_mat.c b/monetdb5/modules/mal/pp_mat.c
--- a/monetdb5/modules/mal/pp_mat.c
+++ b/monetdb5/modules/mal/pp_mat.c
@@ -400,7 +400,7 @@ MATproject(Client ctx, bat *mat, const b
                if (ATOMvarsized(r->ttype) && !local_storage)
                        mat_activate(mt);
                QryCtx *qry_ctx = MT_thread_get_qry_ctx();
-                qry_ctx = qry_ctx ? qry_ctx : &(QryCtx) {.endtime = 0};
+               qry_ctx = qry_ctx ? qry_ctx : &(QryCtx) {.endtime = 0};
                if (!local_storage) {
                        switch(d->twidth) {
                        case 1:
diff --git a/monetdb5/modules/mal/pp_sort.c b/monetdb5/modules/mal/pp_sort.c
--- a/monetdb5/modules/mal/pp_sort.c
+++ b/monetdb5/modules/mal/pp_sort.c
@@ -727,7 +727,7 @@ sop_done(sop_t *q, int wid, int nr_worke
        (void)redo;
        (void)nr_workers;
        int res = 0;
-    assert(q->pl_io.type == PIPELINE_IO_SOP);
+       assert(q->pl_io.type == PIPELINE_IO_SOP);
 
        MT_lock_set(&q->l);
        assert(q->workers[wid] == 0);
diff --git a/monetdb5/optimizer/opt_remap.c b/monetdb5/optimizer/opt_remap.c
--- a/monetdb5/optimizer/opt_remap.c
+++ b/monetdb5/optimizer/opt_remap.c
@@ -25,7 +25,7 @@ pushNilAt(MalBlkPtr mb, InstrPtr p, int 
        int i;
 
        p = pushNilBat(mb, p);   /* push at end */
-    if (mb->errors == NULL) {
+       if (mb->errors == NULL) {
                int arg = getArg(p, p->argc - 1);
                for (i = p->argc - 1; i > pos; i--)
                        getArg(p, i) = getArg(p, i - 1);
diff --git a/sql/backends/monet5/bin_partition_by_value.c 
b/sql/backends/monet5/bin_partition_by_value.c
--- a/sql/backends/monet5/bin_partition_by_value.c
+++ b/sql/backends/monet5/bin_partition_by_value.c
@@ -128,19 +128,19 @@ rel2bin_slicer_pp(backend *be, stmt *sub
                stmt *mat = sub->op4.lval->h->data;
                int nrparts = mat_nr_parts(be, mat->nr);
                source = pp_counter(be, -1, nrparts, false);
-    } else if (be->pp) {
-            if (sub && sub->cand)
-                sub = subrel_project(be, sub, NULL, NULL);
-            // FIXME: a better way to determine if 'sub' is an oahash-table. 
sub->op1 is the hash-payload!
-            node *n = sub->op1 ? sub->op4.lval->t : sub->op4.lval->h; /* for 
hash get last */
-            stmt *sc = n->data;
+       } else if (be->pp) {
+               if (sub && sub->cand)
+                       sub = subrel_project(be, sub, NULL, NULL);
+               // FIXME: a better way to determine if 'sub' is an 
oahash-table. sub->op1 is the hash-payload!
+               node *n = sub->op1 ? sub->op4.lval->t : sub->op4.lval->h; /* 
for hash get last */
+               stmt *sc = n->data;
 
-            if (sc->nrcols == 0) {
-                source = pp_counter(be, 1, -1, false);
-            } else {
-                //sc = stmt_no_slices(be, sc, sub->op1?true:false /* hash 
table on op1 */);
-                source = pp_counter(be, -1, sc->nr, false);
-            }
+               if (sc->nrcols == 0) {
+                       source = pp_counter(be, 1, -1, false);
+               } else {
+                       //sc = stmt_no_slices(be, sc, sub->op1?true:false /* 
hash table on op1 */);
+                       source = pp_counter(be, -1, sc->nr, false);
+               }
        } else {
                source = pp_counter(be, -1, pp_dynamic_slices(be, sub), false);
        }
@@ -502,4 +502,3 @@ rel2bin_groupby_partition(backend *be, s
        stmt *mats = rel2bin_partition(be, rel, refs);
        return partition_groupby(be, rel, mats, neededpp);
 }
-
diff --git a/sql/backends/monet5/copy_convert.c 
b/sql/backends/monet5/copy_convert.c
--- a/sql/backends/monet5/copy_convert.c
+++ b/sql/backends/monet5/copy_convert.c
@@ -276,17 +276,17 @@ string_sharing_bat(BUN cnt, const char *
        if ((hp = GDKmalloc(sizeof(Heap))) == NULL){
                BBPreclaim(b);
                return NULL;
-    }
+       }
        char *nme = BBP_physical(b->batCacheid);
-    *hp = (Heap) {
+       *hp = (Heap) {
                .farmid = 1,//BBPselectfarm(b->batRole, b->ttype, varheap), // 
find the inmemory farm
-        .parentid = b->batCacheid,
-        .dirty = true,
-        .refs = ATOMIC_VAR_INIT(1),
+               .parentid = b->batCacheid,
+               .dirty = true,
+               .refs = ATOMIC_VAR_INIT(1),
                .storage = STORE_NOWN,
                .free = GDK_ELIMLIMIT,
                .size = GDK_ELIMLIMIT,
-    };
+       };
        strtconcat(hp->filename, sizeof(hp->filename), nme, ".theap", NULL);
        hp->base = (char*)base;
        b->tvheap = hp;
diff --git a/sql/backends/monet5/rel_copy.c b/sql/backends/monet5/rel_copy.c
--- a/sql/backends/monet5/rel_copy.c
+++ b/sql/backends/monet5/rel_copy.c
@@ -66,7 +66,7 @@ emit_pipelined_loop(
 {
        InstrPtr q;
        int alloc = allocation_size(block_size);
-    int streams_type = ATOMindex("streams");
+       int streams_type = ATOMindex("streams");
 
        // Determine the number of records to read
        int var_nrecords = getLngConstant(mb, nrecords_or_minusone >= 0 ? 
nrecords_or_minusone : GDK_lng_max);
diff --git a/sql/backends/monet5/rel_physical.c 
b/sql/backends/monet5/rel_physical.c
--- a/sql/backends/monet5/rel_physical.c
+++ b/sql/backends/monet5/rel_physical.c
@@ -243,7 +243,7 @@ rel_partition(visitor *v, mvc *sql, sql_
                return sql_error(sql, 10, SQLSTATE(42000) "Query too complex: 
running out of stack space");
 
        if (v->opt >= 0 && rel->opt >= v->opt) /* only once */
-        return 0;
+               return 0;
 
        switch (rel->op) {
        case op_basetable:
@@ -306,14 +306,14 @@ rel_partition(visitor *v, mvc *sql, sql_
                if ((IS_TABLE_PROD_FUNC(rel->flag) || rel->flag == 
TABLE_FROM_RELATION) && rel->l)
                        rel_partition(v, sql, rel->l);
                sql_exp *op = rel->r;
-        if (rel->flag != TRIGGER_WRAPPER && op) {
-            sql_subfunc *f = op->f;
-            if (f->func->pipeline) {
+               if (rel->flag != TRIGGER_WRAPPER && op) {
+                       sql_subfunc *f = op->f;
+                       if (f->func->pipeline) {
                                if (strcmp(f->func->base.name, "file_loader") 
== 0 || strcmp(f->func->base.name, "copyfrom") == 0) {
                                        rel = rel_dup(rel);
                                        f->pipeline = true;
                                }
-            }
+                       }
                }
                break;
        default:
@@ -321,7 +321,7 @@ rel_partition(visitor *v, mvc *sql, sql_
                break;
        }
        if (rel && v->opt >= 0)
-        rel->opt = v->opt;
+               rel->opt = v->opt;
        return rel;
 }
 
@@ -453,12 +453,12 @@ do_oahash_join(visitor *v, sql_rel *rel,
                }
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to