Navigation Menu

Skip to content

Commit

Permalink
dump: add new lines for readability
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Apr 3, 2015
1 parent 997ed43 commit b8d60b8
Show file tree
Hide file tree
Showing 13 changed files with 34 additions and 7 deletions.
18 changes: 14 additions & 4 deletions lib/proc.c
Expand Up @@ -2743,10 +2743,6 @@ dump_plugins(grn_ctx *ctx, grn_obj *outbuf)
}
grn_table_cursor_close(ctx, cursor);

if (grn_table_size(ctx, (grn_obj *)processed_paths) > 0) {
GRN_TEXT_PUTC(ctx, outbuf, '\n');
}

grn_hash_close(ctx, processed_paths);
}

Expand Down Expand Up @@ -3001,6 +2997,8 @@ dump_records(grn_ctx *ctx, grn_obj *outbuf, grn_obj *table)
goto exit;
}

GRN_TEXT_PUTC(ctx, outbuf, '\n');

GRN_TEXT_PUTS(ctx, outbuf, "load --table ");
dump_obj_name(ctx, outbuf, table);
GRN_TEXT_PUTS(ctx, outbuf, "\n[\n");
Expand Down Expand Up @@ -3142,6 +3140,10 @@ dump_table(grn_ctx *ctx, grn_obj *outbuf, grn_obj *table,
break;
}

if (GRN_TEXT_LEN(outbuf) > 0) {
GRN_TEXT_PUTC(ctx, outbuf, '\n');
}

GRN_TEXT_PUTS(ctx, outbuf, "table_create ");
dump_obj_name(ctx, outbuf, table);
GRN_TEXT_PUTC(ctx, outbuf, ' ');
Expand Down Expand Up @@ -3216,6 +3218,14 @@ dump_pending_columns(grn_ctx *ctx, grn_obj *outbuf, grn_obj *pending_columns)
size_t i, n_columns;

n_columns = GRN_BULK_VSIZE(pending_columns) / sizeof(grn_obj *);
if (n_columns == 0) {
return;
}

if (GRN_TEXT_LEN(outbuf) > 0) {
GRN_TEXT_PUTC(ctx, outbuf, '\n');
}

for (i = 0; i < n_columns; i++) {
grn_obj *table, *column;

Expand Down
3 changes: 3 additions & 0 deletions test/command/suite/dump/record/lexicon.expected
Expand Up @@ -14,8 +14,11 @@ load --table Memos
dump
table_create Memos TABLE_NO_KEY
column_create Memos content COLUMN_SCALAR ShortText

table_create Terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto

column_create Terms memos_content_index COLUMN_INDEX|WITH_POSITION Memos content

load --table Memos
[
["_id","content"],
Expand Down
Expand Up @@ -23,9 +23,12 @@ load --table Queries
dump
table_create Queries TABLE_HASH_KEY UInt32
column_create Queries content COLUMN_SCALAR ShortText

table_create Words TABLE_HASH_KEY ShortText --default_tokenizer TokenDelimit
column_create Words boost COLUMN_SCALAR UInt32

column_create Words index COLUMN_INDEX Queries content

load --table Queries
[
["_key","content"],
Expand All @@ -38,6 +41,7 @@ load --table Queries
[7,"Animation Raccoon"],
[8,"Animation Music"]
]

load --table Words
[
["_key","boost"],
Expand Down
3 changes: 3 additions & 0 deletions test/command/suite/dump/record/vector_long_key.expected
Expand Up @@ -11,8 +11,11 @@ load --table Users
[[0,0.0,0.0],1]
dump
table_create Tags TABLE_HASH_KEY ShortText

table_create Users TABLE_HASH_KEY ShortText

column_create Users tags COLUMN_VECTOR Tags

load --table Users
[
["_key","tags"],
Expand Down
1 change: 1 addition & 0 deletions test/command/suite/dump/record/weight_vector_type.expected
Expand Up @@ -16,6 +16,7 @@ load --table Memos
dump
table_create Memos TABLE_HASH_KEY ShortText
column_create Memos tags COLUMN_VECTOR|WITH_WEIGHT ShortText

load --table Memos
[
["_key","tags"],
Expand Down
Expand Up @@ -15,9 +15,13 @@ column_create Terms users_name_index COLUMN_INDEX|WITH_POSITION Users name
dump
table_create Bookmarks TABLE_HASH_KEY ShortText
column_create Bookmarks title COLUMN_SCALAR ShortText

table_create Users TABLE_HASH_KEY ShortText
column_create Users name COLUMN_SCALAR ShortText

table_create Terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto

column_create Users bookmark COLUMN_SCALAR Bookmarks

column_create Terms users_name_index COLUMN_INDEX|WITH_POSITION Users name

Expand Up @@ -13,8 +13,10 @@ column_create Bookmarks user COLUMN_SCALAR Users
dump
table_create Bookmarks TABLE_HASH_KEY ShortText
column_create Bookmarks title COLUMN_SCALAR ShortText

table_create Users TABLE_HASH_KEY ShortText
column_create Users name COLUMN_SCALAR ShortText

column_create Bookmarks user COLUMN_SCALAR Users
column_create Users bookmark COLUMN_SCALAR Bookmarks

1 change: 0 additions & 1 deletion test/command/suite/dump/schema/plugin/multiple.expected
Expand Up @@ -6,4 +6,3 @@ dump
plugin_register token_filters/stop_word
plugin_register query_expanders/tsv


1 change: 0 additions & 1 deletion test/command/suite/dump/schema/plugin/native.expected
Expand Up @@ -3,4 +3,3 @@ plugin_register token_filters/stop_word
dump
plugin_register token_filters/stop_word


1 change: 0 additions & 1 deletion test/command/suite/dump/schema/plugin/ruby.expected
Expand Up @@ -3,4 +3,3 @@ plugin_register sharding
dump
plugin_register sharding


Expand Up @@ -4,5 +4,6 @@ table_create Users TABLE_DAT_KEY Names
[[0,0.0,0.0],true]
dump
table_create Names TABLE_PAT_KEY ShortText

table_create Users TABLE_DAT_KEY Names

Expand Up @@ -4,5 +4,6 @@ table_create Users TABLE_HASH_KEY Names
[[0,0.0,0.0],true]
dump
table_create Names TABLE_PAT_KEY ShortText

table_create Users TABLE_HASH_KEY Names

Expand Up @@ -4,5 +4,6 @@ table_create Users TABLE_PAT_KEY Names
[[0,0.0,0.0],true]
dump
table_create Names TABLE_PAT_KEY ShortText

table_create Users TABLE_PAT_KEY Names

0 comments on commit b8d60b8

Please sign in to comment.