1
0
Fork 0

decapitalize json in late materialization (#10610)

This commit is contained in:
Iurii Popov 2019-12-03 11:35:32 +01:00 committed by Andrey Abramov
parent 56d4610dca
commit 77f08b2ec7
4 changed files with 23 additions and 23 deletions

View File

@ -663,7 +663,7 @@ const char* NODE_OPTIONS_PARAM = "options";
const char* NODE_VOLATILITY_PARAM = "volatility";
const char* NODE_PRIMARY_SORT_PARAM = "primarySort";
const char* NODE_PRIMARY_SORT_BUCKETS_PARAM = "primarySortBuckets";
const char* NODE_VIEW_VALUES_VARS = "ViewValuesVars";
const char* NODE_VIEW_VALUES_VARS = "viewValuesVars";
const char* NODE_VIEW_VALUES_VAR_FIELD_NUMBER = "fieldNumber";
const char* NODE_VIEW_VALUES_VAR_ID = "id";
const char* NODE_VIEW_VALUES_VAR_NAME = "name";
@ -924,7 +924,7 @@ IResearchViewNode::IResearchViewNode(aql::ExecutionPlan& plan, velocypack::Slice
auto const viewValuesVarsSlice = base.get(NODE_VIEW_VALUES_VARS);
if (!viewValuesVarsSlice.isArray()) {
THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_BAD_PARAMETER,
"\"ViewValuesVars\" attribute should be an array");
"\"viewValuesVars\" attribute should be an array");
}
std::unordered_map<size_t, aql::Variable const*> viewValuesVars;
viewValuesVars.reserve(viewValuesVarsSlice.length());
@ -932,7 +932,7 @@ IResearchViewNode::IResearchViewNode(aql::ExecutionPlan& plan, velocypack::Slice
auto const fieldNumberSlice = indVar.get(NODE_VIEW_VALUES_VAR_FIELD_NUMBER);
if (!fieldNumberSlice.isNumber<size_t>()) {
THROW_ARANGO_EXCEPTION_FORMAT(
TRI_ERROR_BAD_PARAMETER, "\"ViewValuesVars[*].fieldNumber\" %s should be a number",
TRI_ERROR_BAD_PARAMETER, "\"viewValuesVars[*].fieldNumber\" %s should be a number",
fieldNumberSlice.toString().c_str());
}
auto const fieldNumber = fieldNumberSlice.getNumber<size_t>();
@ -940,7 +940,7 @@ IResearchViewNode::IResearchViewNode(aql::ExecutionPlan& plan, velocypack::Slice
auto const varIdSlice = indVar.get(NODE_VIEW_VALUES_VAR_ID);
if (!varIdSlice.isNumber<aql::VariableId>()) {
THROW_ARANGO_EXCEPTION_FORMAT(
TRI_ERROR_BAD_PARAMETER, "\"ViewValuesVars[*].id\" variable id %s should be a number",
TRI_ERROR_BAD_PARAMETER, "\"viewValuesVars[*].id\" variable id %s should be a number",
varIdSlice.toString().c_str());
}
@ -949,7 +949,7 @@ IResearchViewNode::IResearchViewNode(aql::ExecutionPlan& plan, velocypack::Slice
if (!var) {
THROW_ARANGO_EXCEPTION_FORMAT(
TRI_ERROR_BAD_PARAMETER, "\"ViewValuesVars[*].id\" unable to find variable by id %d",
TRI_ERROR_BAD_PARAMETER, "\"viewValuesVars[*].id\" unable to find variable by id %d",
varId);
}
viewValuesVars.emplace(fieldNumber, var);

View File

@ -130,10 +130,10 @@ IndexNode::IndexNode(ExecutionPlan* plan, arangodb::velocypack::Slice const& bas
auto const indexId = indexIdSlice.getNumber<TRI_idx_iid_t>();
auto const indexValuesVarsSlice = base.get("IndexValuesVars");
auto const indexValuesVarsSlice = base.get("indexValuesVars");
if (!indexValuesVarsSlice.isArray()) {
THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_BAD_PARAMETER,
"\"IndexValuesVars\" attribute should be an array");
"\"indexValuesVars\" attribute should be an array");
}
std::unordered_map<size_t, Variable const*> indexValuesVars;
indexValuesVars.reserve(indexValuesVarsSlice.length());
@ -141,7 +141,7 @@ IndexNode::IndexNode(ExecutionPlan* plan, arangodb::velocypack::Slice const& bas
auto const fieldNumberSlice = indVar.get("fieldNumber");
if (!fieldNumberSlice.isNumber<size_t>()) {
THROW_ARANGO_EXCEPTION_FORMAT(
TRI_ERROR_BAD_PARAMETER, "\"IndexValuesVars[*].fieldNumber\" %s should be a number",
TRI_ERROR_BAD_PARAMETER, "\"indexValuesVars[*].fieldNumber\" %s should be a number",
fieldNumberSlice.toString().c_str());
}
auto const fieldNumber = fieldNumberSlice.getNumber<size_t>();
@ -149,7 +149,7 @@ IndexNode::IndexNode(ExecutionPlan* plan, arangodb::velocypack::Slice const& bas
auto const varIdSlice = indVar.get("id");
if (!varIdSlice.isNumber<aql::VariableId>()) {
THROW_ARANGO_EXCEPTION_FORMAT(
TRI_ERROR_BAD_PARAMETER, "\"IndexValuesVars[*].id\" variable id %s should be a number",
TRI_ERROR_BAD_PARAMETER, "\"indexValuesVars[*].id\" variable id %s should be a number",
varIdSlice.toString().c_str());
}
@ -158,7 +158,7 @@ IndexNode::IndexNode(ExecutionPlan* plan, arangodb::velocypack::Slice const& bas
if (!var) {
THROW_ARANGO_EXCEPTION_FORMAT(
TRI_ERROR_BAD_PARAMETER, "\"IndexValuesVars[*].id\" unable to find variable by id %d",
TRI_ERROR_BAD_PARAMETER, "\"indexValuesVars[*].id\" unable to find variable by id %d",
varId);
}
indexValuesVars.emplace(fieldNumber, var);
@ -294,7 +294,7 @@ void IndexNode::toVelocyPackHelper(VPackBuilder& builder, unsigned flags,
});
TRI_ASSERT(indIt != _indexes.cend());
auto const& fields = (*indIt)->fields();
VPackArrayBuilder arrayScope(&builder, "IndexValuesVars");
VPackArrayBuilder arrayScope(&builder, "indexValuesVars");
for (auto const& indVar : _outNonMaterializedIndVars.second) {
VPackObjectBuilder objectScope(&builder);
builder.add("fieldNumber", VPackValue(indVar.first));

View File

@ -281,7 +281,7 @@ TEST_F(IndexNodeTest, constructIndexNode) {
// correct json
auto createJson = arangodb::velocypack::Parser::fromJson(
"{"
" \"IndexValuesVars\" : ["
" \"indexValuesVars\" : ["
" {"
" \"fieldNumber\" : 2,"
" \"id\" : 6,"
@ -553,7 +553,7 @@ TEST_F(IndexNodeTest, invalidLateMaterializedJSON) {
{
auto createJson = arangodb::velocypack::Parser::fromJson(
"{"
" \"IndexValuesVars\" : ["
" \"indexValuesVars\" : ["
" {"
" \"fieldNumber\" : 2,"
" \"id\" : 6,"
@ -596,11 +596,11 @@ TEST_F(IndexNodeTest, invalidLateMaterializedJSON) {
ASSERT_TRUE(indNode.isLateMaterialized());
}
// incorrect IndexValuesVars
// incorrect indexValuesVars
{
auto createJson = arangodb::velocypack::Parser::fromJson(
"{"
" \"IndexValuesVars\" : {"
" \"indexValuesVars\" : {"
" \"fieldNumber\" : 2,"
" \"id\" : 6,"
" \"name\" : \"5\""
@ -651,7 +651,7 @@ TEST_F(IndexNodeTest, invalidLateMaterializedJSON) {
{
auto createJson = arangodb::velocypack::Parser::fromJson(
"{"
" \"IndexValuesVars\" : ["
" \"indexValuesVars\" : ["
" {"
" \"fieldNumber\" : \"two\","
" \"id\" : 6,"
@ -704,7 +704,7 @@ TEST_F(IndexNodeTest, invalidLateMaterializedJSON) {
{
auto createJson = arangodb::velocypack::Parser::fromJson(
"{"
" \"IndexValuesVars\" : ["
" \"indexValuesVars\" : ["
" {"
" \"fieldNumber\" : 2,"
" \"id\" : \"six\","
@ -757,7 +757,7 @@ TEST_F(IndexNodeTest, invalidLateMaterializedJSON) {
{
auto createJson = arangodb::velocypack::Parser::fromJson(
"{"
" \"IndexValuesVars\" : ["
" \"indexValuesVars\" : ["
" {"
" \"fieldNumber\" : 2,"
" \"id\" : 6,"
@ -803,7 +803,7 @@ TEST_F(IndexNodeTest, invalidLateMaterializedJSON) {
{
auto createJson = arangodb::velocypack::Parser::fromJson(
"{"
" \"IndexValuesVars\" : ["
" \"indexValuesVars\" : ["
" {"
" \"fieldNumber\" : 2,"
" \"id\" : 6,"
@ -856,7 +856,7 @@ TEST_F(IndexNodeTest, invalidLateMaterializedJSON) {
{
auto createJson = arangodb::velocypack::Parser::fromJson(
"{"
" \"IndexValuesVars\" : ["
" \"indexValuesVars\" : ["
" {"
" \"fieldNumber\" : 2,"
" \"id\" : 6,"

View File

@ -897,7 +897,7 @@ TEST_F(IResearchViewNodeTest, constructFromVPackSingleServer) {
"\"varsUsedLater\":[], \"varsValid\":[], \"outVariable\": { "
"\"name\":\"variable\", \"id\":0 }, \"outNmColPtr\": { \"name\":\"variable100\", \"id\":100 }, "
"\"outNmDocId\": { \"name\":\"variable100\", \"id\":100 }, "
"\"ViewValuesVars\":{\"fieldNumber\":0, \"id\":101}, "
"\"viewValuesVars\":{\"fieldNumber\":0, \"id\":101}, "
"\"options\": { \"waitForSync\" : "
"true, \"collection\":null }, \"viewId\": \"" +
std::to_string(logicalView->id()) + "\" }");
@ -920,7 +920,7 @@ TEST_F(IResearchViewNodeTest, constructFromVPackSingleServer) {
"\"varsUsedLater\":[], \"varsValid\":[], \"outVariable\": { "
"\"name\":\"variable\", \"id\":0 }, \"outNmColPtr\": { \"name\":\"variable100\", \"id\":100 }, "
"\"outNmDocId\": { \"name\":\"variable100\", \"id\":100 }, "
"\"ViewValuesVars\":[{\"fieldNumber\":\"0\", \"id\":101}], "
"\"viewValuesVars\":[{\"fieldNumber\":\"0\", \"id\":101}], "
"\"options\": { \"waitForSync\" : "
"true, \"collection\":null }, \"viewId\": \"" +
std::to_string(logicalView->id()) + "\" }");
@ -943,7 +943,7 @@ TEST_F(IResearchViewNodeTest, constructFromVPackSingleServer) {
"\"varsUsedLater\":[], \"varsValid\":[], \"outVariable\": { "
"\"name\":\"variable\", \"id\":0 }, \"outNmColPtr\": { \"name\":\"variable100\", \"id\":100 }, "
"\"outNmDocId\": { \"name\":\"variable100\", \"id\":100 }, "
"\"ViewValuesVars\":[{\"fieldNumber\":0, \"id\":\"101\"}], "
"\"viewValuesVars\":[{\"fieldNumber\":0, \"id\":\"101\"}], "
"\"options\": { \"waitForSync\" : "
"true, \"collection\":null }, \"viewId\": \"" +
std::to_string(logicalView->id()) + "\" }");