22 #ifndef Hypertable_Lib_HqlParser_h
23 #define Hypertable_Lib_HqlParser_h
27 #ifdef BOOST_SPIRIT_DEBUG
28 #define BOOST_SPIRIT_DEBUG_OUT std::cerr
29 #define HQL_DEBUG(_expr_) std::cerr << __func__ <<": "<< _expr_ << std::endl
30 #define HQL_DEBUG_VAL(str, val) HQL_DEBUG(str <<" val="<< val)
32 #define HQL_DEBUG(_expr_)
33 #define HQL_DEBUG_VAL(str, val)
57 #include <boost/algorithm/string.hpp>
58 #include <boost/spirit/include/classic_confix.hpp>
59 #include <boost/spirit/include/classic_core.hpp>
60 #include <boost/spirit/include/classic_escape_char.hpp>
61 #include <boost/spirit/include/classic_symbols.hpp>
75 using namespace boost;
154 : timestamp(
AUTO_ASSIGN), row_key_is_call(false), value_is_call(false)
162 row_key_is_call=
false;
176 end(
Key::END_ROW_MARKER), end_inclusive(true), end_set(false) { }
181 start_inclusive = end_inclusive =
true;
182 start_set = end_set =
false;
184 bool empty() {
return !(start_set || end_set); }
187 HQL_DEBUG(s <<
" inclusive="<< inclusive);
189 start_inclusive = inclusive;
192 void set_end(
const std::string &s,
bool inclusive) {
193 HQL_DEBUG(s <<
" inclusive="<< inclusive);
195 end_inclusive = inclusive;
209 end_inclusive(true), end_set(false) { }
212 start_row = start_column =
"";
213 end_row = end_column =
"";
214 start_inclusive = end_inclusive =
true;
215 start_set = end_set =
false;
218 bool empty() {
return !(start_set || end_set); }
220 void set_start(
const std::string &row,
const std::string &column,
bool inclusive) {
221 HQL_DEBUG(row <<
','<< column <<
" inclusive="<< inclusive);
223 start_column = column;
224 start_inclusive = inclusive;
227 void set_end(
const std::string &row,
const std::string &column,
bool inclusive) {
228 HQL_DEBUG(row <<
','<< column <<
" inclusive="<< inclusive);
231 end_inclusive = inclusive;
249 HQL_DEBUG(
"("<< start <<
", "<< end <<
")");
250 builder.set_time_interval(start, end);
251 start_time_set = end_time_set =
true;
255 builder.set_start_time(start);
256 start_time_set =
true;
260 builder.set_end_time(end);
263 ::int64_t
start_time() {
return builder.get().time_interval.first; }
264 ::int64_t
end_time() {
return builder.get().time_interval.second; }
268 bool display_timestamps {};
269 bool display_revisions {};
272 bool current_rowkey_set {};
277 bool start_time_set {};
278 bool end_time_set {};
279 ::int64_t current_timestamp {};
280 bool current_timestamp_set {};
281 int current_relop {};
307 int input_file_src {};
309 int header_file_src {};
310 ::uint32_t group_commit_interval {};
333 ::uint32_t nanoseconds {};
334 double decimal_seconds {};
340 bool delete_all_columns {};
342 ::int64_t delete_time {};
343 ::int64_t delete_version_time {};
353 ::int32_t scanner_id {-1};
354 ::int32_t row_uniquify_chars {};
361 uint32_t current_column_predicate_operation {};
362 char field_separator {};
368 "identifier '") + s +
"()'");
378 execute_function(rec.
value);
390 "identifier '") + s +
"()'");
394 const std::string &option) {
395 std::string key = name +
"." + option;
396 if (column_option_definition_set.count(key) > 0)
398 "Multiple specifications of %s option for column '%s'",
399 option.c_str(), name.c_str());
400 column_option_definition_set.insert(key);
404 const std::string &option) {
405 std::string key = name +
"." + option;
406 if (access_group_option_definition_set.count(key) > 0)
408 "Multiple specifications of %s option for access group '%s'",
409 option.c_str(), name.c_str());
410 access_group_option_definition_set.insert(key);
414 auto iter = new_cf_map.find(name);
415 if (iter != new_cf_map.end())
418 new_cf_map[name] = cf;
419 new_cf_vector.push_back(cf);
424 auto iter = modified_cf_map.find(name);
425 if (iter != modified_cf_map.end())
430 for (
auto ag : modified_ag_vector) {
431 if ((existing_cf = ag->get_column(name)) !=
nullptr)
435 if (existing_cf ==
nullptr) {
436 existing_cf = alter_schema->get_column_family(name);
437 if (existing_cf ==
nullptr)
439 "Attempt to modify column '%s' which does not exist",
443 new_cf->
set_id(existing_cf->get_id());
447 modified_cf_map[name] = new_cf;
448 modified_cf_vector.push_back(new_cf);
453 if (new_ag_map.find(name) != new_ag_map.end())
455 "Multiple definitions for access group '%s'",
458 new_ag_map[name] = ag;
459 new_ag_vector.push_back(ag);
464 auto iter = new_ag_map.find(name);
465 if (iter != new_ag_map.end())
471 auto iter = modified_ag_map.find(name);
472 if (iter != modified_ag_map.end())
474 "Attempt to modify access group '%s' twice in the same command",
477 auto existing_ag = alter_schema->get_access_group(name);
478 if (existing_ag ==
nullptr)
480 "Attempt to modify access group '%s' which does not exist",
483 modified_ag_map[name] = ag;
484 modified_ag_vector.push_back(ag);
489 auto iter = modified_ag_map.find(name);
490 if (iter != modified_ag_map.end())
496 for (
auto ag : modified_ag_vector) {
497 auto cf = ag->get_column(name);
505 return create_schema ||
506 (alter_schema && new_ag_map.find(ag_spec->get_name()) != new_ag_map.end());
516 if (len > 1 && (*str ==
'\'' || *str ==
'"') && *str == *(str+len-1))
517 return String(str+1, len-2);
522 if (len > 0 && *str !=
'/')
524 std::string regex =
String(str+1, len-2);
525 std::string oldStr(
"\\/");
526 std::string newStr(
"/");
528 while((pos = regex.find(oldStr, pos)) != std::string::npos) {
529 regex.replace(pos, oldStr.length(), newStr);
530 pos += newStr.length();
536 if (!isalpha(name[0]))
538 std::function<bool(char)> valid_char_predicate =
539 [](
char c) ->
bool {
return isalnum(c) || c ==
'_' || c ==
'-';};
540 return find_if_not(name.begin(), name.end(), valid_char_predicate) != name.end();
546 state.command = command;
571 std::string name =
String(str, end-str);
572 const char *pseudo = strstr(name.c_str(),
"^.");
574 state.table_name =
String(name.c_str(), pseudo);
575 trim_if(state.table_name, is_any_of(
"'\""));
576 state.pseudo_table_name =
String(pseudo+1);
579 state.table_name = name;
580 trim_if(state.table_name, is_any_of(
"'\""));
598 if (strstr(name.c_str(),
"^."))
600 "Psudo-table '%s' schema cannot be altered", name.c_str());
601 state.table_name = name;
603 state.alter_schema = state.nsp->get_schema(name);
651 state.balance_plan.algorithm =
strip_quotes(str, end-str);
660 move_spec->table.set_id(state.table_name);
661 move_spec->range.set_start_row(state.range_start_row);
662 move_spec->range.set_end_row(state.range_end_row);
663 move_spec->source_location = state.source;
664 move_spec->dest_location = state.destination;
665 state.balance_plan.moves.push_back(move_spec);
673 state.balance_plan.duration_millis = 1000*duration;
681 state.if_exists =
true;
689 state.tables_only =
true;
697 state.with_ids =
true;
714 state.table_name = name;
715 state.create_schema = std::make_shared<Schema>();
724 if (!state.clone_table_name.empty()) {
725 std::string schema_str = state.nsp->get_schema_str(state.clone_table_name,
true);
727 state.create_schema->clear_generation();
729 else if (state.input_file.empty()) {
731 state.create_schema->set_group_commit_interval(state.group_commit_interval);
732 state.create_schema->set_access_group_defaults(state.table_ag_defaults);
733 state.create_schema->set_column_family_defaults(state.table_cf_defaults);
737 for (
auto cf : state.new_cf_vector) {
739 if (state.new_cf.count(cf->get_name()) == 0)
741 "Reference to undefined column '%s'", cf->get_name().c_str());
744 if (cf->get_access_group().empty()) {
745 cf->set_access_group(
"default");
746 if (state.new_ag_map.find(
"default") == state.new_ag_map.end())
747 state.create_new_access_group(
"default");
749 auto iter = state.new_ag_map.find(cf->get_access_group());
750 HT_ASSERT(iter != state.new_ag_map.end());
751 iter->second->add_column(cf);
755 for (
auto ag_spec : state.new_ag_vector)
756 state.create_schema->add_access_group(ag_spec);
758 state.create_schema->validate();
772 if (!state.input_file.empty())
777 for (
auto modified_cf : state.modified_cf_vector) {
779 auto iter = state.modified_ag_map.find(modified_cf->get_access_group());
780 if (iter != state.modified_ag_map.end())
781 ag_spec = iter->second;
783 ag_spec = state.alter_schema->get_access_group(modified_cf->get_access_group());
789 "Modificaton of TIME ORDER option for column '%s' is not allowed.",
793 "Modificaton of COUNTER option for column '%s' is not allowed.",
799 for (
auto cf : state.new_cf_vector) {
800 if (cf->get_access_group().empty()) {
802 if (state.new_ag_map.find(
"default") == state.new_ag_map.end() &&
803 state.alter_schema->get_access_group(
"default") ==
nullptr)
804 state.create_new_access_group(
"default");
806 AccessGroupSpec *ag = state.find_modified_access_group(cf->get_access_group());
808 ag = state.alter_schema->get_access_group(cf->get_access_group());
810 ag = state.find_new_access_group(cf->get_access_group());
817 for (
auto ag_spec : state.new_ag_vector)
818 state.alter_schema->add_access_group(ag_spec);
823 for (
auto modified_ag_spec : state.modified_ag_vector) {
824 string ag_name = modified_ag_spec->get_name();
825 auto old_ag_spec = state.alter_schema->get_access_group(ag_name);
826 for (
auto old_cf : old_ag_spec->columns()) {
827 string cf_name = old_cf->get_name();
828 if (!old_cf->get_deleted())
830 "Missing column '%s' from modified access group '%s'",
831 cf_name.c_str(), ag_name.c_str());
832 modified_ag_spec->add_column(old_ag_spec->get_column(cf_name));
834 old_ag_spec->clear_columns();
835 old_ag_spec = state.alter_schema->replace_access_group(modified_ag_spec);
839 state.alter_schema->validate();
847 state.modify = value;
859 state.cf_spec = state.get_modified_column_family(name);
869 if (state.alter_schema) {
870 if (state.alter_schema->get_column_family(name))
872 "Attempt to add column '%s' which already exists",
876 if (state.new_cf.count(name) > 0)
878 "Column family '%s' multiply defined", name.c_str());
880 state.new_cf.insert(name);
881 state.cf_spec = state.get_new_column_family(name);
892 state.cf_spec = state.alter_schema->get_column_family(name);
893 if (state.cf_spec ==
nullptr)
895 "Attempt to modify column '%s' which does not exist",
904 state.cf_spec =
nullptr;
914 bool drop_from_modified_ag {};
915 state.cf_spec = state.alter_schema->get_column_family(name);
916 if (state.cf_spec ==
nullptr) {
917 state.cf_spec = state.find_column_family_in_modified_ag(name);
918 if (state.cf_spec ==
nullptr)
920 "Attempt to drop column '%s' which does not exist",
922 drop_from_modified_ag =
true;
924 if (state.cf_spec->get_deleted())
926 "Attempt to drop column '%s' which is already dropped",
928 if (drop_from_modified_ag) {
929 auto ag = state.find_modified_access_group(state.cf_spec->get_access_group());
931 ag->drop_column(name);
934 state.alter_schema->drop_column_family(name);
946 cf = state.alter_schema->get_column_family(name);
949 "column '%s' which does not exist", name.c_str());
963 cf = state.alter_schema->get_column_family(name);
966 "column '%s' which does not exist", name.c_str());
976 state.current_rename_column_old_name =
strip_quotes(str, end-str);
978 state.cf_spec = state.alter_schema->get_column_family(state.current_rename_column_old_name);
979 if (state.cf_spec ==
nullptr)
981 "Attempt to rename column family '%s' which does not exist",
982 state.current_rename_column_old_name.c_str());
991 if (state.alter_schema->get_column_family(new_name))
993 "Attempt to rename column '%s' to '%s', which already exists",
994 state.current_rename_column_old_name.c_str(),
996 state.alter_schema->rename_column_family(state.current_rename_column_old_name, new_name);
1004 string value(str, end-str);
1006 if (!strcasecmp(value.c_str(),
"counter") ||
1007 !strcasecmp(value.c_str(),
"true"))
1009 if (state.cf_spec) {
1010 state.check_and_set_column_option(state.cf_spec->get_name(),
"COUNTER");
1011 state.cf_spec->set_option_counter(bval);
1013 else if (state.ag_spec) {
1014 state.check_and_set_access_group_option(state.ag_spec->get_name(),
"COUNTER");
1015 state.ag_spec->set_default_counter(bval);
1018 state.table_cf_defaults.set_counter(bval);
1026 if (state.cf_spec) {
1027 state.check_and_set_column_option(state.cf_spec->get_name(),
"MAX_VERSIONS");
1028 state.cf_spec->set_option_max_versions((::int32_t)strtol(str, 0, 10));
1030 else if (state.ag_spec) {
1031 state.check_and_set_access_group_option(state.ag_spec->get_name(),
"MAX_VERSIONS");
1032 state.ag_spec->set_default_max_versions((::int32_t)strtol(str, 0, 10));
1035 state.table_cf_defaults.set_max_versions((::int32_t)strtol(str, 0, 10));
1043 std::string val =
String(str, end-str);
1045 if (state.cf_spec) {
1046 state.check_and_set_column_option(state.cf_spec->get_name(),
"TIME_ORDER");
1047 state.cf_spec->set_option_time_order_desc(val ==
"desc");
1049 else if (state.ag_spec) {
1050 state.check_and_set_access_group_option(state.ag_spec->get_name(),
"TIME_ORDER");
1051 state.ag_spec->set_default_time_order_desc(val ==
"desc");
1054 state.table_cf_defaults.set_time_order_desc(val ==
"desc");
1063 double ttl = strtod(str, &unit_ptr);
1065 while(*unit_ptr ==
' ' && unit_ptr < end )
1068 if (unit_ptr < end) {
1069 std::string unit_str =
String(unit_ptr, end-unit_ptr);
1072 if (unit_str.find(
"month") == 0)
1074 else if (unit_str.find(
"week") == 0)
1076 else if (unit_str.find(
"day") == 0)
1078 else if (unit_str.find(
"hour") == 0)
1080 else if (unit_str.find(
"minute") == 0)
1084 if (state.cf_spec) {
1085 state.check_and_set_column_option(state.cf_spec->get_name(),
"TTL");
1086 state.cf_spec->set_option_ttl(ttl);
1088 else if (state.ag_spec) {
1089 state.check_and_set_access_group_option(state.ag_spec->get_name(),
"TTL");
1090 state.ag_spec->set_default_ttl(ttl);
1093 state.table_cf_defaults.set_ttl(ttl);
1103 state.ag_spec = state.create_modified_access_group(name);
1105 state.ag_spec = state.create_new_access_group(name);
1113 state.ag_spec =
nullptr;
1121 string value(str, end-str);
1123 if (!strcasecmp(value.c_str(),
"in_memory") ||
1124 !strcasecmp(value.c_str(),
"true"))
1126 if (state.ag_spec) {
1127 if (!state.ag_spec_is_new() &&
1128 !state.ag_spec->get_option_in_memory())
1130 "Modification of IN_MEMORY attribute for access group '%s'"
1131 " is not supported", state.ag_spec->get_name().c_str());
1132 state.ag_spec->set_option_in_memory(bval);
1135 state.table_ag_defaults.set_in_memory(bval);
1144 to_lower(compressor);
1145 if (state.ag_spec) {
1146 if (!state.ag_spec_is_new() &&
1147 compressor != state.ag_spec->get_option_compressor())
1149 "Modification of COMPRESSOR attribute for access group '%s'"
1150 " is not supported", state.ag_spec->get_name().c_str());
1151 state.ag_spec->set_option_compressor(compressor);
1154 state.table_ag_defaults.set_compressor(compressor);
1163 state.ag_spec->set_option_blocksize(blocksize);
1165 state.table_ag_defaults.set_blocksize(blocksize);
1173 if (state.ag_spec) {
1174 if (!state.ag_spec_is_new() &&
1175 replication != (size_t)state.ag_spec->get_option_replication())
1177 "Modification of REPLICATION attribute for access group '%s'"
1178 " is not supported", state.ag_spec->get_name().c_str());
1179 if (replication >= 32768)
1181 "Invalid replication factor (%u) for access group '%s'",
1182 (
unsigned)replication, state.ag_spec->get_name().c_str());
1183 state.ag_spec->set_option_replication(replication);
1186 state.table_ag_defaults.set_replication(replication);
1195 to_lower(bloom_filter);
1196 if (state.ag_spec) {
1197 if (!state.ag_spec_is_new() &&
1198 bloom_filter != state.ag_spec->get_option_bloom_filter())
1200 "Modification of BLOOMFILTER attribute for access group '%s'"
1201 " is not supported", state.ag_spec->get_name().c_str());
1202 state.ag_spec->set_option_bloom_filter(bloom_filter);
1205 state.table_ag_defaults.set_bloom_filter(bloom_filter);
1217 if (state.ag_spec->get_column(name) !=
nullptr)
1219 " add column '%s' to access group '%s' twice",
1220 name.c_str(), state.ag_spec->get_name().c_str());
1221 cf = state.alter_schema->remove_column_family(name);
1224 " column '%s' from access group '%s' to '%s' is not "
1226 state.ag_spec->get_name().c_str());
1230 cf = state.get_new_column_family(name);
1236 "access group '%s' when it already belongs to access group"
1237 " '%s'", name.c_str(), state.ag_spec->get_name().c_str(),
1241 state.ag_spec->add_column(cf);
1253 if (state.alter_schema)
1254 cf = state.alter_schema->get_column_family(name);
1257 cf = state.get_new_column_family(name);
1261 "Index for column family '%s' %s defined",
1262 name.c_str(), state.alter_schema ?
"already" :
"multiply");
1266 "Attempt to define value index for COUNTER column '%s'",
1280 if (state.alter_schema)
1281 cf = state.alter_schema->get_column_family(name);
1284 cf = state.get_new_column_family(name);
1288 "Qualifier index for column family '%s' %s defined",
1289 name.c_str(), state.alter_schema ?
"already" :
"multiply");
1293 "Attempt to define qualifier index for COUNTER column '%s'",
1304 state.scan.builder.set_do_not_cache(
true);
1312 std::string regexp(str, end-str);
1313 trim_if(regexp, boost::is_any_of(
"'\""));
1314 state.scan.builder.set_row_regexp(regexp.c_str());
1322 std::string regexp(str, end-str);
1323 trim_if(regexp, boost::is_any_of(
"'\""));
1324 state.scan.builder.set_value_regexp(regexp.c_str());
1332 state.current_column_predicate_name =
String(str, end-str);
1339 : state(state), operation(operation) { }
1341 state.current_column_predicate_operation |= operation;
1343 state.current_column_predicate_qualifier =
1346 state.current_column_predicate_qualifier =
1348 state.scan.builder.set_and_column_predicates(state.scan.last_boolean_op ==
BOOLOP_AND);
1352 state.current_column_predicate_operation |=
1354 state.current_column_predicate_qualifier.clear();
1355 state.scan.builder.set_and_column_predicates(state.scan.last_boolean_op ==
BOOLOP_AND);
1363 : state(state), operation(operation) { }
1370 state.current_column_predicate_operation |= operation;
1371 state.scan.builder.add_column_predicate(state.current_column_predicate_name.c_str(),
1372 state.current_column_predicate_qualifier.c_str(),
1373 state.current_column_predicate_operation,
1375 state.current_column_predicate_name.clear();
1376 state.current_column_predicate_qualifier.clear();
1377 state.current_column_predicate_operation = 0;
1378 state.scan.builder.set_and_column_predicates(state.scan.last_boolean_op ==
BOOLOP_AND);
1382 state.current_column_predicate_operation |= operation;
1383 state.scan.builder.add_column_predicate(state.current_column_predicate_name.c_str(),
1384 state.current_column_predicate_qualifier.c_str(),
1385 state.current_column_predicate_operation,
"");
1386 state.current_column_predicate_name.clear();
1387 state.current_column_predicate_qualifier.clear();
1388 state.current_column_predicate_operation = 0;
1389 state.scan.builder.set_and_column_predicates(state.scan.last_boolean_op ==
BOOLOP_AND);
1397 : state(state), operation(operation) { }
1399 state.scan.builder.add_column_predicate(state.current_column_predicate_name.c_str(),
1400 state.current_column_predicate_qualifier.c_str(),
1410 if (state.group_commit_interval != 0)
1412 state.group_commit_interval = (::uint32_t)interval;
1421 state.str =
String(str, end-str);
1422 size_t offset = state.str.find_first_of(
' ');
1423 if (offset != String::npos) {
1424 state.str = state.str.substr(offset+1);
1426 to_lower(state.str);
1437 state.str =
String(str, end-str);
1438 trim_if(state.str, is_any_of(
"'\""));
1446 state.output_file =
String(str, end-str);
1447 trim_if(state.output_file, is_any_of(
"'\""));
1456 std::string file =
String(str, end-str);
1457 trim_if(file, is_any_of(
"'\""));
1459 if (boost::algorithm::starts_with(file,
"fs://")) {
1461 state.input_file = file.substr(5);
1463 else if (boost::algorithm::starts_with(file,
"dfs://")) {
1465 state.input_file = file.substr(6);
1467 else if (file.compare(
"-") == 0) {
1468 state.input_file_src =
STDIN;
1472 if (boost::algorithm::starts_with(file,
"file://"))
1473 state.input_file = file.substr(7);
1475 state.input_file = file;
1486 std::string file =
String(str, end-str);
1487 trim_if(file, is_any_of(
"'\""));
1490 if (boost::algorithm::starts_with(file,
"fs://") ||
1491 boost::algorithm::starts_with(file,
"dfs://")) {
1493 "Header file must be in local filesystem, not in the brokered FS");
1496 if (boost::algorithm::starts_with(file,
"file://"))
1497 state.header_file = file.substr(7);
1499 state.header_file = file;
1509 if (*str !=
'0' && strncasecmp(str,
"no", 2) &&
1510 strncasecmp(str,
"off", 3) &&
1511 strncasecmp(str,
"false", 4))
1528 std::string column(str, end-str);
1529 trim_if(column, is_any_of(
"'\""));
1530 state.columns.push_back(column);
1538 state.timestamp_column =
String(str, end-str);
1539 trim_if(state.timestamp_column, is_any_of(
"'\""));
1547 state.row_uniquify_chars = nchars;
1571 std::string field_separator(str, end-str);
1572 trim_if(field_separator, is_any_of(
"'\""));
1573 if (field_separator.length() != 1)
1575 "Field separator must be a single character");
1576 state.field_separator = field_separator[0];
1583 qualifier_flag(qualifier_flag) { }
1585 std::string column_name(str, end-str);
1586 trim_if(column_name, is_any_of(
"'\""));
1588 state.scan.builder.add_column(column_name.c_str());
1590 state.current_column_family = column_name;
1598 : state(state), qualifier_flag(_qualifier_flag) { }
1600 std::string qualifier(str, end-str);
1601 std::string qualified_column = state.current_column_family
1606 state.scan.builder.add_column(qualified_column.c_str());
1610 std::string qualified_column = state.current_column_family +
":*";
1611 state.scan.builder.add_column(qualified_column.c_str());
1621 state.scan.display_timestamps=
true;
1629 state.scan.display_revisions=
true;
1637 state.scan.display_timestamps=
false;
1647 state.scan.builder.add_row_interval(ri.
start.c_str(),
1657 state.scan.current_cell_row =
strip_quotes(str,end-str);
1666 std::string &row = state.scan.current_cell_row;
1667 std::string &column = state.scan.current_cell_column;
1669 column =
String(str, end-str);
1670 trim_if(column, is_any_of(
"'\""));
1672 if (state.scan.current_relop) {
1673 switch (state.scan.current_relop) {
1678 ci.
set_end(row, column,
true);
1683 ci.
set_end(row, column,
false);
1688 ci.
set_end(row, column,
true);
1704 column.append(1, static_cast<char>(0xff));
1705 ci.
set_end(row, column,
false);
1711 state.scan.builder.add_cell_interval(ci.
start_row.c_str(),
1717 state.scan.current_relop = 0;
1726 state.scan.current_rowkey =
strip_quotes(str, end-str);
1727 if (state.scan.current_relop != 0) {
1728 switch (state.scan.current_relop) {
1730 if (!state.scan.current_ri.empty())
1732 state.scan.current_ri.set_start(state.scan.current_rowkey,
true);
1733 state.scan.current_ri.set_end(state.scan.current_rowkey,
true);
1736 if (state.scan.current_ri.end_set)
1738 state.scan.current_ri.set_end(state.scan.current_rowkey,
false);
1741 if (state.scan.current_ri.end_set)
1743 state.scan.current_ri.set_end(state.scan.current_rowkey,
true);
1746 if (state.scan.current_ri.start_set)
1748 state.scan.current_ri.set_start(state.scan.current_rowkey,
false);
1751 if (state.scan.current_ri.start_set)
1753 state.scan.current_ri.set_start(state.scan.current_rowkey,
true);
1756 if (!state.scan.current_ri.empty())
1758 state.scan.current_ri.set_start(state.scan.current_rowkey,
true);
1759 str = state.scan.current_rowkey.c_str();
1760 end = str + state.scan.current_rowkey.length();
1762 for (ptr = end - 1; ptr >
str; --ptr) {
1763 if (::uint8_t(*ptr) < 0xffu) {
1764 std::string temp_str(str, ptr - str);
1765 temp_str.append(1, (*ptr) + 1);
1766 state.scan.current_ri.set_end(temp_str,
false);
1771 state.scan.current_rowkey.append(4, (
char)0xff);
1772 state.scan.current_ri.set_end(state.scan.current_rowkey,
false);
1775 state.scan.current_rowkey_set =
false;
1776 state.scan.current_relop = 0;
1779 state.scan.current_rowkey_set =
true;
1780 state.scan.current_cell_row.clear();
1789 if (state.scan.buckets != 0)
1791 "SELECT BUCKETS predicate multiply defined.");
1792 state.scan.buckets = ival;
1800 if (state.scan.builder.get().max_versions != 0)
1802 "SELECT MAX_VERSIONS predicate multiply defined.");
1803 state.scan.builder.set_max_versions(ival);
1811 if (state.scan.builder.get().row_limit != 0)
1813 "SELECT LIMIT predicate multiply defined.");
1814 state.scan.builder.set_row_limit(ival);
1822 if (state.scan.builder.get().cell_limit != 0)
1824 "SELECT CELL_LIMIT predicate multiply defined.");
1825 state.scan.builder.set_cell_limit(ival);
1833 if (state.scan.builder.get().cell_limit_per_family != 0)
1835 "SELECT CELL_LIMIT_PER_FAMILY predicate multiply defined.");
1836 state.scan.builder.set_cell_limit_per_family(ival);
1844 if (state.scan.builder.get().row_offset != 0)
1846 "SELECT OFFSET predicate multiply defined.");
1847 if (state.scan.builder.get().cell_offset != 0)
1849 "SELECT OFFSET predicate not allowed in combination with "
1851 state.scan.builder.set_row_offset(ival);
1859 if (state.scan.builder.get().cell_offset != 0)
1861 "SELECT CELL_OFFSET predicate multiply defined.");
1862 if (state.scan.builder.get().row_offset != 0)
1864 "SELECT OFFSET predicate not allowed in combination with "
1866 state.scan.builder.set_cell_offset(ival);
1874 if (state.scan.outfile !=
"")
1876 "SELECT INTO FILE multiply defined.");
1877 state.scan.outfile =
String(str, end-str);
1878 trim_if(state.scan.outfile, is_any_of(
"'\""));
1887 state.tmval.tm_year = ival - 1900;
1896 state.tmval.tm_mon = ival-1;
1905 state.tmval.tm_mday = ival;
1914 state.tmval.tm_sec = ival;
1923 state.tmval.tm_min = ival;
1932 state.tmval.tm_hour = ival;
1941 state.decimal_seconds = dval;
1950 state.nanoseconds = ival;
1957 : state(state), relop(relop) { }
1965 if (state.scan.current_timestamp_set) {
1968 if (state.scan.start_time_set || state.scan.end_time_set)
1970 state.scan.set_time_interval(state.scan.current_timestamp,
1971 state.scan.current_timestamp);
1974 if (state.scan.end_time_set ||
1975 (state.scan.start_time_set &&
1976 state.scan.start_time() >= state.scan.current_timestamp))
1978 state.scan.set_end_time(state.scan.current_timestamp);
1981 if (state.scan.end_time_set ||
1982 (state.scan.start_time_set &&
1983 state.scan.start_time() > state.scan.current_timestamp))
1985 state.scan.set_end_time(state.scan.current_timestamp + 1);
1988 if (state.scan.start_time_set ||
1989 (state.scan.end_time_set &&
1990 state.scan.start_time() <= (state.scan.current_timestamp + 1)))
1992 state.scan.set_start_time(state.scan.current_timestamp + 1);
1995 if (state.scan.start_time_set ||
1996 (state.scan.end_time_set &&
1997 state.scan.end_time() <= state.scan.current_timestamp))
1999 state.scan.set_start_time(state.scan.current_timestamp);
2004 state.scan.current_timestamp_set =
false;
2005 state.scan.current_relop = 0;
2007 else if (state.scan.current_rowkey_set) {
2008 HT_ASSERT(state.scan.current_rowkey_set);
2012 state.scan.current_ri.set_start(state.scan.current_rowkey,
true);
2013 state.scan.current_ri.set_end(state.scan.current_rowkey,
true);
2016 state.scan.current_ri.set_start(state.scan.current_rowkey,
false);
2019 state.scan.current_ri.set_start(state.scan.current_rowkey,
true);
2022 state.scan.current_ri.set_end(state.scan.current_rowkey,
false);
2025 state.scan.current_ri.set_end(state.scan.current_rowkey,
true);
2030 state.scan.current_rowkey_set =
false;
2031 state.scan.current_relop = 0;
2033 else if (state.scan.current_cell_row.size()
2034 && state.scan.current_ci.empty()) {
2035 std::string &row = state.scan.current_cell_row;
2036 std::string &column = state.scan.current_cell_column;
2040 state.scan.current_ci.set_start(row, column,
true);
2041 state.scan.current_ci.set_end(row, column,
true);
2044 state.scan.current_ci.set_start(row, column,
false);
2047 state.scan.current_ci.set_start(row, column,
true);
2050 state.scan.current_ci.set_end(row, column,
false);
2053 state.scan.current_ci.set_end(row, column,
true);
2059 state.scan.current_relop = 0;
2062 state.scan.current_relop = relop;
2070 : state(state), boolop(boolop) { }
2072 state.scan.last_boolean_op = boolop;
2084 state.scan.current_timestamp =
parse_ts(time_str.c_str());
2086 catch (std::runtime_error &e) {
2088 "Unable to parse timestamp - '%s'",
2091 if (state.scan.current_relop != 0) {
2092 switch (state.scan.current_relop) {
2094 if (state.scan.start_time_set || state.scan.end_time_set)
2096 state.scan.set_time_interval(state.scan.current_timestamp,
2097 state.scan.current_timestamp + 1);
2100 if (state.scan.end_time_set ||
2101 (state.scan.start_time_set &&
2102 state.scan.start_time() >= state.scan.current_timestamp))
2104 state.scan.set_end_time(state.scan.current_timestamp);
2107 if (state.scan.end_time_set ||
2108 (state.scan.start_time_set &&
2109 state.scan.start_time() > state.scan.current_timestamp))
2111 state.scan.set_end_time(state.scan.current_timestamp + 1);
2114 if (state.scan.start_time_set ||
2115 (state.scan.end_time_set &&
2116 state.scan.end_time() <= (state.scan.current_timestamp + 1)))
2118 state.scan.set_start_time(state.scan.current_timestamp + 1);
2121 if (state.scan.start_time_set ||
2122 (state.scan.end_time_set &&
2123 state.scan.end_time() <= state.scan.current_timestamp))
2125 state.scan.set_start_time(state.scan.current_timestamp);
2130 state.scan.current_relop = 0;
2131 state.scan.current_timestamp_set =
false;
2134 state.scan.current_timestamp_set =
true;
2137 state.decimal_seconds = 0;
2138 state.nanoseconds = 0;
2146 state.scan.builder.set_return_deletes(
true);
2154 state.scan.builder.set_scan_and_filter_rows(
true);
2162 state.escape =
false;
2179 state.scan.keys_only=
true;
2180 state.scan.builder.set_keys_only(
true);
2191 state.current_insert_value.timestamp =
parse_ts(time_str.c_str());
2193 catch (std::runtime_error &e) {
2195 "Unable to parse INSERT timestamp - '%s'",
2205 state.current_insert_value.row_key =
2214 to_lower(state.current_insert_value.row_key);
2215 state.validate_function(state.current_insert_value.row_key);
2216 state.current_insert_value.row_key_is_call =
true;
2224 state.current_insert_value.column_key =
String(str, end-str);
2225 trim_if(state.current_insert_value.column_key, is_any_of(
"'\""));
2233 state.current_insert_value.value =
String(str, end-str);
2234 trim_if(state.current_insert_value.value, is_any_of(
"'\""));
2242 to_lower(state.current_insert_value.value);
2243 state.validate_function(state.current_insert_value.value);
2244 state.current_insert_value.value_is_call =
true;
2256 state.execute_all_functions(state.current_insert_value);
2261 if ((cq = (
char*)strchr(rec.
column_key.c_str(),
':')) != 0) {
2269 state.inserts.add(cell);
2270 state.current_insert_value.clear();
2278 std::string column(str, end-str);
2279 trim_if(column, is_any_of(
"'\""));
2280 state.delete_columns.push_back(column);
2283 state.delete_all_columns =
true;
2302 state.delete_time =
parse_ts(time_str.c_str());
2304 catch (std::runtime_error &e) {
2306 "Unable to parse DELETE timestamp - '%s'",
2319 state.delete_version_time =
parse_ts(time_str.c_str());
2321 catch (std::runtime_error &e) {
2323 "Unable to parse DELETE timestamp - '%s'",
2333 state.scanner_id = (::uint32_t)strtol(str, 0, 10);
2349 std::string range_type_str =
String(str, end-str);
2350 trim_if(range_type_str, is_any_of(
"'\""));
2351 to_lower(range_type_str);
2352 if (range_type_str ==
"all")
2354 else if (range_type_str ==
"root")
2356 else if (range_type_str ==
"metadata")
2358 else if (range_type_str ==
"system")
2360 else if (range_type_str ==
"user")
2364 format(
"Invalid range type specifier: %s", range_type_str.c_str()));
2373 std::string compaction_type_str =
String(str, end-str);
2374 trim_if(compaction_type_str, is_any_of(
"'\""));
2375 to_lower(compaction_type_str);
2376 if (compaction_type_str ==
"minor")
2378 else if (compaction_type_str ==
"major")
2380 else if (compaction_type_str ==
"merging")
2382 else if (compaction_type_str ==
"gc")
2386 format(
"Invalid compaction type specifier: %s", compaction_type_str.c_str()));
2395 std::string index_type_str =
String(str, end-str);
2396 to_lower(index_type_str);
2397 if (index_type_str ==
"value")
2399 else if (index_type_str ==
"qualifier")
2403 format(
"Invalid index type specifier: %s", index_type_str.c_str()));
2412 std::string name =
String(str, end-str);
2415 if (state.current_variable_spec.code == -1)
2417 format(
"Unrecognized variable name: %s", name.c_str()));
2425 std::string value =
String(str, end-str);
2427 if (value ==
"true")
2428 state.current_variable_spec.value =
true;
2430 state.current_variable_spec.value =
false;
2431 state.variable_specs.push_back(state.current_variable_spec);
2440 template <
typename ScannerT>
2444 "access",
"ACCESS",
"Access",
"GROUP",
"group",
"Group",
2445 "from",
"FROM",
"From",
"start_time",
"START_TIME",
"Start_Time",
2446 "Start_time",
"end_time",
"END_TIME",
"End_Time",
"End_time",
2447 "into",
"INTO",
"Into",
"table",
"TABLE",
"Table",
"NAMESPACE",
"Namespace",
2448 "cells",
"CELLS",
"value",
"VALUE",
"regexp",
"REGEXP",
"wait",
"WAIT"
2449 "for",
"FOR",
"maintenance",
"MAINTENANCE",
"index",
"INDEX",
2450 "qualifier",
"QUALIFIER";
2457 chlit<> SINGLEQUOTE(
'\'');
2458 chlit<> DOUBLEQUOTE(
'"');
2459 chlit<> QUESTIONMARK(
'?');
2468 strlit<> DOUBLEEQUAL(
"==");
2475 strlit<> QUALPREFIX(
":^");
2476 chlit<> LPAREN(
'(');
2477 chlit<> RPAREN(
')');
2478 chlit<> LBRACK(
'[');
2479 chlit<> RBRACK(
']');
2480 chlit<> POINTER(
'^');
2482 strlit<> DOTDOT(
"..");
2483 strlit<> DOUBLEQUESTIONMARK(
"??");
2489 typedef inhibit_case<strlit<> > Token;
2491 Token CREATE = as_lower_d[
"create"];
2492 Token DROP = as_lower_d[
"drop"];
2493 Token BALANCE = as_lower_d[
"balance"];
2494 Token DURATION = as_lower_d[
"duration"];
2495 Token ADD = as_lower_d[
"add"];
2496 Token MODIFY = as_lower_d[
"modify"];
2497 Token USE = as_lower_d[
"use"];
2498 Token RENAME = as_lower_d[
"rename"];
2499 Token COLUMN = as_lower_d[
"column"];
2500 Token COLUMNS = as_lower_d[
"columns"];
2501 Token FAMILY = as_lower_d[
"family"];
2502 Token ALTER = as_lower_d[
"alter"];
2503 Token HELP = as_lower_d[
"help"];
2504 Token NAMESPACE = as_lower_d[
"namespace"];
2505 Token DATABASE = as_lower_d[
"database"];
2506 Token TABLE = as_lower_d[
"table"];
2507 Token TABLES = as_lower_d[
"tables"];
2508 Token TO = as_lower_d[
"to"];
2509 Token TTL = as_lower_d[
"ttl"];
2510 Token TYPE = as_lower_d[
"type"];
2511 Token COUNTER = as_lower_d[
"counter"];
2512 Token MONTHS = as_lower_d[
"months"];
2513 Token MONTH = as_lower_d[
"month"];
2514 Token WEEKS = as_lower_d[
"weeks"];
2515 Token WEEK = as_lower_d[
"week"];
2516 Token DAYS = as_lower_d[
"days"];
2517 Token DAY = as_lower_d[
"day"];
2518 Token HOURS = as_lower_d[
"hours"];
2519 Token HOUR = as_lower_d[
"hour"];
2520 Token MINUTES = as_lower_d[
"minutes"];
2521 Token MINUTE = as_lower_d[
"minute"];
2522 Token SECONDS = as_lower_d[
"seconds"];
2523 Token SECOND = as_lower_d[
"second"];
2524 Token IN_MEMORY = as_lower_d[
"in_memory"];
2525 Token BLOCKSIZE = as_lower_d[
"blocksize"];
2526 Token ACCESS = as_lower_d[
"access"];
2527 Token GROUP = as_lower_d[
"group"];
2528 Token
INDEX = as_lower_d[
"index"];
2529 Token
QUALIFIER = as_lower_d[
"qualifier"];
2530 Token DESCRIBE = as_lower_d[
"describe"];
2531 Token SHOW = as_lower_d[
"show"];
2532 Token GET = as_lower_d[
"get"];
2533 Token LISTING = as_lower_d[
"listing"];
2534 Token ESC_HELP = as_lower_d[
"\\h"];
2535 Token SELECT = as_lower_d[
"select"];
2536 Token STOP = as_lower_d[
"stop"];
2537 Token START_TIME = as_lower_d[
"start_time"];
2538 Token END_TIME = as_lower_d[
"end_time"];
2539 Token FROM = as_lower_d[
"from"];
2540 Token WHERE = as_lower_d[
"where"];
2541 Token REGEXP = as_lower_d[
"regexp"];
2542 Token ROW = as_lower_d[
"row"];
2543 Token CELL = as_lower_d[
"cell"];
2544 Token CELLS = as_lower_d[
"cells"];
2545 Token ROW_KEY_COLUMN = as_lower_d[
"row_key_column"];
2546 Token TIMESTAMP_COLUMN = as_lower_d[
"timestamp_column"];
2547 Token HEADER_FILE = as_lower_d[
"header_file"];
2548 Token ROW_UNIQUIFY_CHARS = as_lower_d[
"row_uniquify_chars"];
2549 Token IGNORE_UNKNOWN_CFS = as_lower_d[
"ignore_unknown_cfs"];
2552 Token DUPLICATE_KEY_COLUMNS = as_lower_d[
"duplicate_key_columns"];
2553 Token NO_TIMESTAMPS = as_lower_d[
"no_timestamps"];
2554 Token START_ROW = as_lower_d[
"start_row"];
2555 Token END_ROW = as_lower_d[
"end_row"];
2556 Token INCLUSIVE = as_lower_d[
"inclusive"];
2557 Token EXCLUSIVE = as_lower_d[
"exclusive"];
2558 Token MAX_VERSIONS = as_lower_d[
"max_versions"];
2559 Token REVS = as_lower_d[
"revs"];
2560 Token LIMIT = as_lower_d[
"limit"];
2561 Token CELL_LIMIT = as_lower_d[
"cell_limit"];
2562 Token CELL_LIMIT_PER_FAMILY = as_lower_d[
"cell_limit_per_family"];
2563 Token OFFSET = as_lower_d[
"offset"];
2564 Token CELL_OFFSET = as_lower_d[
"cell_offset"];
2565 Token INTO = as_lower_d[
"into"];
2566 Token FILE = as_lower_d[
"file"];
2567 Token LOAD = as_lower_d[
"load"];
2568 Token DATA = as_lower_d[
"data"];
2569 Token INFILE = as_lower_d[
"infile"];
2570 Token
TIMESTAMP = as_lower_d[
"timestamp"];
2571 Token TIME_ORDER = as_lower_d[
"time_order"];
2572 Token ASC = as_lower_d[
"asc"];
2573 Token DESC = as_lower_d[
"desc"];
2574 Token VERSION = as_lower_d[
"version"];
2575 Token INSERT = as_lower_d[
"insert"];
2576 Token DELETE = as_lower_d[
"delete"];
2577 Token VALUE = as_lower_d[
"value"];
2578 Token VALUES = as_lower_d[
"values"];
2579 Token COMPRESSOR = as_lower_d[
"compressor"];
2580 Token GROUP_COMMIT_INTERVAL = as_lower_d[
"group_commit_interval"];
2581 Token DUMP = as_lower_d[
"dump"];
2582 Token PSEUDO = as_lower_d[
"pseudo"];
2583 Token STATS = as_lower_d[
"stats"];
2584 Token STARTS = as_lower_d[
"starts"];
2585 Token WITH = as_lower_d[
"with"];
2586 Token IF = as_lower_d[
"if"];
2587 Token NOT = as_lower_d[
"not"];
2588 Token EXISTS = as_lower_d[
"exists"];
2589 Token DISPLAY_TIMESTAMPS = as_lower_d[
"display_timestamps"];
2590 Token DISPLAY_REVISIONS = as_lower_d[
"display_revisions"];
2591 Token RETURN_DELETES = as_lower_d[
"return_deletes"];
2592 Token SCAN_AND_FILTER_ROWS = as_lower_d[
"scan_and_filter_rows"];
2593 Token KEYS_ONLY = as_lower_d[
"keys_only"];
2594 Token
RANGE = as_lower_d[
"range"];
2595 Token UPDATE = as_lower_d[
"update"];
2596 Token SCANNER = as_lower_d[
"scanner"];
2597 Token
ON = as_lower_d[
"on"];
2598 Token DESTROY = as_lower_d[
"destroy"];
2599 Token FETCH = as_lower_d[
"fetch"];
2600 Token SCANBLOCK = as_lower_d[
"scanblock"];
2601 Token CLOSE = as_lower_d[
"close"];
2602 Token SHUTDOWN = as_lower_d[
"shutdown"];
2603 Token MASTER = as_lower_d[
"master"];
2604 Token REPLAY = as_lower_d[
"replay"];
2605 Token START = as_lower_d[
"start"];
2606 Token
COMMIT = as_lower_d[
"commit"];
2607 Token
LOG = as_lower_d[
"log"];
2608 Token BLOOMFILTER = as_lower_d[
"bloomfilter"];
2609 Token TRUE = as_lower_d[
"true"];
2610 Token FALSE = as_lower_d[
"false"];
2611 Token AND = as_lower_d[
"and"];
2612 Token OR = as_lower_d[
"or"];
2613 Token LIKE = as_lower_d[
"like"];
2614 Token NO_CACHE = as_lower_d[
"no_cache"];
2615 Token NOESCAPE = as_lower_d[
"noescape"];
2616 Token
NO_ESCAPE = as_lower_d[
"no_escape"];
2617 Token
NO_LOG = as_lower_d[
"no_log"];
2618 Token IDS = as_lower_d[
"ids"];
2619 Token NOKEYS = as_lower_d[
"nokeys"];
2621 Token BUCKETS = as_lower_d[
"buckets"];
2622 Token REPLICATION = as_lower_d[
"replication"];
2623 Token WAIT = as_lower_d[
"wait"];
2624 Token FOR = as_lower_d[
"for"];
2625 Token MAINTENANCE = as_lower_d[
"maintenance"];
2626 Token HEAPCHECK = as_lower_d[
"heapcheck"];
2627 Token ALGORITHM = as_lower_d[
"algorithm"];
2628 Token
COMPACT = as_lower_d[
"compact"];
2629 Token ALL = as_lower_d[
"all"];
2630 Token
ROOT = as_lower_d[
"root"];
2631 Token
METADATA = as_lower_d[
"metadata"];
2632 Token
SYSTEM = as_lower_d[
"system"];
2633 Token
USER = as_lower_d[
"user"];
2634 Token RANGES = as_lower_d[
"ranges"];
2635 Token MINOR = as_lower_d[
"minor"];
2636 Token MAJOR = as_lower_d[
"major"];
2637 Token MERGING = as_lower_d[
"merging"];
2638 Token GC = as_lower_d[
"gc"];
2639 Token FS = as_lower_d[
"fs"];
2640 Token SET = as_lower_d[
"set"];
2641 Token REBUILD = as_lower_d[
"rebuild"];
2642 Token INDICES = as_lower_d[
"indices"];
2643 Token STATUS = as_lower_d[
"status"];
2649 = lexeme_d[TRUE | FALSE]
2653 = lexeme_d[(alpha_p >> *(alnum_p |
'_')) - (keywords)];
2656 = single_string_literal
2657 | double_string_literal
2660 pseudo_table_reference
2661 = lexeme_d[
"^." >> +alnum_p >> *(
'.' >> +alnum_p)]
2665 = ch_p(
'(') >> ch_p(
')')
2668 single_string_literal
2669 = confix_p(SINGLEQUOTE, *lex_escape_ch_p, SINGLEQUOTE);
2671 double_string_literal
2672 = confix_p(DOUBLEQUOTE, *lex_escape_ch_p, DOUBLEQUOTE);
2680 = single_string_literal
2681 | double_string_literal
2685 = user_identifier >> *pseudo_table_reference
2689 = confix_p(SLASH, *lex_escape_ch_p , SLASH);
2695 | create_namespace_statement[
set_command(
self.state,
2698 | describe_table_statement[
set_command(
self.state,
2702 | help_statement[
set_help(
self.state)]
2716 | create_scanner_statement[
set_command(
self.state,
2718 | destroy_scanner_statement[
set_command(
self.state,
2720 | fetch_scanblock_statement[
set_command(
self.state,
2742 rebuild_indices_statement
2753 = SET >> set_variable_spec >> *(COMMA >> set_variable_spec )
2766 = COMPACT >> *(compact_type_option)
2768 >> *(string_literal[
set_str(
self.state)])
2769 | COMPACT >> *(compact_type_option) >> RANGES
2799 >> *(range_move_spec_list)
2800 >> *(balance_option_spec)
2803 range_move_spec_list
2810 >> range_spec >> COMMA
2811 >> string_literal[
set_source(
self.state)] >> COMMA
2820 drop_range_statement
2821 = DROP >> RANGE >> range_spec
2824 replay_start_statement
2828 replay_log_statement
2832 replay_commit_statement
2840 wait_for_maintenance_statement
2841 = WAIT >> FOR >> MAINTENANCE
2848 shutdown_master_statement
2849 = SHUTDOWN >> MASTER
2856 fetch_scanblock_statement
2857 = FETCH >> SCANBLOCK >> !(lexeme_d[(+digit_p)[
2861 destroy_scanner_statement
2862 = DESTROY >> SCANNER >> !(lexeme_d[(+digit_p)[
2866 create_scanner_statement
2867 = CREATE >> SCANNER >> ON >> range_spec
2877 load_range_statement
2878 = LOAD >> RANGE >> range_spec >> !(REPLAY[
set_replay(
self.state)])
2886 dump_table_option_spec
2895 dump_table_statement
2898 >> !(COLUMNS >> (
'*' | (column_selection >> *(COMMA >> column_selection))))
2899 >> !(dump_where_clause)
2900 >> *(dump_table_option_spec)
2903 dump_pseudo_table_statement
2904 = DUMP >> PSEUDO >> TABLE >> table_identifier[
set_table_name(
self.state)]
2912 >> (user_identifier | DOUBLEQUESTIONMARK)[
2916 drop_table_statement
2917 = DROP >> TABLE >> !(IF >> EXISTS[
set_if_exists(
self.state)])
2920 rename_table_statement
2927 alter_table_statement
2930 +(ADD >> create_definitions
2933 | drop_specification
2934 | RENAME >> COLUMN >> FAMILY >> rename_column_definition) )
2937 exists_table_statement
2941 get_listing_statement
2946 = DELETE >> delete_column_clause
2948 >> WHERE >> ROW >> EQUAL >> string_literal[
2954 delete_column_clause
2962 >> VALUES >> insert_value_list
2998 = (SHOW >> CREATE >> TABLE >> user_identifier[
set_table_name(
self.state)])
3002 = (HELP | ESC_HELP | QUESTIONMARK) >> *anychar_p
3005 describe_table_statement
3006 = DESCRIBE >> TABLE >> !(WITH >> IDS[
set_with_ids(
self.state)])
3010 create_table_statement
3015 (create_definitions) >> *(table_option) )
3018 create_namespace_statement
3019 = CREATE >> (NAMESPACE | DATABASE)
3024 use_namespace_statement
3028 drop_namespace_statement
3029 = DROP >> (NAMESPACE | DATABASE) >> !(IF >> EXISTS[
set_if_exists(
self.state)])
3035 | access_group_option
3040 = LPAREN >> create_definition
3041 >> *(COMMA >> create_definition)
3055 | DROP >> *VALUE >> INDEX >> LPAREN
3059 | DROP >> QUALIFIER >> INDEX >> LPAREN
3065 rename_column_definition
3072 modify_column_definitions
3079 modify_column_definition
3084 = (identifier | string_literal)
3092 = max_versions_option
3099 = (MAX_VERSIONS | REVS) >> *EQUAL
3109 = TTL >> *EQUAL >> duration[
set_ttl(
self.state)]
3113 = COUNTER >> boolean_literal[
set_counter(
self.state)]
3118 = ureal_p >> !(MONTHS | MONTH | WEEKS | WEEK | DAYS | DAY | HOURS |
3119 HOUR | MINUTES | MINUTE | SECONDS | SECOND)
3122 access_group_definition
3129 >> *(access_group_option | column_option)
3133 = QUALIFIER >> INDEX
3142 | replication_option
3143 | COMPRESSOR >> *EQUAL >> string_literal[
3145 | bloom_filter_option
3149 = BLOOMFILTER >> *EQUAL
3159 = BLOCKSIZE >> *EQUAL >> uint_p[
3164 = REPLICATION >> *EQUAL >> uint_p[
3169 = SELECT >> !(CELLS)
3170 >> (
'*' | (column_selection >> *(COMMA >> column_selection)))
3200 >> dump_where_predicate
3215 TIMESTAMP >> relop >> string_literal[
scan_set_time(
self.state)]
3219 = !(string_literal[
scan_set_row(
self.state)] >> relop) >>
3220 ROW >> relop >> string_literal[
scan_set_row(
self.state)]
3236 = !(cell_spec >> relop) >> CELL >> relop >> cell_spec
3241 | LPAREN >> cell_interval >> *( OR >> cell_interval ) >> RPAREN
3250 >> !column_qualifier_spec
3254 >> !column_qualifier_spec
3258 >> !column_qualifier_spec
3263 >> !column_qualifier_spec
3269 >> column_qualifier_spec
3273 column_qualifier_spec
3292 dump_where_predicate
3338 uint_parser<unsigned int, 10, 2, 2> uint2_p;
3339 uint_parser<unsigned int, 10, 4, 4> uint4_p;
3342 = lexeme_d[limit_d(0u, 9999u)[uint4_p[
scan_set_year(
self.state)]]
3362 = lexeme_d[limit_d(0u, 9999u)[uint4_p[
scan_set_year(
self.state)]]]
3366 = LOAD >> DATA >> INFILE
3367 >> !(load_data_option >> *(load_data_option))
3379 = ROW_KEY_COLUMN >> EQUAL >> user_identifier[
3380 add_column(
self.state)] >> *(PLUS >> user_identifier[
3382 | TIMESTAMP_COLUMN >> EQUAL >> user_identifier[
3384 | HEADER_FILE >> EQUAL >> string_literal[
3386 | ROW_UNIQUIFY_CHARS >> EQUAL >> uint_p[
3388 | DUP_KEY_COLS >> EQUAL >> boolean_literal[
3405 #ifdef BOOST_SPIRIT_DEBUG
3406 BOOST_SPIRIT_DEBUG_RULE(column_definition);
3407 BOOST_SPIRIT_DEBUG_RULE(column_name);
3408 BOOST_SPIRIT_DEBUG_RULE(column_option);
3409 BOOST_SPIRIT_DEBUG_RULE(column_match);
3410 BOOST_SPIRIT_DEBUG_RULE(column_predicate);
3411 BOOST_SPIRIT_DEBUG_RULE(column_qualifier_spec);
3412 BOOST_SPIRIT_DEBUG_RULE(column_selection);
3413 BOOST_SPIRIT_DEBUG_RULE(create_definition);
3414 BOOST_SPIRIT_DEBUG_RULE(create_definitions);
3415 BOOST_SPIRIT_DEBUG_RULE(drop_specification);
3416 BOOST_SPIRIT_DEBUG_RULE(rename_column_definition);
3417 BOOST_SPIRIT_DEBUG_RULE(modify_column_definitions);
3418 BOOST_SPIRIT_DEBUG_RULE(modify_column_definition);
3419 BOOST_SPIRIT_DEBUG_RULE(create_table_statement);
3420 BOOST_SPIRIT_DEBUG_RULE(create_namespace_statement);
3421 BOOST_SPIRIT_DEBUG_RULE(use_namespace_statement);
3422 BOOST_SPIRIT_DEBUG_RULE(drop_namespace_statement);
3423 BOOST_SPIRIT_DEBUG_RULE(duration);
3424 BOOST_SPIRIT_DEBUG_RULE(identifier);
3425 BOOST_SPIRIT_DEBUG_RULE(user_identifier);
3426 BOOST_SPIRIT_DEBUG_RULE(max_versions_option);
3427 BOOST_SPIRIT_DEBUG_RULE(time_order_option);
3428 BOOST_SPIRIT_DEBUG_RULE(statement);
3429 BOOST_SPIRIT_DEBUG_RULE(string_literal);
3430 BOOST_SPIRIT_DEBUG_RULE(parameter_list);
3431 BOOST_SPIRIT_DEBUG_RULE(single_string_literal);
3432 BOOST_SPIRIT_DEBUG_RULE(double_string_literal);
3433 BOOST_SPIRIT_DEBUG_RULE(regexp_literal);
3434 BOOST_SPIRIT_DEBUG_RULE(ttl_option);
3435 BOOST_SPIRIT_DEBUG_RULE(counter_option);
3436 BOOST_SPIRIT_DEBUG_RULE(access_group_definition);
3437 BOOST_SPIRIT_DEBUG_RULE(index_definition);
3438 BOOST_SPIRIT_DEBUG_RULE(access_group_option);
3439 BOOST_SPIRIT_DEBUG_RULE(bloom_filter_option);
3440 BOOST_SPIRIT_DEBUG_RULE(in_memory_option);
3441 BOOST_SPIRIT_DEBUG_RULE(blocksize_option);
3442 BOOST_SPIRIT_DEBUG_RULE(replication_option);
3443 BOOST_SPIRIT_DEBUG_RULE(help_statement);
3444 BOOST_SPIRIT_DEBUG_RULE(describe_table_statement);
3445 BOOST_SPIRIT_DEBUG_RULE(show_statement);
3446 BOOST_SPIRIT_DEBUG_RULE(select_statement);
3447 BOOST_SPIRIT_DEBUG_RULE(where_clause);
3448 BOOST_SPIRIT_DEBUG_RULE(where_predicate);
3449 BOOST_SPIRIT_DEBUG_RULE(time_predicate);
3450 BOOST_SPIRIT_DEBUG_RULE(cell_interval);
3451 BOOST_SPIRIT_DEBUG_RULE(cell_predicate);
3452 BOOST_SPIRIT_DEBUG_RULE(cell_spec);
3453 BOOST_SPIRIT_DEBUG_RULE(relop);
3454 BOOST_SPIRIT_DEBUG_RULE(row_interval);
3455 BOOST_SPIRIT_DEBUG_RULE(row_predicate);
3456 BOOST_SPIRIT_DEBUG_RULE(value_predicate);
3457 BOOST_SPIRIT_DEBUG_RULE(option_spec);
3458 BOOST_SPIRIT_DEBUG_RULE(unused_tokens);
3459 BOOST_SPIRIT_DEBUG_RULE(datetime);
3460 BOOST_SPIRIT_DEBUG_RULE(date);
3461 BOOST_SPIRIT_DEBUG_RULE(time);
3462 BOOST_SPIRIT_DEBUG_RULE(year);
3463 BOOST_SPIRIT_DEBUG_RULE(load_data_statement);
3464 BOOST_SPIRIT_DEBUG_RULE(load_data_input);
3465 BOOST_SPIRIT_DEBUG_RULE(load_data_option);
3466 BOOST_SPIRIT_DEBUG_RULE(insert_statement);
3467 BOOST_SPIRIT_DEBUG_RULE(insert_value_list);
3468 BOOST_SPIRIT_DEBUG_RULE(insert_value);
3469 BOOST_SPIRIT_DEBUG_RULE(delete_statement);
3470 BOOST_SPIRIT_DEBUG_RULE(delete_column_clause);
3471 BOOST_SPIRIT_DEBUG_RULE(table_option);
3472 BOOST_SPIRIT_DEBUG_RULE(get_listing_statement);
3473 BOOST_SPIRIT_DEBUG_RULE(drop_table_statement);
3474 BOOST_SPIRIT_DEBUG_RULE(rename_table_statement);
3475 BOOST_SPIRIT_DEBUG_RULE(alter_table_statement);
3476 BOOST_SPIRIT_DEBUG_RULE(exists_table_statement);
3477 BOOST_SPIRIT_DEBUG_RULE(load_range_statement);
3478 BOOST_SPIRIT_DEBUG_RULE(dump_statement);
3479 BOOST_SPIRIT_DEBUG_RULE(dump_where_clause);
3480 BOOST_SPIRIT_DEBUG_RULE(dump_where_predicate);
3481 BOOST_SPIRIT_DEBUG_RULE(dump_table_option_spec);
3482 BOOST_SPIRIT_DEBUG_RULE(dump_table_statement);
3483 BOOST_SPIRIT_DEBUG_RULE(dump_pseudo_table_statement);
3484 BOOST_SPIRIT_DEBUG_RULE(range_spec);
3485 BOOST_SPIRIT_DEBUG_RULE(update_statement);
3486 BOOST_SPIRIT_DEBUG_RULE(create_scanner_statement);
3487 BOOST_SPIRIT_DEBUG_RULE(destroy_scanner_statement);
3488 BOOST_SPIRIT_DEBUG_RULE(fetch_scanblock_statement);
3489 BOOST_SPIRIT_DEBUG_RULE(close_statement);
3490 BOOST_SPIRIT_DEBUG_RULE(shutdown_statement);
3491 BOOST_SPIRIT_DEBUG_RULE(shutdown_master_statement);
3492 BOOST_SPIRIT_DEBUG_RULE(status_statement);
3493 BOOST_SPIRIT_DEBUG_RULE(drop_range_statement);
3494 BOOST_SPIRIT_DEBUG_RULE(replay_start_statement);
3495 BOOST_SPIRIT_DEBUG_RULE(replay_log_statement);
3496 BOOST_SPIRIT_DEBUG_RULE(replay_commit_statement);
3497 BOOST_SPIRIT_DEBUG_RULE(balance_statement);
3498 BOOST_SPIRIT_DEBUG_RULE(balance_option_spec);
3499 BOOST_SPIRIT_DEBUG_RULE(range_move_spec_list);
3500 BOOST_SPIRIT_DEBUG_RULE(range_move_spec);
3501 BOOST_SPIRIT_DEBUG_RULE(heapcheck_statement);
3502 BOOST_SPIRIT_DEBUG_RULE(compact_statement);
3503 BOOST_SPIRIT_DEBUG_RULE(compact_type_option);
3504 BOOST_SPIRIT_DEBUG_RULE(compaction_type);
3505 BOOST_SPIRIT_DEBUG_RULE(metadata_sync_statement);
3506 BOOST_SPIRIT_DEBUG_RULE(metadata_sync_option_spec);
3507 BOOST_SPIRIT_DEBUG_RULE(stop_statement);
3508 BOOST_SPIRIT_DEBUG_RULE(range_type);
3509 BOOST_SPIRIT_DEBUG_RULE(table_identifier);
3510 BOOST_SPIRIT_DEBUG_RULE(pseudo_table_reference);
3511 BOOST_SPIRIT_DEBUG_RULE(dump_pseudo_table_statement);
3512 BOOST_SPIRIT_DEBUG_RULE(set_statement);
3513 BOOST_SPIRIT_DEBUG_RULE(set_variable_spec);
3514 BOOST_SPIRIT_DEBUG_RULE(rebuild_indices_statement);
3515 BOOST_SPIRIT_DEBUG_RULE(index_type_spec);
3519 rule<ScannerT>
const&
3524 rule<ScannerT> boolean_literal, column_definition, column_name,
3525 column_option, create_definition, create_definitions,
3527 rename_column_definition, create_table_statement, duration,
3528 modify_column_definitions, modify_column_definition,
3529 create_namespace_statement, use_namespace_statement,
3530 drop_namespace_statement, identifier, user_identifier,
3531 max_versions_option, time_order_option, statement,
3532 single_string_literal, double_string_literal, string_literal,
3533 parameter_list, regexp_literal, ttl_option, counter_option,
3534 access_group_definition, index_definition, access_group_option,
3535 bloom_filter_option, in_memory_option,
3536 blocksize_option, replication_option, help_statement,
3537 describe_table_statement, show_statement, select_statement,
3538 where_clause, where_predicate,
3539 time_predicate, relop, row_interval, row_predicate, column_match,
3540 column_predicate, column_qualifier_spec, value_predicate, column_selection,
3541 option_spec, unused_tokens, datetime, date, time,
year,
3542 load_data_statement, load_data_input, load_data_option, insert_statement,
3543 insert_value_list, insert_value, delete_statement,
3544 delete_column_clause, table_option, table_option_in_memory,
3545 table_option_blocksize, table_option_replication, get_listing_statement,
3546 drop_table_statement, alter_table_statement,rename_table_statement,
3547 load_range_statement,
3548 dump_statement, dump_where_clause, dump_where_predicate,
3549 dump_table_statement, dump_table_option_spec, range_spec,
3550 exists_table_statement, update_statement, create_scanner_statement,
3551 destroy_scanner_statement, fetch_scanblock_statement,
3552 close_statement, shutdown_statement, shutdown_master_statement,
3553 drop_range_statement, replay_start_statement, replay_log_statement,
3554 replay_commit_statement, cell_interval, cell_predicate,
3555 cell_spec, wait_for_maintenance_statement, move_range_statement,
3556 balance_statement, range_move_spec_list, range_move_spec,
3557 balance_option_spec, heapcheck_statement, compact_statement,
3558 compact_type_option, compaction_type,
3559 metadata_sync_statement, metadata_sync_option_spec, stop_statement,
3560 range_type, table_identifier, pseudo_table_reference,
3561 dump_pseudo_table_statement, set_statement, set_variable_spec,
3562 rebuild_indices_statement, index_type_spec, status_statement;
3570 #endif // Hypertable_Lib_HqlParser_h
void set_id(int32_t id)
Sets column ID.
std::map< std::string, AccessGroupSpec * > modified_ag_map
void set_end_time(::int64_t end)
void operator()(char const *str, char const *end) const
add_column(ParserState &state)
set_str(ParserState &state)
scan_set_column_predicate_name(ParserState &state)
close_column_family(ParserState &state)
void operator()(char const *str, char const *end) const
scan_set_cell_row(ParserState &state)
set_counter(ParserState &state)
std::string current_rename_column_old_name
set_delete_timestamp(ParserState &state)
scan_set_seconds(ParserState &state)
scan_set_row_offset(ParserState &state)
std::vector< ColumnFamilySpec * > modified_cf_vector
void operator()(char const *str, char const *end) const
void operator()(size_t duration) const
ColumnFamilySpec * get_new_column_family(const std::string &name)
add_range_move_spec(ParserState &state)
scan_set_cell_limit_per_family(ParserState &state)
set_range_end_row(ParserState &state)
open_existing_column_family(ParserState &state)
scan_set_boolop(ParserState &state, int boolop)
set_max_versions(ParserState &state)
scan_set_cell_column(ParserState &state)
void operator()(char const *str, char const *end) const
set_blocksize(ParserState &state)
std::string String
A String is simply a typedef to std::string.
bool invalid_column_name(const std::string &name)
bool get_option_counter() const
Gets the counter option.
void operator()(char const *str, char const *end) const
set_rename_column_family_old_name(ParserState &state)
set_new_table_name(ParserState &state)
scan_set_row_limit(ParserState &state)
void operator()(char const *str, char const *end) const
scan_set_decimal_seconds(ParserState &state)
void operator()(char const *str, char const *end) const
void operator()(char const *str, char const *end) const
String format(const char *fmt,...)
Returns a String using printf like format facilities Vanilla snprintf is about 1.5x faster than this...
bool get_option_time_order_desc() const
Gets time order desc option.
std::vector< AccessGroupSpec * > modified_ag_vector
void operator()(char const *str, char const *end) const
static const uint32_t FLAG_INSERT
void operator()(char const *str, char const *end) const
ParserState(NamespacePtr &ns)
void operator()(char const *str, char const *end) const
void operator()(char const *str, char const *end) const
void operator()(char const *str, char const *end) const
Declarations for SystemVariable.
start_create_table_statement(ParserState &state)
void set_end(const std::string &s, bool inclusive)
std::string timestamp_column
drop_qualifier_index(ParserState &state)
set_variable_value(ParserState &state)
set_clone_table_name(ParserState &state)
scan_set_keys_only(ParserState &state)
void operator()(char const *str, char const *end) const
Po::typed_value< String > * str(String *v=0)
std::map< std::string, ColumnFamilySpec * > modified_cf_map
bool get_value_index() const
Gets value index flag.
Column family specification.
std::string current_column_predicate_qualifier
scan_set_scan_and_filter_rows(ParserState &state)
void set_qualifier_index(bool value)
Sets qualifier index flag.
const char * column_qualifier
void validate_function(const std::string &s)
set_insert_columnkey(ParserState &state)
set_help(ParserState &state)
Specification for column family options.
scan_add_column_family(ParserState &state, int qualifier_flag=0)
std::map< std::string, AccessGroupSpec * > new_ag_map
scan_set_value_regexp(ParserState &state)
set_balance_algorithm(ParserState &state)
set_range_start_row(ParserState &state)
scan_set_outfile(ParserState &state)
scan_set_max_versions(ParserState &state)
static void initialize_tm(struct tm *tmval)
Initialize struct tm.
void operator()(char const *str, char const *end) const
void operator()(char const *str, char const *end) const
open_access_group(ParserState &state)
std::string current_cell_column
void operator()(char const *str, char const *end) const
ColumnFamilyOptions table_cf_defaults
set_rangeserver(ParserState &state)
add_insert_value(ParserState &state)
void operator()(char const *str, char const *end) const
void operator()(int ival) const
void operator()(char const *str, char const *end) const
void operator()(char const *str, char const *end) const
void operator()(char const *str, char const *end) const
void operator()(const char c) const
Specification for access group options.
void operator()(int ival) const
scan_set_row(ParserState &state)
set_if_exists(ParserState &state)
scan_set_display_timestamps(ParserState &state)
String generate_guid()
Generates a new GUID.
void operator()(int ival) const
std::vector< ColumnFamilySpec * > new_cf_vector
#define HQL_DEBUG(_expr_)
int string_to_code(const std::string &var_string)
Converts variable string to variable code.
set_insert_rowkey_call(ParserState &state)
void operator()(char const *str, char const *end) const
std::shared_ptr< Namespace > NamespacePtr
Shared smart pointer to Namespace.
void operator()(char const *str, char const *end) const
std::string pseudo_table_name
scan_set_cell_offset(ParserState &state)
void operator()(char const *str, char const *end) const
void set_value_index(bool value)
Sets value index flag.
#define HQL_DEBUG_VAL(str, val)
void operator()(const char c) const
set_insert_value(ParserState &state)
finish_alter_table_statement(ParserState &state)
Declarations for RangeServerProtocol.
void operator()(const char c) const
void operator()(size_t interval) const
std::map< std::string, ColumnFamilySpec * > new_cf_map
void operator()(size_t replication) const
scan_set_year(ParserState &state)
void operator()(char const *str, char const *end) const
File system utility functions.
void set_start(const std::string &s, bool inclusive)
void operator()(char const *str, char const *end) const
set_command(ParserState &state, int cmd)
void operator()(char c) const
set_compressor(ParserState &state)
std::string current_rowkey
void operator()(char const *, char const *) const
set_insert_rowkey(ParserState &state)
void operator()(char const *str, char const *end) const
set_variable_name(ParserState &state)
delete_column(ParserState &state)
void operator()(char const *str, char const *end) const
std::string strip_quotes(const char *str, size_t len)
Creates string with outer quotes stripped off.
void check_and_set_column_option(const std::string &name, const std::string &option)
std::string current_column_family
void execute_all_functions(InsertRecord &rec)
void operator()(char const *str, char const *end) const
std::vector< String > columns
set_delete_version_timestamp(ParserState &state)
set_output_file(ParserState &state)
bool get_qualifier_index() const
Gets qualifier index flag.
set_insert_value_call(ParserState &state)
void operator()(char const *str, char const *end) const
AccessGroupSpec * create_modified_access_group(const std::string &name)
void operator()(char const *str, char const *end) const
std::string regex_from_literal(const char *str, size_t len)
Logging routines and macros.
void operator()(char const *str, char const *end) const
void escape(String &str, const String &escape_chars)
Escapes a string.
set_dup_key_cols(ParserState &state)
void operator()(int ival) const
set_in_memory(ParserState &state)
void operator()(int ival) const
void operator()(char const *str, char const *end) const
set_with_ids(ParserState &state)
finish_create_table_statement(ParserState &state)
void operator()(char const *str, char const *end) const
std::string current_cell_row
void operator()(char const *str, char const *end) const
const std::string & get_access_group() const
Gets access group name.
access_group_add_column_family(ParserState &state)
void operator()(char const *str, char const *end) const
set_table_name(ParserState &state)
Helper class for building a ScanSpec.
void operator()(char const *str, char const *end) const
ColumnFamilySpec * find_column_family_in_modified_ag(const std::string &name)
void operator()(char const *, char const *) const
void operator()(int ival) const
ColumnFamilySpec * get_modified_column_family(const std::string &name)
set_modify_flag(ParserState &state, bool val)
void operator()(const char *str, const char *end) const
void set_time_interval(::int64_t start,::int64_t end)
void operator()(char const *str, char const *end) const
AccessGroupSpec * find_modified_access_group(const std::string &name)
void operator()(char const *str, char const *end) const
set_field_separator(ParserState &state)
void operator()(char const *str, char const *end) const
void operator()(char const *str, char const *end) const
scan_set_nanoseconds(ParserState &state)
void operator()(char const *str, char const *end) const
void operator()(char const *str, char const *end) const
void operator()(char const *str, char const *end) const
std::string range_start_row
AccessGroupOptions table_ag_defaults
void operator()(char const *str, char const *end) const
Holds a variable code and boolean value.
void operator()(char const *str, char const *end) const
SystemVariable::Spec current_variable_spec
void operator()(char const *str, char const *end) const
Time related declarations.
set_timestamp_column(ParserState &state)
static bool expand_tilde(String &fname)
Expands a leading tilde character in a filename.
Parser(ParserState &state)
int64_t parse_ts(const char *ts)
Inline function which parses a string with a timestamp in localtime and returns a 64bit nanosecond ti...
set_rename_column_family_new_name(ParserState &state)
void operator()(char const *str, char const *end) const
Access group specification.
void operator()(char const *str, char const *end) const
scan_set_minutes(ParserState &state)
void operator()(char c) const
scan_add_row_interval(ParserState &state)
std::string clone_table_name
std::string new_table_name
static Schema * new_instance(const std::string &buf)
Creates schema object from XML schema string.
drop_column_family(ParserState &state)
void operator()(char const *str, char const *end) const
const std::string & get_name() const
Gets column family name.
scan_set_column_predicate_operation(ParserState &state, uint32_t operation)
An inline helper function to parse timestamps in YYYY-mm-dd[ HH:MM[:SS[.SS|:NS]]] format...
void operator()(char const *str, char const *end) const
#define LOG(_lvl_, _fmt_,...)
scan_set_time(ParserState &state)
void operator()(char const *str, char const *end) const
const bool ON
Constant representing on
void operator()(char const *str, char const *end) const
void operator()(char const *str, char const *end) const
void operator()(int ival) const
void operator()(char const *str, char const *end) const
std::set< std::string > new_cf
scan_set_cell_limit(ParserState &state)
set_flags_range_type(ParserState &state)
void operator()(char const *str, char const *end) const
scan_set_relop(ParserState &state, int relop)
void operator()(char const *, char const *) const
void operator()(int ival) const
set_dup_key_cols_true(ParserState &state)
void operator()(char const *str, char const *end) const
void operator()(char const *str, char const *end) const
void operator()(char const *str, char const *end) const
void operator()(char const *str, char const *end) const
set_flags_index_type(ParserState &state)
void operator()(char const *str, char const *end) const
void operator()(size_t blocksize) const
void operator()(char const *str, char const *end) const
InsertRecord current_insert_value
void operator()(char const *str, char const *end) const
void set_access_group(const std::string &ag)
Sets access group.
const char * column_family
scan_set_display_revisions(ParserState &state)
set_replay(ParserState &state)
scan_set_buckets(ParserState &state)
#define HT_THROWF(_code_, _fmt_,...)
Provides access to internal components of opaque key.
void operator()(int ival) const
open_column_family(ParserState &state)
scan_set_day(ParserState &state)
set_group_commit_interval(ParserState &state)
void operator()(char const *str, char const *end) const
set_destination(ParserState &state)
set_flags_compaction_type(ParserState &state)
AccessGroupSpec * find_new_access_group(const std::string &name)
void operator()(int ival) const
set_ttl(ParserState &state)
close_access_group(ParserState &state)
definition(Parser const &self)
void operator()(char const *str, char const *end) const
scan_set_column_predicate_qualifier(ParserState &state, uint32_t operation)
rule< ScannerT > const & start() const
void operator()(char const *str, char const *end) const
void check_and_set_access_group_option(const std::string &name, const std::string &option)
std::set< std::string > access_group_option_definition_set
void operator()(double dval) const
std::vector< String > delete_columns
create_qualifier_index(ParserState &state)
scan_set_row_regexp(ParserState &state)
void operator()(char const *str, char const *end) const
void operator()(char const *str, char const *end) const
void set_start_time(::int64_t start)
set_nokeys(ParserState &state)
void operator()(char const *str, char const *end) const
scan_add_column_qualifier(ParserState &state, int _qualifier_flag=0)
std::shared_ptr< RangeMoveSpec > RangeMoveSpecPtr
create_index(ParserState &state)
void operator()(int ival) const
std::string current_column_predicate_name
AccessGroupSpec * create_new_access_group(const std::string &name)
void operator()(char const *str, char const *end) const
set_scanner_id(ParserState &state)
void operator()(char const *str, char const *end) const
void operator()(int nchars) const
scan_set_column_predicate_value(ParserState &state, uint32_t operation=0)
std::shared_ptr< Schema > SchemaPtr
Smart pointer to Schema.
delete_set_row(ParserState &state)
void operator()(int ival) const
static const int64_t AUTO_ASSIGN
scan_set_hours(ParserState &state)
void operator()(char const *str, char const *end) const
set_namespace(ParserState &state)
set_time_order(ParserState &state)
set_replication(ParserState &state)
void operator()(char const *str, char const *end) const
void operator()(int ival) const
set_bloom_filter(ParserState &state)
balance_set_duration(ParserState &state)
scan_set_return_deletes(ParserState &state)
scan_clear_display_timestamps(ParserState &state)
void operator()(char const *str, char const *end) const
void operator()(char const *str, char const *end) const
Encapsulates decomposed key and value.
void operator()(char const *str, char const *end) const
std::set< std::string > column_option_definition_set
void operator()(char const *str, char const *end) const
set_no_log(ParserState &state)
void operator()(char const *str, char const *end) const
void set_start(const std::string &row, const std::string &column, bool inclusive)
void operator()(char const *str, char const *end) const
std::vector< AccessGroupSpec * > new_ag_vector
Error codes, Exception handling, error logging.
#define HT_THROW(_code_, _msg_)
void add_column(ColumnFamilySpec *cf)
Adds column family specification.
void operator()(char c) const
static const char * END_ROW_MARKER
set_tables_only(ParserState &state)
void operator()(char const *str, char const *end) const
set_source(ParserState &state)
std::string range_end_row
set_insert_timestamp(ParserState &state)
void operator()(char const *str, char const *end) const
start_alter_table(ParserState &state)
scan_set_month(ParserState &state)
void operator()(char const *str, char const *end) const
scan_set_no_cache(ParserState &state)
void operator()(char const *str, char const *end) const
set_ignore_unknown_cfs(ParserState &state)
set_row_uniquify_chars(ParserState &state)
void execute_function(std::string &s)
void set_end(const std::string &row, const std::string &column, bool inclusive)
set_noescape(ParserState &state)
std::vector< SystemVariable::Spec > variable_specs
Declarations for TableParts.
void operator()(int ival) const
void operator()(char const *str, char const *end) const
void operator()(char const *str, char const *end) const
void operator()(char const *str, char const *end) const
void operator()(char const *str, char const *end) const
void operator()(char const *str, char const *end) const
drop_value_index(ParserState &state)