简体   繁体   English

Apache Ignite-简单缓存上的SQL查询

[英]Apache Ignite - SQL query on a simple cache

I need to perform SQL Queries on my simple key-value cache where key and value are string types. 我需要在我的简单键值缓存中执行SQL查询,其中键和值是字符串类型。 I understand from documnetation that I should add queryEntities property for that, so I added this to my cache configurations: 我从documnetation了解到我应该为此添加queryEntities属性,因此我将其添加到了缓存配置中:

                <property name="queryEntities">
                    <list>
                            <bean class="org.apache.ignite.cache.QueryEntity">
                                    <property name="keyType" value="java.lang.String"/>
                                    <property name="valueType" value="java.lang.String"/>

                            </bean>
                    </list>
            </property>

based on the example here : https://apacheignite.readme.io/docs/cache-queries#scan-queries . 根据此处的示例: https : //apacheignite.readme.io/docs/cache-queries#scan-queries

However,I still can't perform SQL on my cache with "Table not found" error. 但是,我仍然无法在我的缓存上执行“找不到表”错误的SQL。

I am new to Ignite so I wonder if I missing something here another step. 我是Ignite的新手,所以我想知道我是否还缺少其他步骤。 my cache is a simple key-value So I don't need those fields shown in the Person example. 我的缓存是一个简单的键值,因此我不需要Person示例中显示的那些字段。

从您的代码判断,以下方法应该起作用:

SELECT _KEY, _VAL FROM "cacheName".STRING; 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM