Skip to content

Commit

Permalink
Add SCALAR/VECTOR information to data column inspect
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Aug 12, 2016
1 parent f0f3636 commit af8022c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
23 changes: 14 additions & 9 deletions ext/groonga/rb-grn-object.c
Original file line number Diff line number Diff line change
Expand Up @@ -888,22 +888,27 @@ rb_grn_object_inspect_content_flags_with_label (VALUE inspected,
break;
}

if (0) {
if (flags & GRN_OBJ_COLUMN_SCALAR)
switch (object->header.type) {
case GRN_COLUMN_FIX_SIZE:
case GRN_COLUMN_VAR_SIZE:
if (flags & GRN_OBJ_COLUMN_SCALAR) {
rb_ary_push(inspected_flags, rb_str_new_cstr("COLUMN_SCALAR"));
if (flags & GRN_OBJ_COLUMN_VECTOR)
} else if (flags & GRN_OBJ_COLUMN_VECTOR) {
rb_ary_push(inspected_flags, rb_str_new_cstr("COLUMN_VECTOR"));
if (flags & GRN_OBJ_COLUMN_INDEX)
rb_ary_push(inspected_flags, rb_str_new_cstr("COLUMN_INDEX"));
}
break;
default:
break;
}

switch (object->header.type) {
case GRN_COLUMN_FIX_SIZE:
case GRN_COLUMN_VAR_SIZE:
if (flags & GRN_OBJ_COMPRESS_ZLIB)
rb_ary_push(inspected_flags, rb_str_new_cstr("COMPRESS_ZLIB"));
if (flags & GRN_OBJ_COMPRESS_LZ4)
rb_ary_push(inspected_flags, rb_str_new_cstr("COMPRESS_LZ4"));
if (flags & GRN_OBJ_COMPRESS_ZLIB) {
rb_ary_push(inspected_flags, rb_str_new_cstr("COMPRESS_ZLIB"));
} else if (flags & GRN_OBJ_COMPRESS_LZ4) {
rb_ary_push(inspected_flags, rb_str_new_cstr("COMPRESS_LZ4"));
}
break;
case GRN_COLUMN_INDEX:
if (flags & GRN_OBJ_WITH_SECTION)
Expand Down
2 changes: 1 addition & 1 deletion test/test-schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ def test_full_option
"path: <#{path}>, " +
"domain: <Posts>, " +
"range: <Niku>, " +
"flags: <KEY_VAR_SIZE|COMPRESS_LZ4>>",
"flags: <COLUMN_VECTOR|COMPRESS_LZ4>>",
column.inspect)
end
end
Expand Down

0 comments on commit af8022c

Please sign in to comment.