| 950 | } |
| 951 | |
| 952 | bool ParseTableSchemaFile(const string& file, TableDescriptor* table_desc, ErrorCode* err) { |
| 953 | PropTree schema_tree; |
| 954 | if (!schema_tree.ParseFromFile(file)) { |
| 955 | LOG(ERROR) << schema_tree.State(); |
| 956 | LOG(ERROR) << file; |
| 957 | return false; |
| 958 | } |
| 959 | |
| 960 | VLOG(10) << "table to create: " << schema_tree.FormatString(); |
| 961 | return FillTableDescriptor(schema_tree, table_desc) && CheckTableDescrptor(*table_desc, err); |
| 962 | } |
| 963 | |
| 964 | bool BuildSchema(TableDescriptor* table_desc, string* schema) { |
| 965 | // build schema string from table descriptor |