当前位置: 首页 > 知识库问答 >
问题:

xml中的TrieDateField与列族中的timestamp冲突

匡祖鹤
2023-03-14

我们刚刚从DataStax Enteprise 3.2.2升级到4.5.1。我们从3.2.2->3.2.5->4.0.3->4.5.1迁移,每次都遵循文档中的过程,并在每次升级后升级sstables。

服务器正在运行,核心正常接受查询。

当将数据映射类型从“2”更改为“1”,并通过API发布配置和模式时,我会得到以下结果:

solrexception:org.apache.Solr.common.solrexception:Solr core Peantus.Oranges的dseTypeMappingVersion=2,无法加载dseTypeMappingVersion=1的新Solr配置。

dseTypeMappingVersion=2的SolrConfig.xml的栈跟踪如下所示:

cqlsh:peanuts> DESCRIBE TABLE oranges;

CREATE TABLE oranges (
  key text,
  "_docBoost" text,
  category_id int,
  category_name text,
  city text,
  country_code text,
  created_at timestamp,
  ...
  solr_query text,
  text text,
  user_id text,
  week_of_year int,
  year int,
  PRIMARY KEY ((key))
) WITH COMPACT STORAGE AND
  bloom_filter_fp_chance=0.010000 AND
  caching='KEYS_ONLY' AND
  comment='' AND
  dclocal_read_repair_chance=0.000000 AND
  gc_grace_seconds=864000 AND
  index_interval=128 AND
  read_repair_chance=0.100000 AND
  replicate_on_write='true' AND
  populate_io_cache_on_flush='false' AND
  default_time_to_live=0 AND
  speculative_retry='99.0PERCENTILE' AND
  memtable_flush_period_in_ms=0 AND
  compaction={'class': 'SizeTieredCompactionStrategy'} AND
  compression={'sstable_compression': 'SnappyCompressor'};

以下是schema.xml的相关摘录:

   <field name="id" type="string" indexed="true" stored="true" required="true" multiValued="false" />
   <field name="created_at" type="date" indexed="true" stored="true" docValues="true" />
   ...

   <field name="postal_code" type="string" stored="true" indexed="true"/>
   <field name="country_code" type="string" stored="true" indexed="true"/>
   <field name="city" type="string" stored="true" indexed="true"/>
   <field name="latitude"  type="float" indexed="true" stored="true"/>
   <field name="longitude"  type="float" indexed="true" stored="true"/>

   <field name="text" type="text_general" indexed="true" stored="false" multiValued="true"/>

 </fields>
  ....    
  <types>
    <fieldType name="string" class="solr.StrField" sortMissingLast="true" />
    <fieldType name="int" class="solr.TrieIntField" precisionStep="0" positionIncrementGap="0"/>
    <fieldType name="float" class="solr.TrieFloatField" precisionStep="0" positionIncrementGap="0"/>
    <fieldType name="date" class="solr.TrieDateField" precisionStep="0" positionIncrementGap="0"/>

我目前的假设是,我们需要将当前的solrconfig更改为类型1的映射,因为这与实际的数据存储设置相对应。但是,如果API不接受帖子,该如何处理呢?

或者,我可以考虑迁移到纯CQL3表,但这将需要从头开始完全重新生成数据,对吗?这能避免吗?

共有1个答案

长孙瑞
2023-03-14

问题是您在版本2中的类型映射,它需要一个TimestampType,而Thrift使用的是DateType。

您需要通过在Solr配置中添加以下代码片段来“强制”降级到类型1:

<dseTypeMappingVersion force="true">1</dseTypeMappingVersion>

然后上传并重新加载核心。

 类似资料:
  • 这是一个很好的例子来解决这个问题。 但是当我在应用程序上下文中遇到相同的问题但没有这些应答器时: 使用注释解决了所有问题,但在我的示例中,我们没有使用允许使用注释的应答器。 我搜索了很多,发现有人在bean声明中谈论属性,我需要更多关于它的解释。

  • 问题内容: 我将重点放在关键值对上,以便与另一台服务器上的值进行比较以进行一致性测试。我遇到了一个返回错误的问题。 Msg 8167,第16级,状态1,第51行 列“类型”的类型与UNPIVOT列表中指定的其他列的类型冲突。 询问: 为什么这样不喜欢,,??? 我也尝试过 问题答案: 这实际上是整理问题。我可以通过更改以下行来解决: 特定的问题是整理为,而您提到的其他3列则整理为(至少,在我的机器

  • ID INT, 主键(BS_CUSTOMER_ID)); 我有一个CSV文件: 从't_customers_13.csv'复制TEST1(BS_CUSTOMER_ID,CRM_CUSTOMER_ID,ID),标头='true',分隔符=','引号='“‘和NULL=''; 我收到一条错误消息: 导入1行失败:ParseError-int()的文本无效,以10:“为基,放弃,不重试 使用VARCHA

  • 我有一个定义为原型的bean作用域,它引用另一个作用域为singleton的bean。从spring文档中,我知道 单例 这将bean定义的范围限定为每个Spring IoC容器的一个实例(默认)。 原型 这将单个bean定义的范围限定为具有任意数量的对象实例。 下面是我的代码: 这是否意味着我在每次需要一个新的员工bean实例时强制Spring生成一个新的员工bean实例,并且部门bean在每个

  • 符合HBase规格: “ColumnFamilies可以以秒为单位设置TTL长度,一旦达到过期时间,HBase将自动删除行。这适用于行的所有版本,甚至是当前版本。在HBase中为行编码的TTL时间是在UTC中指定的。” null