Re: [Monetdb-developers] [Monetdb-sql-checkins] sql/src/server sql_parser.mx, , 1.291, 1.292 sql_updates.mx, , 1.145, 1.146
On Tue, Sep 16, 2008 at 02:55:45PM +0000, Romulo Goncalves wrote:
Update of /cvsroot/monetdb/sql/src/server In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv12591
Modified Files: sql_parser.mx sql_updates.mx Log Message: The number of records should be type lng
^^^ shouldn't that be aligned with the BATcount, i.e., type BUN (if possible) or at least type wrd?
Stefan
to allow the load of billions of records in a single copy command.
U sql_parser.mx Index: sql_parser.mx =================================================================== RCS file: /cvsroot/monetdb/sql/src/server/sql_parser.mx,v retrieving revision 1.291 retrieving revision 1.292 diff -u -d -r1.291 -r1.292 --- sql_parser.mx 9 Sep 2008 13:28:49 -0000 1.291 +++ sql_parser.mx 16 Sep 2008 14:55:41 -0000 1.292 @@ -583,6 +583,8 @@
%type <l_val> opt_start
- lngval
- poslng opt_increment opt_min opt_max
@@ -2462,8 +2464,8 @@
opt_nr: /* empty */ { $$ = NULL; }
- | posint RECORDS { $$ = append_int(append_int(L(), $1), 0); }
- | posint OFFSET posint RECORDS { $$ = append_int(append_int(L(), $1), $3); }
- | poslng RECORDS { $$ = append_lng(append_lng(L(), $1), 0); }
- | poslng OFFSET poslng RECORDS { $$ = append_lng(append_lng(L(), $1), $3); } ;
opt_null_string: @@ -4118,6 +4120,17 @@ } ;
+poslng:
- lngval { $$ = $1;
if ($$ < 0) {
$$ = -1;
yyerror("Positive value expected");
YYABORT;
}
}
- ;
posint: intval { $$ = $1; if ($$ < 0) { @@ -4394,6 +4407,10 @@ { $$ = append_string($1, $3); } ;
+lngval:
- sqlINT { $$ = strtoll($1,NULL,10); }
+;
intval: sqlINT { $$ = strtol($1,NULL,10); } | IDENT { mvc *m = (mvc*)parm;
U sql_updates.mx Index: sql_updates.mx =================================================================== RCS file: /cvsroot/monetdb/sql/src/server/sql_updates.mx,v retrieving revision 1.145 retrieving revision 1.146 diff -u -d -r1.145 -r1.146 --- sql_updates.mx 7 Sep 2008 14:28:00 -0000 1.145 +++ sql_updates.mx 16 Sep 2008 14:55:42 -0000 1.146 @@ -1411,11 +1411,11 @@ char *ssep = (seps->h->next->next)?seps->h->next->next->data.sval:"""; char *ns = (null_string)?null_string:"null"; list *slist;
- int nr = (nr_offset)?nr_offset->h->data.i_val:-1;
- int offset = (nr_offset)?nr_offset->h->next->data.i_val:0;
- lng nr = (nr_offset)?nr_offset->h->data.i_val:-1;
- lng offset = (nr_offset)?nr_offset->h->next->data.i_val:0;
- assert(!nr_offset || nr_offset->h->type == type_int);
- assert(!nr_offset || nr_offset->h->next->type == type_int);
- assert(!nr_offset || nr_offset->h->type == type_lng);
- assert(!nr_offset || nr_offset->h->next->type == type_lng); if (sname && !(s=mvc_bind_schema(sql, sname))) { (void) sql_error(sql, 02, "COPY INTO: no such schema '%s'", sname); return NULL;
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Monetdb-sql-checkins mailing list Monetdb-sql-checkins@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins
Stefan Manegold wrote:
On Tue, Sep 16, 2008 at 02:55:45PM +0000, Romulo Goncalves wrote:
Update of /cvsroot/monetdb/sql/src/server In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv12591
Modified Files: sql_parser.mx sql_updates.mx Log Message: The number of records should be type lng
^^^
shouldn't that be aligned with the BATcount, i.e., type BUN (if possible) or at least type wrd?
In the parser I do not see any type wrd. I can change the sql_update.mx code to support wrd type. I will also update the sql_statement.mx to accept type wrd in stmt_import
My question is: Can I do this where the value type coming from the parser is a lng?
- wrd nr = (nr_offset)?nr_offset->h->data.i_val:-1;
- wrd offset = (nr_offset)?nr_offset->h->next->data.i_val:0;
- assert(!nr_offset || nr_offset->h->type == type_lng);
- assert(!nr_offset || nr_offset->h->next->type == type_lng);
Romulo
Stefan
to allow the load of billions of records in a single copy command.
U sql_parser.mx Index: sql_parser.mx =================================================================== RCS file: /cvsroot/monetdb/sql/src/server/sql_parser.mx,v retrieving revision 1.291 retrieving revision 1.292 diff -u -d -r1.291 -r1.292 --- sql_parser.mx 9 Sep 2008 13:28:49 -0000 1.291 +++ sql_parser.mx 16 Sep 2008 14:55:41 -0000 1.292 @@ -583,6 +583,8 @@
%type <l_val> opt_start
- lngval
- poslng opt_increment opt_min opt_max
@@ -2462,8 +2464,8 @@
opt_nr: /* empty */ { $$ = NULL; }
- | posint RECORDS { $$ = append_int(append_int(L(), $1), 0); }
- | posint OFFSET posint RECORDS { $$ = append_int(append_int(L(), $1), $3); }
- | poslng RECORDS { $$ = append_lng(append_lng(L(), $1), 0); }
- | poslng OFFSET poslng RECORDS { $$ = append_lng(append_lng(L(), $1), $3); } ;
opt_null_string: @@ -4118,6 +4120,17 @@ } ;
+poslng:
- lngval { $$ = $1;
if ($$ < 0) {
$$ = -1;
yyerror("Positive value expected");
YYABORT;
}
}
- ;
posint: intval { $$ = $1; if ($$ < 0) { @@ -4394,6 +4407,10 @@ { $$ = append_string($1, $3); } ;
+lngval:
- sqlINT { $$ = strtoll($1,NULL,10); }
+;
intval: sqlINT { $$ = strtol($1,NULL,10); } | IDENT { mvc *m = (mvc*)parm;
U sql_updates.mx Index: sql_updates.mx =================================================================== RCS file: /cvsroot/monetdb/sql/src/server/sql_updates.mx,v retrieving revision 1.145 retrieving revision 1.146 diff -u -d -r1.145 -r1.146 --- sql_updates.mx 7 Sep 2008 14:28:00 -0000 1.145 +++ sql_updates.mx 16 Sep 2008 14:55:42 -0000 1.146 @@ -1411,11 +1411,11 @@ char *ssep = (seps->h->next->next)?seps->h->next->next->data.sval:"""; char *ns = (null_string)?null_string:"null"; list *slist;
- int nr = (nr_offset)?nr_offset->h->data.i_val:-1;
- int offset = (nr_offset)?nr_offset->h->next->data.i_val:0;
- lng nr = (nr_offset)?nr_offset->h->data.i_val:-1;
- lng offset = (nr_offset)?nr_offset->h->next->data.i_val:0;
- assert(!nr_offset || nr_offset->h->type == type_int);
- assert(!nr_offset || nr_offset->h->next->type == type_int);
- assert(!nr_offset || nr_offset->h->type == type_lng);
- assert(!nr_offset || nr_offset->h->next->type == type_lng); if (sname && !(s=mvc_bind_schema(sql, sname))) { (void) sql_error(sql, 02, "COPY INTO: no such schema '%s'", sname); return NULL;
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Monetdb-sql-checkins mailing list Monetdb-sql-checkins@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins
participants (2)
-
Romulo Goncalves
-
Stefan Manegold