属性具有含义INDEX_VALUE,但不具有任何意义 [英] Property has meaning INDEX_VALUE, but is not expected to have any meaning

查看:162
本文介绍了属性具有含义INDEX_VALUE,但不具有任何意义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在尝试从云备份加载数据时,我收到来自BigQuery的错误。




从Google BigQuery Console


错误

查询:integer类型的属性established_year具有含义INDEX_VALUE,但不具有任何意义。 (错误代码:invalidQuery)

作业ID :csgapi:bquijob_736ab47b_156b2f2a4f8


我在模型中查找错误引用的模型,它的类型为ndb.InteProProperty。当我查看ndb.IntegerProperty扩展的Property类时,我看到一个注释,其中设置了 new_p.set_meaning(entity_pb.Property.INDEX_VALUE)文档在这里)。

 #预计属性具有INDEX_VALUE含义,并且只包含
#原始属性的名称和值。

ndb.IntegerProperty类型的属性如何设置此INDEX_VALUE,我该如何解决此问题

编辑



进一步考虑这一点,我很好奇为什么该物业甚至被列入这个项目。根据模型,我有两个元素可能是违规的属性。第一个属性是公司,这是一个NDB.KeyProperty,看起来不太可能,因为这只会创建一个引用。另一个是通用属性company_base,它没有编制索引,也映射到查询上;这不会保存到数据存储区。我们有14 GB的这种数据。我试图遍历备份中的所有元素以搜索company_base字段,但我无法找到文件中的元素。

我研究过使用相同结构的其他类型,并且它们的模式在模式中似乎没有相同的company_base。他们也不应该将该元素保存到数据存储区。

如果元素出现在备份模式中,那么这是否意味着在某个时间点这些非索引属性被保存到数据存储中并因此出现在备份?



来自备份架构的通用字段company_base:

<$ p $ 字段{
名称:company_base
类型{
is_list:false
embedded_schema {
类型:公司
字段{
名称:ambest_outlook
类型{
is_list:false
primitive_type:STRING
}
}
字段{
name:name_full
type {
is_list:false
primitive_type:STRING
}
}
字段{
name: established_year
类型{
is_list:false
primitive_type:INTEGER
}
}
字段{
name:a mbest_rating
type {
is_list:false
primitive_type:STRING
}
}
字段{
名称:parent_company
类型{
is_list:false
primitive_type:REFERENCE
}
}
字段{
名称:sp_rating
类型{
is_list:false
primitive_type:STRING
}
}
}
}
}
pre>

Smitty

解决方案

出现在整个备份中,出现了一个错误类型的单个元素。由于NDB的结构,通常不会出现。我能够解决这个问题的唯一方法是导航实体并删除违规属性以确保正确性。

系统通过迭代修复它花了很长时间,但它们不是可搜索的项目。

I am receiving an error from BigQuery when attempting to load data from a cloud backup.

From Google BigQuery Console

Errors:
query: Property established_year of type integer has meaning INDEX_VALUE, but is not expected to have any meaning. (error code: invalidQuery)

Job ID: csgapi:bquijob_736ab47b_156b2f2a4f8

I have looked up in the model that the error is referencing to and it is of type ndb.IntegerProperty. When I then look at the Property class that ndb.IntegerProperty extends, I see a comment where new_p.set_meaning(entity_pb.Property.INDEX_VALUE) is set (Docs here) that says.

# Projected properties have the INDEX_VALUE meaning and only contain
# the original property's name and value.

How is my property of type ndb.IntegerProperty have this INDEX_VALUE set and what must I do to fix this?

EDIT

Looking further into this, I was curious as to why the property was even being included on this item. According to the model I have two elements that could be the offending properties. The first property is company, which is an NDB.KeyProperty, which does not seem likely because this would only create a reference. The other is a Generic Property, company_base, that is not indexed and also is mapped on query; this is not saved to the data store. We have 14 GB of data for this specific kind. I have attempted to loop through all the elements within the backup to search for the field company_base, but I am not able to find the elements that are in the file.

I have looked at other kinds that use this same structure, and their schema's do not appear to have the same "company_base" within their schema. They too should not save that element to the datastore.

If the elements are appearing in the backup schema, does that mean that at some point in time these non-indexed properties were saved to the datastore and thus appear in the backup?

The generic field "company_base" from the backup schema:

field {
  name: "company_base"
  type {
    is_list: false
    embedded_schema {
      kind: "Company"
      field {
        name: "ambest_outlook"
        type {
          is_list: false
          primitive_type: STRING
        }
      }
      field {
        name: "name_full"
        type {
          is_list: false
          primitive_type: STRING
        }
      }
      field {
        name: "established_year"
        type {
          is_list: false
          primitive_type: INTEGER
        }
      }
      field {
        name: "ambest_rating"
        type {
          is_list: false
          primitive_type: STRING
        }
      }
      field {
        name: "parent_company"
        type {
          is_list: false
          primitive_type: REFERENCE
        }
      }
      field {
        name: "sp_rating"
        type {
          is_list: false
          primitive_type: STRING
        }
      }
    }
  }
}

Smitty

解决方案

Within the schema, though it would only appear on the entire backup, there appeared a single element with wrong type. The wouldn't appear normally due to NDB's structure. The only way that I was able to fix this issue was to navigate the entities and remove the offending properties to ensure correctness.

It took a long time for the system to fix it via iteration, but they were not searchable items.

这篇关于属性具有含义INDEX_VALUE,但不具有任何意义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆